PageSourceSearch

https://grid.maplecroft.com/970.5b8305dcd9a23e79.js

js maplecroft.com collected 2026-10-02 02:55:16 UTC 428,603 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkgrid=self.webpackChunkgrid||[]).push([[970],{87057(Ri,ce,R){R.d(ce,{CommodityModule:()=>by});var Rt=R(27291),wt=R(79748),kt=R(50698),Y=R(34456),ot=R(22797),tt=R(31702),Ft=R(46264),a=R(44436);let As=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=a.VBU({type:i,selectors:[["grid-ui-commodity-about"]],standalone:!1,decls:426,vars:0,consts:[[1,"panel"],[1,"panel-header"],[1,"panel-body","panel-border"],[1,"table","table-bordered"],["rowspan","3"],["rowspan","2"],["rowspan","4"],["rowspan","6"],["rowspan","5"]],template:function(n,s){1&n&&(a.j41(0,"div",0)(1,"div",1),a.EFF(2,"Definitions"),a.k0s(),a.j41(3,"div",2)(4,"table",3)(5,"thead")(6,"tr")(7,"th"),a.EFF(8,"Pillar"),a.k0s(),a.j41(9,"th"),a.EFF(10,"Issue"),a.k0s(),a.j41(11,"th"),a.EFF(12,"Definition"),a.k0s(),a.j41(13,"th"),a.EFF(14,"Indicators"),a.k0s(),a.j41(15,"th"),a.EFF(16,"Indicator Weight"),a.k0s()()(),a.j41(17,"tbody")(18,"tr")(19,"td",4),a.EFF(20,"Social"),a.k0s(),a.j41(21,"td",4),a.EFF(22,"Child labour"),a.k0s(),a.j41(23,"td",4),a.EFF(24," This assesses the likelihood that child labour is used in the production of the commodity. Child labour is defined as ages 5-17. The minimum age for work according to international standards is 14. Children between 15-17 can work but cannot do hazardous work (that damages health, safety or morals). If they do hazardous work, this is considered child labour. "),a.k0s(),a.j41(25,"td"),a.EFF(26,"Child Labour Index"),a.k0s(),a.j41(27,"td"),a.EFF(28,"50.0%"),a.k0s()(),a.j41(29,"tr")(30,"td"),a.EFF(31,"Producer profile"),a.k0s(),a.j41(32,"td"),a.EFF(33,"15.0%"),a.k0s()(),a.j41(34,"tr")(35,"td"),a.EFF(36,"Direct evidence"),a.k0s(),a.j41(37,"td"),a.EFF(38,"35.0%"),a.k0s()(),a.j41(39,"tr")(40,"td",5),a.EFF(41,"Social"),a.k0s(),a.j41(42,"td",5),a.EFF(43,"Discrimination"),a.k0s(),a.j41(44,"td",5),a.EFF(45," Assesses the risk of discrimination in access to and during employment. This includes the extent to which individuals are treated less favourably, directly or indirectly, in the workplace because of their gender, ethnicity, religion or belief, disability, contraction of HIV/AIDS, migration status, nationality, sexual orientation or gender reassignment or based on any other grounds not related to the requirements of the job, which a person is required to undertake. "),a.k0s(),a.j41(46,"td"),a.EFF(47,"Discrimination in the Workplace Index"),a.k0s(),a.j41(48,"td"),a.EFF(49,"50.0%"),a.k0s()(),a.j41(50,"tr")(51,"td"),a.EFF(52,"Vulnerable groups"),a.k0s(),a.j41(53,"td"),a.EFF(54,"50.0%"),a.k0s()(),a.j41(55,"tr")(56,"td",6),a.EFF(57,"Social"),a.k0s(),a.j41(58,"td",6),a.EFF(59,"Forced Labour"),a.k0s(),a.j41(60,"td",6),a.EFF(61," This assesses the likelihood that forced labour is used in the production of the commodity. Forced labour is defined as those persons (children or adults) that are engaged in work or service which is exacted from them under the menace of any penalty and for which they have not offered themself voluntarily. Persons forced to work may be coerced through the use of violence or intimidation, or by more subtle means such as accumulated debt, retention of identity papers or threats of denunciation to immigration authorities "),a.k0s(),a.j41(62,"td"),a.EFF(63,"Forced Labour Index"),a.k0s(),a.j41(64,"td"),a.EFF(65,"50.0%"),a.k0s()(),a.j41(66,"tr")(67,"td"),a.EFF(68,"Direct evidence"),a.k0s(),a.j41(69,"td"),a.EFF(70,"35.0%"),a.k0s()(),a.j41(71,"tr")(72,"td"),a.EFF(73,"Labour profile"),a.k0s(),a.j41(74,"td"),a.EFF(75,"7.5%"),a.k0s()(),a.j41(76,"tr")(77,"td"),a.EFF(78,"Hiring practices"),a.k0s(),a.j41(79,"td"),a.EFF(80,"7.5%"),a.k0s()(),a.j41(81,"tr")(82,"td",5),a.EFF(83,"Social"),a.k0s(),a.j41(84,"td",5),a.EFF(85,"Freedom of association and collective bargaining"),a.k0s(),a.j41(86,"td",5),a.EFF(87," Assesses the risk posed to business by allegations of complicity or direct involvement in violations of workers right to establish and to join independent organisations of their choice, without prior authorisation and to promote and defend their respective interests freely. "),a.k0s(),a.j41(88,"td"),a.EFF(89,"Freedom of Association and Collective Bargaining Index"),a.k0s(),a.j41(90,"td"),a.EFF(91,"50.0%"),a.k0s()(),a.j41(92,"tr")(93,"td"),a.EFF(94,"Direct evidence"),a.k0s(),a.j41(95,"td"),a.EFF(96,"50.0%"),a.k0s()(),a.j41(97,"tr")(98,"td",6),a.EFF(99,"Social"),a.k0s(),a.j41(100,"td",6),a.EFF(101,"Human trafficking"),a.k0s(),a.j41(102,"td",6),a.EFF(103," Assesses the risk that victims of human trafficking are used in the production of the commodity. Human trafficking is when a person arranges or facilitates the travel of another person with a view to that person being exploited through labour or sexual exploitation. "),a.k0s(),a.j41(104,"td"),a.EFF(105,"Human Trafficking Index"),a.k0s(),a.j41(106,"td"),a.EFF(107,"50.0%"),a.k0s()(),a.j41(108,"tr")(109,"td"),a.EFF(110,"Direct evidence"),a.k0s(),a.j41(111,"td"),a.EFF(112,"35.0%"),a.k0s()(),a.j41(113,"tr")(114,"td"),a.EFF(115,"Labour profile"),a.k0s(),a.j41(116,"td"),a.EFF(117,"7.5%"),a.k0s()(),a.j41(118,"tr")(119,"td"),a.EFF(120,"Hiring practices"),a.k0s(),a.j41(121,"td"),a.EFF(122,"7.5%"),a.k0s()(),a.j41(123,"tr")(124,"td",5),a.EFF(125,"Social"),a.k0s(),a.j41(126,"td",5),a.EFF(127,"Migrant labour"),a.k0s(),a.j41(128,"td",5),a.EFF(129," Assesses the likelihood that migrant labourers \u2013 both internal and international - are involved in the production of the commodity. Migrant labourers can be highly vulnerable to exploitative employment practices. "),a.k0s(),a.j41(130,"td"),a.EFF(131,"Migrant Workers Index"),a.k0s(),a.j41(132,"td"),a.EFF(133,"50.0%"),a.k0s()(),a.j41(134,"tr")(135,"td"),a.EFF(136,"Direct evidence"),a.k0s(),a.j41(137,"td"),a.EFF(138,"50.0%"),a.k0s()(),a.j41(139,"tr")(140,"td",6),a.EFF(141,"Social"),a.k0s(),a.j41(142,"td",6),a.EFF(143,"Occupational health and safety"),a.k0s(),a.j41(144,"td",6),a.EFF(145," Assesses the likelihood that workers involved in the production of the commodity are exposed to poor occupational health & safety standards and practices. "),a.k0s(),a.j41(146,"td"),a.EFF(147,"Occupational Health and Safety Index"),a.k0s(),a.j41(148,"td"),a.EFF(149,"50.0%"),a.k0s()(),a.j41(150,"tr")(151,"td"),a.EFF(1
152,"Direct evidence"),a.k0s(),a.j41(153,"td"),a.EFF(154,"35.0%"),a.k0s()(),a.j41(155,"tr")(156,"td"),a.EFF(157,"Producer profile"),a.k0s(),a.j41(158,"td"),a.EFF(159,"7.5%"),a.k0s()(),a.j41(160,"tr")(161,"td"),a.EFF(162,"Employment profile"),a.k0s(),a.j41(163,"td"),a.EFF(164,"7.5%"),a.k0s()(),a.j41(165,"tr")(166,"td",6),a.EFF(167,"Social"),a.k0s(),a.j41(168,"td",6),a.EFF(169,"Decent Wages"),a.k0s(),a.j41(170,"td",6),a.EFF(171," Assesses the risk that workers involved in primary production are paid wages that are below the legal minimum wage, and which therefore may not cover basic living costs, or that workers experience wage violations such as late payment, or the non-payment of premiums for overtime. "),a.k0s(),a.j41(172,"td"),a.EFF(173,"Decent Wages Index"),a.k0s(),a.j41(174,"td"),a.EFF(175,"50.0%"),a.k0s()(),a.j41(176,"tr")(177,"td"),a.EFF(178,"Direct evidence"),a.k0s(),a.j41(179,"td"),a.EFF(180,"35.0%"),a.k0s()(),a.j41(181,"tr")(182,"td"),a.EFF(183,"Employment profile"),a.k0s(),a.j41(184,"td"),a.EFF(185,"7.5%"),a.k0s()(),a.j41(186,"tr")(187,"td"),a.EFF(188,"Vulnerable groups"),a.k0s(),a.j41(189,"td"),a.EFF(190,"7.5%"),a.k0s()(),a.j41(191,"tr")(192,"td",6),a.EFF(193,"Social"),a.k0s(),a.j41(194,"td",6),a.EFF(195,"Decent working hours"),a.k0s(),a.j41(196,"td",6),a.EFF(197," The working hours metric assesses the likelihood that workers involved in the production of the commodity experience violations of working hours regulations. "),a.k0s(),a.j41(198,"td"),a.EFF(199,"Decent Working Time Index"),a.k0s(),a.j41(200,"td"),a.EFF(201,"50.0%"),a.k0s()(),a.j41(202,"tr")(203,"td"),a.EFF(204,"Direct evidence"),a.k0s(),a.j41(205,"td"),a.EFF(206,"35.0%"),a.k0s()(),a.j41(207,"tr")(208,"td"),a.EFF(209,"Employment profile"),a.k0s(),a.j41(210,"td"),a.EFF(211,"7.5%"),a.k0s()(),a.j41(212,"tr")(213,"td"),a.EFF(214,"Vulnerable groups"),a.k0s(),a.j41(215,"td"),a.EFF(216,"7.5%"),a.k0s()(),a.j41(217,"tr")(218,"td",5),a.EFF(219,"Political"),a.k0s(),a.j41(220,"td",5),a.EFF(221,"Corruption"),a.k0s(),a.j41(222,"td",5),a.EFF(223," This assesses the extent to which corruption may be present in the production of the commodity or wider aspects of the production environment such as illegal production, counterfeit goods, illegal trading and bribery. "),a.k0s(),a.j41(224,"td"),a.EFF(225,"Corruption Risk Index"),a.k0s(),a.j41(226,"td"),a.EFF(227,"50.0%"),a.k0s()(),a.j41(228,"tr")(229,"td"),a.EFF(230,"Direct evidence"),a.k0s(),a.j41(231,"td"),a.EFF(232,"50.0%"),a.k0s()(),a.j41(233,"tr")(234,"td",5),a.EFF(235,"Political"),a.k0s(),a.j41(236,"td",5),a.EFF(237,"Land grabs"),a.k0s(),a.j41(238,"td",5),a.EFF(239," Assesses the likelihood that commodity production occurs on land that has been obtained in a controversial manner and may be considered a \u2018land grab\u2019 by certain audiences. These types of land acquisitions can include: "),a.j41(240,"ul")(241,"li"),a.EFF(242,"A transfer of rights to use, control or ownership of land through sale, lease or concession"),a.k0s(),a.j41(243,"li"),a.EFF(244," Imply the potential conversion of land from local community use or important ecosystem service provision to commercial use "),a.k0s()()(),a.j41(245,"td"),a.EFF(246,"Land, Property and Housing Rights Index"),a.k0s(),a.j41(247,"td"),a.EFF(248,"50.0%"),a.k0s()(),a.j41(249,"tr")(250,"td"),a.EFF(251,"Direct evidence"),a.k0s(),a.j41(252,"td"),a.EFF(253,"50.0%"),a.k0s()(),a.j41(254,"tr")(255,"td",4),a.EFF(256,"Political"),a.k0s(),a.j41(257,"td",4),a.EFF(258,"Political instability"),a.k0s(),a.j41(259,"td",4),a.EFF(260," This assesses the extent to which mining areas may overlap with locations which are exposed to conflict and instability, which may affect production. "),a.k0s(),a.j41(261,"td"),a.EFF(262,"Conflict Intensity Index"),a.k0s(),a.j41(263,"td",5),a.EFF(264,"50% (whichever index is highest risk)"),a.k0s()(),a.j41(265,"tr")(266,"td"),a.EFF(267,"Civil Unrest Index"),a.k0s()(),a.j41(268,"tr")(269,"td"),a.EFF(270,"Production in unstable parts of the country"),a.k0s(),a.j41(271,"td"),a.EFF(272,"50.0%"),a.k0s()(),a.j41(273,"tr")(274,"td",5),a.EFF(275,"Environmental"),a.k0s(),a.j41(276,"td",5),a.EFF(277,"Climate Hazard and Vulnerability 2050 SSP585"),a.k0s(),a.j41(278,"td",5),a.EFF(279," This is to assess the expected vulnerability of the production of the commodity to climate change, based on the inherent levels of vulnerability present in the country in conjunction with any more specific projections with respect to production of the commodity. "),a.k0s(),a.j41(280,"td"),a.EFF(281,"Climate Hazard and Vulnerability 2050 SSP585 Index"),a.k0s(),a.j41(282,"td"),a.EFF(283,"50.0%"),a.k0s()(),a.j41(284,"tr")(285,"td"),a.EFF(286,"Direct evidence"),a.k0s(),a.j41(287,"td"),a.EFF(288,"50.0%"),a.k0s()(),a.j41(289,"tr")(290,"td",5),a.EFF(291,"Environmental"),a.k0s(),a.j41(292,"td",5),a.EFF(293,"Deforestation"),a.k0s(),a.j41(294,"td",5),a.EFF(295," This assesses the risk that the production of the commodity is linked, directly or indirectly, with deforestation. "),a.k0s(),a.j41(296,"td"),a.EFF(297,"Deforestation Rates Index"),a.k0s(),a.j41(298,"td"),a.EFF(299,"50.0%"),a.k0s()(),a.j41(300,"tr")(301,"td"),a.EFF(302,"Direct evidence"),a.k0s(),a.j41(303,"td"),a.EFF(304,"50.0%"),a.k0s()(),a.j41(305,"tr")(306,"td"),a.EFF(307,"Environmental"),a.k0s(),a.j41(308,"td"),a.EFF(309,"GHG emissions"),a.k0s(),a.j41(310,"td"),a.EFF(311," This assesses the extent of the carbon footprint associated with the production of a fixed quantity of the commodity via the associated greenhouse gas (GHG) emissions. "),a.k0s(),a.j41(312,"td"),a.EFF(313,"GHG emissions"),a.k0s(),a.j41(314,"td"),a.EFF(315,"100.0%"),a.k0s()(),a.j41(316,"tr")(317,"td",7),a.EFF(318,"Environmental"),a.k0s(),a.j41(319,"td",7),a.EFF(320,"Natural hazards"),a.k0s(),a.j41(321,"td",7),a.EFF(322," This assesses the extent to which the commodity is exposed to key hydro-meteorological hazards which pose a threat to production. "),a.k0s(),a.j41(323,"td"),a.EFF(324,"Flood Hazard Index"),a.k0s(),a.j41(325,"td"),a.EFF(326,"12.5%"),a.k0s()(),a.j41(327,"tr")(328,"td"),a.EFF(329,"Drought Hazard Index"),a.k0s(),a.j41(330,"td"),a.EFF(331,"12.5%"),a.k0s()(),a.j41(332,"tr")(333,"td"),a.EFF(334,"Severe Storm Hazard Index"),a.k0s(),a.j41(335,"td"),a.EFF(336,"12.5%"),a.k0s()(),a.j41(337,"tr")(338,"td"),a.EFF(339,"Tropical Storm and Cyclone Harzard Index"),a.k0s(),a.j41(340,"td"),a.EFF(341,"12.5%"),a.k0s()(),a.j41(342,"tr")(343,"td"),a.EFF(344,"Yield change (frequency)"),a.k0s(),a.j41(345,"td"),a.EFF(346,"25.0%"),a.k0s()(),a.j41(347,"tr")(348,"td"),a.EFF(349,"Production impact (magnitude)"),a.k0s(),a.j41(350,"td"),a.EFF(351,"25.0%"),a.k0s()(),a.j41(352,"tr")(353,"td",8),a.EFF(354,"Environmental"),a.k0s(),a.j41(355,"td",8),a.EFF(356,"Water pollution"),a.k0s(),a.j41(357,"td",8),a.EFF(358," This assesses the likelihood that the production of the commodity is associated with adverse water quality impacts (including ground or surface water resources). "),a.k0s(),a.j41(359,"td"),a.EFF(360,"Water Quality Index"),a.k0s(),a.j41(361,"td"),a.EFF(362,"12.5%"),a.k0s()(),a.j41(363,"tr")(364,"td"),a.EFF(365,"Water Pollution Index"),a.k0s(),a.j41(366,"td"),a.EFF(367,"12.5%"),a.k0s()(),a.j41(368,"tr")(369,"td"),a.EFF(370,"International conventions"),a.k0s(),a.j41(371,"td"),a.EFF(372,"12.5%"),a.k0s()(),a.j41(373,"tr")(374,"td"),a.EFF(375,"Domestic laws"),a.k0s(),a.j41(376,"td"),a.EFF(377,"12.5%"),a.k0s()(),a.j41(378,"tr")(379,"td"),a.EFF(380,"Direct evidence"),a.k0s(),a.j41(381,"td"),a.EFF(382,"50.0%"),a.k0s()(),a.j41(383,"tr")(384,"td",5),a.EFF(385,"Environmental"),a.k0s(),a.j41(386,"td",5),a.EFF(387,"Water stress"),a.k0s(),a.j41(388,"td",5),a.EFF(389," This assesses the extent to which the production of the commodity is exposed to water stress risks, both from the perspective of the inherent water resources situation in the producing country and the water requirements of the commodity itself. "),a.k0s(),a.j41(390,"td"),a.EFF(391,"Water Stress Index"),a.k0s(),a.j41(392,"td"),a.EFF(393,"50.0%"),a.k0s()(),a.j41(394,"tr")(395,"td"),a.EFF(396,"Water footprint"),a.k0s(),a.j41(397,"td"),a.EFF(398,"50.0%"),a.k0s()(),a.j41(399,"tr")(400,"td",5),a.EFF(401,"Cross-cutting supply chain risks"),a.k0s(),a.j41(402,"td",5),a.EFF(403,"Certified sustainable production"),a.k0s(),a.j41(404,"td",5),a.EFF(405,"Assesses the maturity and availability of sustainably certified supplies of the commodity."),a.k0s(),a.j41(406,"td"),a.EFF(407,"Availability of certified sustainable production"),a.k0s(),a.j41(408,"td"),a.EFF(409,"50.0%"),a.k0s()(),a.j41(410,"tr")(411,"td"),a.EFF(412,"Voluntary sustainable standard transparency"),a.k0s(),a.j41(413,"td"),a.EFF(414,"50.0%"),a.k0s()(),a.j41(415,"tr")(416,"td"),a.EFF(417,"Cross-cutting supply chain risks"),a.k0s(),a.j41(418,"td"),a.EFF(419,"Wider value chain risks"),a.k0s(),a.j41(420,"td"),a.EFF(421," Assesses the extent to which there are very serious and high profile E&S risks situated in parts of the value chain that lie outside the farm or mine level stage of production. "),a.k0s(),a.j41(422,"td"),a.EFF(423,"Value chaing risks"),a.k0s(),a.j41(424,"td"),a.EFF(425,"100.0%"),a.k0s()()()()()())},styles:["[_nghost-%COMP%]{overflow:hidden}.panel[_ngcontent-%COMP%]{margin:.3rem;padding-bottom:.6rem}.panel-body[_ngcontent-%COMP%]{overflow:auto}.table[_ngcontent-%COMP%]{margin-bottom:0}"],changeDetection:1})}}return i})();var ih=R(98764),Dt=function(i){return i.TYPE_CHANGE="[Data Filter Action] Commodity Type Selection Changed",i.COMMODITY_CHANGE="[Data Filter Action] Commodity Selection Changed",i.COUNTRY_CHANGE="[Data Filter Action] Country Selection Changed",i.PILLAR_CHANGE="[Data Filter Action] Pillar Selection Changed",i.ISSUE_CHANGE="[Data Filter Action] Issue Selection Changed",i.RESET_ALL="[Data Filter Action] Reset All Filters",i}(Dt||{});class sh{constructor(t){this.payload=t,this.type=Dt.TYPE_CHANGE}}class rh{constructor(t){this.payload=t,this.type=Dt.COMMODITY_CHANGE}}class oh{constructor(t){this.payload=t,this.type=Dt.COUNTRY_CHANGE}}class ah{constructor(t){this.payload=t,this.type=Dt.PILLAR_CHANGE}}class lh{constructor(t){this.payload=t,this.type=Dt.ISSUE_CHANGE}}class ch{constructor(){this.type=Dt.RESET_ALL}}var P=R(8137),Ko=R(83305),Fi=R(39105),Ht=R(53117),hh=R(57421),Xo=R(95116),Yo=R(78434),Uo=R(64059),Ho=R(7110),Ts=R(67562);const uh=(0,Xo.A)(function(t,e){if((0,Yo.A)(t)){if((0,Yo.A)(e))return t.concat(e);throw new TypeError((0,Ts.A)(e)+" is not an array")}if((0,Ho.A)(t)){if((0,Ho.A)(e))return t+e;throw new TypeError((0,Ts.A)(e)+" is not a string")}if(null!=t&&(0,Uo.A)(t["fantasy-land/concat"]))return t["fantasy-land/concat"](e);if(null!=t&&(0,Uo.A)(t.concat))return t.concat(e);
1throw new TypeError((0,Ts.A)(t)+' does not have a method named "concat" or "fantasy-land/concat"')});var he=R(56232);const gh=(0,Xo.A)(function(t,e){return Number(t)+Number(e)}),$o=(0,R(50724).A)(gh,0);var Ai=R(75589),$t=R(56042),Cn=R(75797),vt=R(19999),dt=R(70271),Ti=R(91817),Lt=R(64334),de=R(86301);const Ye={AF:"Afghanistan",AX:"Aland Islands",AL:"Albania",DZ:"Algeria",AS:"American Samoa",AD:"Andorra",AO:"Angola",AI:"Anguilla",AQ:"Antarctica",AG:"Antigua and Barbuda",AR:"Argentina",AM:"Armenia",AW:"Aruba",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BS:"Bahamas",BH:"Bahrain",BD:"Bangladesh",BB:"Barbados",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BM:"Bermuda",BT:"Bhutan",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BA:"Bosnia and Herzegovina",BW:"Botswana",BV:"Bouvet Island",BR:"Brazil",IO:"British Indian Ocean Territory",BN:"Brunei Darussalam",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",KH:"Cambodia",CM:"Cameroon",CA:"Canada",CV:"Cape Verde",KY:"Cayman Islands",CF:"Central African Republic",TD:"Chad",CL:"Chile",CN:"China",CX:"Christmas Island",CC:"Cocos (Keeling) Islands",CO:"Colombia",KM:"Comoros",CG:"Congo",CD:"DR Congo",CK:"Cook Islands",CR:"Costa Rica",CI:"C\xf4te d'Ivoire",HR:"Croatia",CU:"Cuba",CW:"Cura\xe7ao",CY:"Cyprus",CZ:"Czech Republic",DK:"Denmark",DJ:"Djibouti",DM:"Dominica",DO:"Dominican Republic",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",GQ:"Equatorial Guinea",ER:"Eritrea",EE:"Estonia",ET:"Ethiopia",FK:"Falkland Islands (Malvinas)",FO:"Faroe Islands",FJ:"Fiji",FI:"Finland",FR:"France",GF:"French Guiana",PF:"French Polynesia",TF:"French Southern Territories",GA:"Gabon",GM:"Gambia",GE:"Georgia",DE:"Germany",GH:"Ghana",GI:"Gibraltar",GR:"Greece",GL:"Greenland",GD:"Grenada",GP:"Guadeloupe",GU:"Guam",GT:"Guatemala",GG:"Guernsey",GN:"Guinea",GW:"Guinea-Bissau",GY:"Guyana",HT:"Haiti",HM:"Heard Island and McDonald Islands",VA:"Vatican City",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:"Iran",IQ:"Iraq",IE:"Ireland",IM:"Isle of Man",IL:"Israel",IT:"Italy",JM:"Jamaica",JP:"Japan",JE:"Jersey",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KI:"Kiribati",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KG:"Kyrgyzstan",LA:"Laos",LV:"Latvia",LB:"Lebanon",LS:"Lesotho",LR:"Liberia",LY:"Libya",LI:"Liechtenstein",LT:"Lithuania",LU:"Luxembourg",MO:"Macao",MK:"Macedonia",MG:"Madagascar",MW:"Malawi",MY:"Malaysia",MV:"Maldives",ML:"Mali",MT:"Malta",MH:"Marshall Islands",MQ:"Martinique",MR:"Mauritania",MU:"Mauritius",YT:"Mayotte",MX:"Mexico",FM:"Micronesia",MD:"Moldova",MC:"Monaco",MN:"Mongolia",ME:"Montenegro",MS:"Montserrat",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NA:"Namibia",NR:"Nauru",NP:"Nepal",NL:"Netherlands",NC:"New Caledonia",NZ:"New Zealand",NI:"Nicaragua",NE:"Niger",NG:"Nigeria",NU:"Niue",NF:"Norfolk Island",MP:"Northern Mariana Islands",NO:"Norway",OM:"Oman",PK:"Pakistan",PW:"Palau",PS:"Palestine",PA:"Panama",PG:"Papua New Guinea",PY:"Paraguay",PE:"Peru",PH:"Philippines",PN:"Pitcairn",PL:"Poland",PT:"Portugal",PR:"Puerto Rico",QA:"Qatar",RE:"Reunion",RO:"Romania",RU:"Russia",RW:"Rwanda",BL:"Saint Barth\xe9lemy",SH:"Saint Helena",KN:"Saint Kitts and Nevis",LC:"Saint Lucia",MF:"Saint Martin (French part)",PM:"Saint Pierre and Miquelon",VC:"Saint Vincent and the Grenadines",WS:"Samoa",SM:"San Marino",ST:"Sao Tome and Principe",SA:"Saudi Arabia",SN:"Senegal",RS:"Serbia",SC:"Seychelles",SL:"Sierra Leone",SG:"Singapore",SX:"Sint Maarten (Dutch part)",SK:"Slovakia",SI:"Slovenia",SB:"Solomon Islands",SO:"Somalia",ZA:"South Africa",GS:"South Georgia and the South Sandwich Islands",SS:"South Sudan",ES:"Spain",LK:"Sri Lanka",SD:"Sudan",SR:"Suriname",SJ:"Svalbard and Jan Mayen",SZ:"Swaziland",SE:"Sweden",CH:"Switzerland",SY:"Syrian Arab Republic",TW:"Taiwan",TJ:"Tajikistan",TZ:"Tanzania",TH:"Thailand",TL:"Timor-Leste",TG:"Togo",TK:"Tokelau",TO:"Tonga",TT:"Trinidad and Tobago",TN:"Tunisia",TR:"Turkey",TM:"Turkmenistan",TC:"Turks and Caicos Islands",TV:"Tuvalu",UG:"Uganda",UA:"Ukraine",AE:"United Arab Emirates",GB:"United Kingdom",US:"United States",UM:"United States Minor Outlying Islands",UY:"Uruguay",UZ:"Uzbekistan",VU:"Vanuatu",VE:"Venezuela, Bolivarian Republic of",VN:"Vietnam",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",WF:"Wallis and Futuna",EH:"Western Sahara",YE:"Yemen",ZM:"Zambia",ZW:"Zimbabwe"};var Zo=R(64398);let _h=(()=>{class i{constructor(e){this.http=e,this.url=`${Zo.c.commodity.api}entitlement`}getEntitlement(){return this.entitlement||(this.entitlement=this.http.get(this.url).pipe((0,de.t)(1))),this.entitlement}static{this.\u0275fac=function(n){return new(n||i)(P.KVO(kt.Qq))}}static{this.\u0275prov=P.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var ks=R(30056),yh=R(53397),Ch=R(63965);function bh(i){return function t(e){for(var n,s,r,o=[],l=0,c=e.length;l<c;){if((0,Ch.A)(e[l]))for(r=0,s=(n=i?t(e[l]):e[l]).length;r<s;)o[o.length]=n[r],r+=1;else o[o.length]=e[l];l+=1}return o}}const Eh=(0,yh.A)(bh(!0));var wh=R(23513),Jo=R(61873),vh=R(49923),xh=R(50819);const Mh=(i,t)=>(i.push(t),i);let Oh=(()=>{class i{constructor(e){this.http=e,this.urlPrefix=Zo.c.commodity.api}getRiskDriverTableData(){return this.table||(this.table=this.http.get(this.urlPrefix+"table/").pipe((0,dt.T)(e=>e.map(n=>({...n,countryName:Ye[n.ctry]}))),(0,de.t)(1))),this.table}getOverallCommodityScores(){return this.commodityScoreTable||(this.commodityScoreTable=this.http.get(this.urlPrefix+"commodity-score-table/").pipe((0,de.t)(1))),this.commodityScoreTable}
1getMapData(){return this.map||(this.map=this.http.get(this.urlPrefix+"map/").pipe((0,de.t)(1))),this.map}getIndicatorData(){return this.indicator||(this.indicator=(0,wh.x)((0,Jo.p)([this.http.get(this.urlPrefix+"indicator/1/"),this.http.get(this.urlPrefix+"indicator/2/"),this.http.get(this.urlPrefix+"indicator/3/"),this.http.get(this.urlPrefix+"indicator/4/")]),(0,Jo.p)([this.http.get(this.urlPrefix+"indicator/5/"),this.http.get(this.urlPrefix+"indicator/6/"),this.http.get(this.urlPrefix+"indicator/7/"),this.http.get(this.urlPrefix+"indicator/8/")])).pipe((0,Lt.s)(2),function Ih(){return(0,xh.N)((i,t)=>{(0,vh.T)(Mh,[])(i).subscribe(t)})}(),(0,dt.T)(e=>Ai.A(ks.A("Commodity"),Eh(e)).map(s=>({...s,CountryName:Ye[s["Country Code"]]}))),(0,de.t)(1))),this.indicator}static{this.\u0275fac=function(n){return new(n||i)(P.KVO(kt.Qq))}}static{this.\u0275prov=P.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();const Ph={"Cross-cutting supply chain risks":["Certified Sustainable Production","Wider Value Chain Risks"],Environmental:["Climate Hazard and Vulnerability 2050 SSP585","Deforestation Rates","Greenhouse Gas Emissions","Natural Hazards","Water Pollution","Water Stress"],Political:["Corruption","Land Grabs","Political Instability"],Social:["Child Labour","Freedom of Association and Collective Bargaining","Discrimination in the Workplace","Forced labour","Trafficking in Persons","Migrant Workers","Occupational Health and Safety","Decent Wages","Decent Working Time"]};let qo=(()=>{class i{constructor(){this.structure=Ph,this.issueNames=[],this.issueKeys=[],this.pillarsLowercase=[],this.issuePillarLookup={},this.issueKeyPillarKeyLookup={},this.pillarNames=[],this.pillarKeys=[],Object.keys(this.structure).forEach(e=>{this.issueNames=[...this.issueNames,...this.structure[e]]}),this.issueKeys=this.issueNames.map(e=>e.toLowerCase()),Object.keys(this.structure).forEach(e=>this.structure[e].forEach(n=>{this.issuePillarLookup[n]=e,this.issueKeyPillarKeyLookup[n.toLowerCase()]=e.toLowerCase()})),this.pillarNames=Object.keys(this.structure),this.pillarKeys=Object.keys(this.structure).map(e=>e.toLowerCase())}getPillarNameForIssueName(e){return this.issuePillarLookup[e]}getPillarKeyByIssueKey(e){return this.issueKeyPillarKeyLookup[e]}getPillarNameByKey(e){return this.pillarNames.find(n=>n.toLowerCase()===e)}getPillarKeyByName(e){return this.pillarKeys.find(n=>e.toLowerCase()===n)}getIssuesForPillar(e){return this.structure[e]||[]}getIssuesNamesForPillarByKey(e){return this.structure[this.getPillarNameByKey(e)]||[]}getIssueKeysForPillarByKey(e){return this.getIssuesNamesForPillarByKey(e).map(n=>n.toLowerCase())}getIssueNameForIssueKey(e){return e.toLowerCase()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=P.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Ue=(()=>{class i{constructor(e,n,s){this.entitlementService=e,this.commodityDataService=n,this.pillarService=s,this.riskViewState={commodityTableShowAll:!1,issueTableShowAll:!1,countryTableShowAll:!1},this.allIssueOptions=this.pillarService.issueNames,this.allPillarOptions=this.pillarService.pillarNames,this.allTypeOptions=["hard","soft"],this.overallCommodityScores=new $t.m(1),this.overallPillarData=new $t.m(1),this.pillarsImplicitlySelectedByIssues=new $t.m(1),this.filteredData={mapData:new $t.m(1),pillarTable:new $t.m(1),indicatorData:new $t.m(1),overallIssueScores:new $t.m(1),overallIssueScoresAllIssues:new $t.m(1),overallCommodityScores:new $t.m(1)},this.allFilterOptions={commodity:this.getAllFilterOptionsCommodity(),country:this.getAllFilterOptionsCountry(),type:new Cn.t(this.allTypeOptions),pillar:new Cn.t(this.allPillarOptions),issue:new Cn.t(this.allIssueOptions)},this.filterSelectionsSubjects={commodity:new $t.m(1),country:new $t.m(1),type:new Cn.t(this.allTypeOptions.map(r=>r.toLowerCase())),pillar:new Cn.t(this.allPillarOptions.map(r=>r.toLowerCase())),issue:new Cn.t(this.allIssueOptions.map(r=>r.toLowerCase()))},this.filterSelections={commodity:this.filterSelectionsSubjects.commodity.pipe((0,dt.T)(r=>Array.from(new Set(r))),(0,Ti.F)((r,o)=>(0,Fi.n4)(r,o))),country:this.filterSelectionsSubjects.country,type:this.filterSelectionsSubjects.type.pipe((0,Ti.F)((r,o)=>(0,Fi.n4)(r,o))),pillar:this.filterSelectionsSubjects.pillar.pipe((0,Ti.F)((r,o)=>(0,Fi.n4)(r,o))),issue:this.filterSelectionsSubjects.issue.pipe((0,Ti.F)((r,o)=>(0,Fi.n4)(r,o)))},this.ignoreWeights=this.entitlementService.getEntitlement().pipe((0,Lt.
1s)(1),(0,dt.T)(r=>"boolean"==typeof r.ignoreWeights?r.ignoreWeights:"false"!==r.ignoreWeights),(0,de.t)(1)),this.allCommodities$.pipe((0,Lt.s)(1)).subscribe(r=>{this.filterSelectionsSubjects.commodity.next(r.map(o=>o.toLowerCase()))}),this.allCountries$.pipe((0,Lt.s)(1)).subscribe(r=>{this.filterSelectionsSubjects.country.next(r)}),(0,vt.z)([this.commodityDataService.getOverallCommodityScores(),this.ignoreWeights$]).subscribe(([r,o])=>{let l;l=r.map(o?c=>{const h=c.countries.filter(u=>!Ht.A(u.score)).map(u=>u.score),d=h.length?h.reduce((u,f)=>u+f,0)/h.length:void 0;return{...c,score:d,formattedScore:Ht.A(d)?"":d.toFixed(2)}}:c=>({...c,formattedScore:Ht.A(c.score)?"":c.score.toFixed(2)})),this.overallCommodityScores.next(l)}),this.commodityDataService.getRiskDriverTableData().pipe((0,Lt.s)(1)).subscribe(r=>this.overallPillarData.next(r)),this.setupFilteredMapData(),this.setupFilteredRiskDriverTableData(),this.setupFilteredIndicatorData(),this.setupFilteredOverallIssueScores(),this.setupFilteredOverallCommodityScores(),this.setupFilteredOverallIssueScoresAllIssues(),this.setupPillarsImplicitlySelectedByIssues()}get ignoreWeights$(){return this.ignoreWeights}get allIssues$(){return this.allFilterOptions.issue}get selectedIssues$(){return this.filterSelections.issue}get allPillars$(){return this.allFilterOptions.pillar}get selectedPillars$(){return this.filterSelections.pillar}get pillarsImplicitlySelectedByIssues$(){return this.pillarsImplicitlySelectedByIssues}get selectedCommodities$(){return this.filterSelections.commodity}get selectedCountries$(){return this.filterSelections.country}get overallcommodityScores$(){return this.overallCommodityScores}get overallIssueScoresAllIssues$(){return this.filteredData.overallIssueScoresAllIssues}get overallPillarData$(){return this.overallPillarData}get allCountries$(){return this.allFilterOptions.country}get allCommodities$(){return this.allFilterOptions.commodity}get dynamicFilterOptions$(){return(0,vt.z)([this.commodityDataService.getOverallCommodityScores(),(0,vt.z)([this.filterSelections.type,this.filterSelections.commodity,this.filterSelections.country,this.filterSelections.pillar,this.filterSelections.issue]),this.allFilterOptions$]).pipe((0,dt.T)(([e,[n,s,r,o,l],c])=>{const h={visibleCommodityOptions:c.commodity.map(d=>d.toLowerCase()),visibleCountryOptions:c.country,visibleIssueOptions:c.issue.map(d=>d.toLowerCase()),allCommodityOptions:c.commodity.map(d=>d.toLowerCase()),allCountryOptions:c.country,allIssueOptions:c.issue.map(d=>d.toLowerCase()),selectedCommodities:s,selectedCountries:r,selectedPillars:o,selectedIssues:l};if(2===n.length&&r.length===c.country.length&&s.length===c.commodity.length&&o.length===c.pillar.length)return h.reset=!0,h;if(1===n.length){const d=e.filter(u=>"hard"===u.type).map(u=>u.comm);h.visibleCommodityOptions="hard"===n[0]?d.map(u=>u.toLowerCase()):e.filter(u=>!d.includes(u.comm)).map(u=>u.comm.toLowerCase())}return s.length!==c.commodity.length&&(h.visibleCountryOptions=[],s.forEach(d=>{e.find(u=>u.comm.toLowerCase()===d)?.countries.forEach(u=>{h.visibleCountryOptions.includes(u.country)||h.visibleCountryOptions.push(u.country)})})),r.length!==c.country.length&&(h.visibleCommodityOptions=e.filter(d=>d.countries.some(u=>r.includes(u.country))&&h.visibleCommodityOptions.includes(d.comm.toLowerCase())).map(d=>d.comm.toLowerCase())),o.length!==c.pillar.length&&(h.visibleIssueOptions=h.visibleIssueOptions.filter(d=>{const u=this.pillarService.getPillarKeyByIssueKey(d);return!!u&&o.includes(u)})),h}))}get allFixedFilterOptions$(){return(0,vt.z)([this.allFilterOptions.issue,this.allFilterOptions.pillar,this.allFilterOptions.type]).pipe((0,dt.T)(([e,n,s])=>({issue:e,pillar:n,type:s})),(0,Lt.s)(1))}get allFilterOptions$(){return(0,vt.z)([this.allFilterOptions.commodity,this.allFilterOptions.country,this.allFilterOptions.issue,this.allFilterOptions.pillar,this.allFilterOptions.type]).pipe((0,dt.T)(([e,n,s,r,o])=>({commodity:e,country:n,issue:s,pillar:r,type:o})),(0,Lt.s)(1))}getIndicatorData(){return this.filteredData.indicatorData.asObservable()}getFilteredMapData(){return this.filteredData.mapData.asObservable()}getFilteredOverallCommodityScores(){return this.filteredData.overallCommodityScores.asObservable()}getFilteredRiskDriverTableData(){return this.filteredData.pillarTable.asObservable()}getFilteredOverallIssueScoresTableData(){return this.filteredData.overallIssueScores.asObservable()}updateFilter(e,n){this.filterSelectionsSubjects[e].next(n.map(s=>s.toLowerCase()))}updateCountryFilter(e){this.filterSelectionsSubjects.country.next(e)}
1removeFromCountryFilter(e){this.selectedCountries$.pipe((0,Lt.s)(1)).subscribe(n=>{const s=n.filter(r=>!e.includes(r));this.filterSelectionsSubjects.country.next(s)})}addToCountryFilter(e){this.selectedCountries$.pipe((0,Lt.s)(1)).subscribe(n=>{const s=hh.A(uh(n,e));this.filterSelectionsSubjects.country.next(s)})}resetCountryFilter(){this.allCountries$.pipe((0,Lt.s)(1)).subscribe(e=>{this.filterSelectionsSubjects.country.next(e)})}selectSingleForCountryFilter(e){this.allCountries$.pipe((0,Lt.s)(1)).subscribe(n=>{n.some(s=>s===e)&&this.filterSelectionsSubjects.country.next([e])})}resetFilters(){this.allCountries$.pipe((0,Lt.s)(1)).subscribe(e=>{this.filterSelectionsSubjects.country.next(e)}),this.allCommodities$.pipe((0,Lt.s)(1)).subscribe(e=>{this.filterSelectionsSubjects.commodity.next(e.map(n=>n.toLowerCase()))}),this.filterSelectionsSubjects.type.next(this.allTypeOptions.map(e=>e.toLowerCase())),this.filterSelectionsSubjects.pillar.next(this.allPillarOptions.map(e=>e.toLowerCase())),this.filterSelectionsSubjects.issue.next(this.allIssueOptions.map(e=>e.toLowerCase()))}isAllDataHidden(e,n,s,r,o){return 0===e.length||0===n.length||0===r.length||0===s.length||0===o.length}isAllDataVisible(e,n,s,r,o,l){const{country:c,commodity:h,issue:d,pillar:u,type:f}=l;return n.length===h.length&&s.length===c.length&&r.length===u.length&&e.length===f.length&&o.length===d.length}getAllFilterOptionsCommodity(){return this.commodityDataService.getOverallCommodityScores().pipe((0,dt.T)(e=>{const n=[];return e.forEach(s=>{n.includes(s.comm)||n.push(s.comm)}),n.sort()}),(0,de.t)(1))}getAllFilterOptionsCountry(){return this.commodityDataService.getOverallCommodityScores().pipe((0,dt.T)(e=>{const n=[];return e.forEach(s=>{s.countries.forEach(r=>{n.includes(r.country)||n.push(r.country)})}),n.sort((s,r)=>Ye[s]<Ye[r]?-1:1)}),(0,de.t)(1))}setupPillarsImplicitlySelectedByIssues(){this.filterSelections.issue.pipe((0,dt.T)(e=>{if(e.length===this.pillarService.issueKeys.length)return this.pillarService.pillarNames;const n=[];let s=0;for(;n.length<this.pillarService.pillarKeys.length&&s<e.length;){const r=this.pillarService.getPillarKeyByIssueKey(e[s]);r&&!n.includes(r)&&n.push(r),s++}return n.map(r=>this.pillarService.getPillarNameByKey(r))})).subscribe(e=>this.pillarsImplicitlySelectedByIssues.next(e))}setupFilteredIndicatorData(){(0,vt.z)([this.commodityDataService.getIndicatorData(),this.filterSelections.type,this.filterSelections.commodity,this.filterSelections.country,this.filterSelections.pillar,this.filterSelections.issue,this.allFilterOptions$]).pipe((0,dt.T)(([e,n,s,r,o,l,c])=>{if(this.isAllDataHidden(n,s,r,o,l))return[];if(this.isAllDataVisible(n,s,r,o,l,c))return e;let h=e;return 1===n.length&&(h=h.filter(d=>n.includes(d["Commodity Type"].toLowerCase()))),s.length!==c.commodity.length&&(h=h.filter(d=>s.includes(d.Commodity.toLowerCase()))),r.length!==c.country.length&&(h=h.filter(d=>r.includes(d["Country Code"]))),o.length!==c.pillar.length&&(h=h.filter(d=>o.includes(d.Pillar.toLowerCase()))),l.length!==c.issue.length&&(h=h.filter(d=>l.includes(d.Index.toLowerCase()))),h})).subscribe(e=>this.filteredData.indicatorData.next(e))}setupFilteredRiskDriverTableData(){(0,vt.z)([this.commodityDataService.getRiskDriverTableData(),this.filterSelections.type,this.filterSelections.commodity,this.filterSelections.country,this.filterSelections.pillar,this.filterSelections.issue,this.allFixedFilterOptions$]).pipe((0,dt.T)(([e,n,s,r,o,l,c])=>{let h=he.A(e);if(0===n.length)return[];if(1===n.length&&(h=h.filter(u=>n.includes(u.type.toLowerCase()))),h=h.filter(u=>s.includes(u.comm.toLowerCase())),h=h.filter(u=>r.includes(u.ctry)),c.issue.length!==l.length||c.pillar.length!==o.length){const u={};let f=[];o.forEach(g=>{const p=this.pillarService.getIssuesNamesForPillarByKey(g).filter(_=>l.includes(this.pillarService.getIssueNameForIssueKey(_)));p.length&&(u[g]=p,f=[...f,...p])}),h=h.map(g=>{const m={comm:g.comm,countryName:g.countryName,ctry:g.ctry,type:g.type,vol:g.vol};return f.forEach(p=>{m[p]=g[p]}),m}),h=h.map(g=>{let m=0,p=0;Object.keys(u).forEach(y=>{let b=0,E=0;
1if(u[y].forEach(C=>{const w=g[C];if(!Ht.A(w)){const v=parseFloat(w.toString());Number.isNaN(v)||(b+=v,E++,p+=v,m++)}}),E){const C=b/E;g[this.pillarService.getPillarNameByKey(y)]=Number.isNaN(C)?void 0:C.toFixed(2)}});const _=p/m;return g.scr=Number.isNaN(_)?void 0:_.toFixed(2),g})}return h})).subscribe(e=>this.filteredData.pillarTable.next(e))}setupFilteredMapData(){(0,vt.z)([this.commodityDataService.getRiskDriverTableData(),this.filteredData.pillarTable,this.filterSelections.country,this.allFilterOptions$]).pipe((0,dt.T)(([e,n,s,r])=>{const o={};if(0===n.length)return Object.keys(Ye).forEach(c=>{const h=r.country.some(d=>d===c);o[c]={score:void 0,selected:!1,entitled:h,dataAvailable:!1}}),o;const l=n.reduce((c,h)=>(c.includes(h.comm)||c.push(h.comm.toLowerCase()),c),[]);return Object.keys(Ye).forEach(c=>{const h=r.country.includes(c),d=e.some(g=>g.ctry===c&&l.includes(g.comm.toLowerCase())),u=s.includes(c),f=n.filter(g=>c===g.ctry);if(f.length){const g=f.filter(p=>!Ht.A(p.scr)&&!Number.isNaN(p.scr)),m=0===g.length?void 0:$o(g.map(p=>p.scr))/g.length;o[c]={score:m,selected:u,entitled:h,dataAvailable:d}}else o[c]={score:void 0,selected:u,entitled:h,dataAvailable:d}}),o})).subscribe(e=>this.filteredData.mapData.next(e))}setupFilteredOverallIssueScores(){this.filteredData.pillarTable.pipe((0,dt.T)(e=>this.getIssueScoresFromPillarData(e))).subscribe(e=>this.filteredData.overallIssueScores.next(e))}setupFilteredOverallIssueScoresAllIssues(){(0,vt.z)([this.commodityDataService.getRiskDriverTableData(),this.filterSelections.type,this.filterSelections.commodity,this.filterSelections.country]).pipe((0,dt.T)(([e,n,s,r])=>{let o=he.A(e);return 0===n.length?[]:(1===n.length&&(o=o.filter(l=>n.includes(l.type.toLowerCase()))),o=o.filter(l=>s.includes(l.comm.toLowerCase())),o=o.filter(l=>r.includes(l.ctry)),this.getIssueScoresFromPillarData(o))})).subscribe(e=>this.filteredData.overallIssueScoresAllIssues.next(e))}setupFilteredOverallCommodityScores(){(0,vt.z)([this.overallCommodityScores,this.filterSelections.type,this.filterSelections.commodity,this.filterSelections.country]).pipe((0,dt.T)(([e,n,s,r])=>{const o=[];return e.forEach(l=>{if(n.includes(l.type)&&s.includes(l.comm.toLowerCase())&&he.A(l).countries.filter(h=>r.includes(h.country)).length){const h=he.A(l);h.formattedScore=Ht.A(h.score)?"":h.score.toFixed(2),o.push(h)}}),o})).subscribe(e=>this.filteredData.overallCommodityScores.next(e))}getIssueScoresFromPillarData(e){const n=[];return e&&0!==e.length?(Object.keys(e[0]).filter(r=>this.pillarService.issueNames.includes(r)).forEach(r=>{const o=e.map(c=>parseFloat(c[r])).filter(c=>!Number.isNaN(c)),l=o.length?($o(o)/o.length).toFixed(2):"";n.push({issue:r,score:l})}),Ai.A(r=>parseFloat(r.score),n)):n}static{this.\u0275fac=function(n){return new(n||i)(P.KVO(_h),P.KVO(Oh),P.KVO(qo))}}static{this.\u0275prov=P.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();class He{constructor(t){("string"==typeof t||"number"==typeof t)&&(this.id=this.text=t,this.isDisabled=!1),"object"==typeof t&&(this.id=t.id,this.text=t.text,this.isDisabled=t.isDisabled)}}let Ds=(()=>{class i{transform(e,n){return e&&n?e.filter(s=>this.applyFilter(s,n)):e}applyFilter(e,n){return"string"==typeof e.text&&"string"==typeof n.text?!(n.text&&e.text&&-1===e.text.toLowerCase().indexOf(n.text.toLowerCase())):!(n.text&&e.text&&-1===e.text.toString().toLowerCase().indexOf(n.text.toString().toLowerCase()))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=a.EJ8({name:"multiSelectFilter",type:i,pure:!1,standalone:!1})}}return i})(),Rh=(()=>{class i{constructor(e){this.elementRef=e,this.clickOutside=new P.bkB}onClick(e,n){n&&(this.elementRef.nativeElement.contains(n)||this.clickOutside.emit(e))}static{this.\u0275fac=function(n){return new(n||i)(a.rXU(a.aKT))}}static{this.\u0275dir=a.FsC({type:i,selectors:[["","appClickOutside",""]],hostBindings:function(n,s){1&n&&a.bIt("click",function(o){return s.onClick(o,o.target)},a.EBC)},outputs:{clickOutside:"clickOutside"},standalone:!1})}}return i})();var Qo=R(5032);const Fh=i=>({"dropdown-multiselect--active":i});function Ah(i,t){if(1&i&&(a.j41(0,"span"),a.EFF(1),a.k0s(),a.nrm(2,"span",15)),2&i){const e=a.XpG();a.R7$(),a.JRh(e._placeholder)}}function Th(i,t){1&i&&(a.j41(0,"span"),a.EFF(1,"all selected"),a.k0s())}function kh(i,t){if(1&i){const e=a.RV6();a.j41(0,"span",16)(1,"span"),a.EFF(2),a.k0s(),a.j41(3,"a",17),a.bIt("click",function(s){const r=P.eBV(e).$implicit,o=a.XpG(2);return P.Njj(o.onItemClick(s,r))}),a.EFF(4,"x"),a.k0s()()}if(2&i){const e=t.$implicit,n=t.$index,s=a.XpG(2);a.Y8G("hidden",n>s._settings.itemsShowLimit-1),a.R7$(2),a.JRh(e.text)}}function Dh(i,t){if(1&i&&a.Z7z(0,kh,5,2,"span",16,a.BUC().trackByFn,!0),2&i){const e=a.XpG();a.Dyx(e.selectedItems)}}function Lh(i,t){if(1&i&&(a.j41(0,"span",3),a.EFF(1),a.k0s()),2&i){const e=a.XpG();a.R7$(),a.SpI("+",e.itemShowRemaining())}}function Nh(i,t){if(1&i){const e=a.RV6();a.j41(0,"li",18),a.bIt("click",function(){P.eBV(e);const s=a.XpG();return P.Njj(s.toggleSelectAll())}),a.nrm(1,"input",19),a.j41(2,"div"),a.EFF(3),a.k0s()()}if(2&i){const e=a.XpG();a.R7$(),a.Y8G("checked",e.isAllItemsSelected())("disabled",e.disabled||e.isLimitSelectionReached()),a.R7$(2),a.JRh(e.isAllItemsSelected()?e._settings.unSelectAllText:e._settings.selectAllText)}}function Gh(i,t){if(1&i){const e=a.RV6();a.j41(0,"li",8)(1,"input",20),a.mxI("ngModelChange",function(s){P.eBV(e);const r=a.XpG();return a.DH7(r.filter.text,s)||(r.filter.text=s),P.Njj(s)}),a.bIt("ngModelChange",function(s){P.eBV(e);const r=a.XpG();return P.Njj(r.onFilterTextChange(s))}),a.k0s(),a.qAN(),a.j41(2,"span",21),a.bIt("click",function(){P.eBV(e);const s=a.XpG();return P.Njj(s.clearSearch())}),P.qSk(),a.j41(3,"svg"),a.nrm(4,"use",22),a.k0s()()()}if(2&i){const e=a.XpG();a.R7$(),a.Y8G("readOnly",e.disabled)("placeholder",e._settings.searchPlaceholderText),a.R50("ngModel",e.filter.text),a.QXe(),a.R7$(),a.AVh("active",e.filter.text)}}function jh(i,t){if(1&i){const e=a.RV6();a.j41(0,"li",23),a.nI1(1,"slugify"),a.bIt("click",function(s){const r=P.eBV(e).$implicit,o=a.XpG();return P.Njj(o.onItemClick(s,r))}),a.nrm(2,"input",24),a.j41(3,"div"),a.EFF(4),a.k0s()()}if(2&i){const e=t.$implicit,n=a.XpG();a.BMQ("data-testid",a.bMT(1,5,"option-"+e.text)),a.R7$(2),a.Y8G("checked",n.isSelected(e))("disabled",n.disabled||n.isLimitSelectionReached()&&!n.isSelected(e)||e.isDisabled),a.BMQ("aria-label",e.text),a.R7$(2),a.JRh(e.text)}}function Bh(i,t){1&i&&(a.j41(0,"li")(1,"em"),a.EFF(2,"No items match search"),a.k0s()())}function Vh(i,t){if(1&i&&(a.j41(0,"li",11)(1,"h5"),a.EFF(2),a.k0s()()),2&i){const e=a.XpG();
1a.R7$(2),a.JRh(e._settings.noDataAvailablePlaceholderText)}}const Wh={provide:Y.kq,useExisting:(0,P.Rfq)(()=>ea),multi:!0},ta=()=>{};let ea=(()=>{class i{constructor(e){this.listFilterPipe=e,this.disabled=!1,this.filterName="",this.filterChange=new P.bkB,this.dropDownClose=new P.bkB,this.selection=new P.bkB,this.deSelect=new P.bkB,this.selectAll=new P.bkB,this.deSelectAll=new P.bkB,this._data=[],this.selectedItems=[],this.isDropdownOpen=!1,this._placeholder="Select",this.filter=new He(this.data),this.defaultSettings={singleSelection:!1,idField:"id",textField:"text",disabledField:"isDisabled",enableCheckAll:!0,selectAllText:"Select All",unSelectAllText:"UnSelect All",allowSearchFilter:!1,limitSelection:-1,clearSearchFilter:!0,maxHeight:197,itemsShowLimit:999999999999,searchPlaceholderText:"Search",noDataAvailablePlaceholderText:"No data available",closeDropDownOnSelection:!1,showSelectedItemsAtTop:!1,defaultOpen:!1,allowRemoteDataSearch:!1},this.onTouchedCallback=ta,this.onChangeCallback=ta,this._sourceDataType=null,this._sourceDataFields=[]}get allSelected(){return this.selectedItems.length===this._data.length}get noneSelected(){return 0===this.selectedItems.length}get partiallySelected(){return!this.allSelected&&this.selectedItems.length!==this._data.length}set placeholder(e){this._placeholder=e||"Select"}set settings(e){this._settings=e?Object.assign(this.defaultSettings,e):Object.assign(this.defaultSettings)}set data(e){if(e){const n=e[0];this._sourceDataType=typeof n,this._sourceDataFields=this.getFields(n),this._data=e.map(s=>new He("string"==typeof s||"number"==typeof s?s:{id:s[this._settings.idField],text:s[this._settings.textField],isDisabled:s[this._settings.disabledField]}))}else this._data=[]}onTouched(){this.onTouchedCallback()}onFilterTextChange(e){this.filterChange.emit(e)}onItemClick(e,n){if(this.disabled||n.isDisabled)return;const s=this.isSelected(n),r=-1===this._settings.limitSelection||this._settings.limitSelection>0&&this.selectedItems.length<this._settings.limitSelection;s?this.removeSelected(n):r&&this.addSelected(n),this._settings.singleSelection&&this._settings.closeDropDownOnSelection&&this.closeDropdown()}writeValue(e){if(null!=e&&e.length>0)if(this._settings.singleSelection)try{if(e.length>=1){const n=e[0];this.selectedItems=[new He("string"==typeof n||"number"==typeof n?n:{id:n[this._settings.idField],text:n[this._settings.textField],isDisabled:n[this._settings.disabledField]})]}}catch{}else{const n=e.map(s=>new He("string"==typeof s||"number"==typeof s?s:{id:s[this._settings.idField],text:s[this._settings.textField],isDisabled:s[this._settings.disabledField]}));this.selectedItems=this._settings.limitSelection>0?n.splice(0,this._settings.limitSelection):n}else this.selectedItems=[];this.onChangeCallback(e)}registerOnChange(e){this.onChangeCallback=e}registerOnTouched(e){this.onTouchedCallback=e}trackByFn(e,n){return n.id}isSelected(e){let n=!1;return this.selectedItems.forEach(s=>{e.id===s.id&&(n=!0)}),n}isLimitSelectionReached(){return this._settings.limitSelection===this.selectedItems.length}isAllItemsSelected(){const e=this.listFilterPipe.transform(this._data,this.filter),n=e.filter(s=>s.isDisabled).length;return!((!this.data||0===this.data.length)&&this._settings.allowRemoteDataSearch)&&e.length===this.selectedItems.length+n}itemShowRemaining(){return this.selectedItems.length-this._settings.itemsShowLimit}addSelected(e){this._settings.singleSelection?(this.selectedItems=[],this.selectedItems.push(e)):this.selectedItems.push(e),this.onChangeCallback(this.emittedValue(this.selectedItems)),this.selection.emit(this.emittedValue(e))}removeSelected(e){this.selectedItems.forEach(n=>{e.id===n.id&&this.selectedItems.splice(this.selectedItems.indexOf(n),1)}),this.onChangeCallback(this.emittedValue(this.selectedItems)),this.deSelect.emit(this.emittedValue(e))}emittedValue(e){const n=[];if(Array.isArray(e))e.map(s=>{n.push(this.objectify(s))});else if(e)return this.objectify(e);return n}objectify(e){if("object"===this._sourceDataType){const n={};return n[this._settings.idField]=e.id,n[this._settings.textField]=e.text,this._sourceDataFields.includes(this._settings.disabledField)&&(n[this._settings.disabledField]=e.isDisabled),n}return"number"===this._sourceDataType?Number(e.id):e.text}toggleDropdown(e){e.preventDefault(),(!this.disabled||!this._settings.singleSelection)&&(this._settings.defaultOpen=!this._settings.defaultOpen,this._settings.defaultOpen||this.dropDownClose.emit())}closeDropdown(){this._settings.defaultOpen=!1,this._settings.clearSearchFilter&&(this.filter.text=""),this.dropDownClose.emit()}clearSearch(){this.filter.text=""}outsideClick(){this._settings.defaultOpen&&this.closeDropdown()}toggleSelectAll(){this.disabled||(this.isAllItemsSelected()?(this.selectedItems=[],this.deSelectAll.emit(this.emittedValue(this.selectedItems))):(this.selectedItems=this.listFilterPipe.transform(this._data,this.filter).filter(e=>!e.isDisabled).slice(),this.selectAll.emit(this.emittedValue(this.selectedItems))),this.onChangeCallback(this.emittedValue(this.selectedItems)))}clearAll(){this.clearSearch(),this.isAllItemsSelected()||this.toggleSelectAll()}getFields(e){const n=[];if("object"!=typeof e)return n;for(const s in e)n.push(s);return n}static{this.\u0275fac=function(n){return new(n||i)(a.rXU(Ds))}}static{this.\u0275cmp=a.VBU({type:i,selectors:[["ng-multiselect-dropdown"]],hostBindings:function(n,s){1&n&&a.bIt("blur",function(){return s.onTouched()})},inputs:{disabled:"disabled",filterName:"filterName",placeholder:"placeholder",settings:"settings",data:"data"},outputs:{filterChange:"filterChange",dropDownClose:"dropDownClose",selection:"selection",deSelect:"deSelect",selectAll:"selectAll",deSelectAll:"deSelectAll"},standalone:!1,features:[a.Jv_([Wh])],decls:25,vars:25,consts:[["tabindex","0","appClickOutside","",1,"multiselect-dropdown",3,"blur","clickOutside"],["tabindex","-1",1,"dropdown-btn",3,"click"],[2,"float","right !important","padding-right","4px",3,"ngClass"],[2,"padding-right","15px"],[1,"dropdown-multiselect__caret"],[1,"dropdown-list",3,"hidden"],[1,"item1"],["data-testid","option-select-all",1,"multiselect-item-checkbox",2,"border-bottom","1px solid #ccc","padding","10px"],[1,"filter-textbox"],[1,"item2"],[1,"multiselect-item-checkbox"],[1,"n
1o-data"],[1,"button-container","text-right"],["data-testid","btn-clear",1,"btn","mc-btn-secondary","clear-button",3,"click"],["data-testid","btn-apply",1,"btn","mc-btn-primary","apply-button",3,"click"],[1,"exclamation"],[1,"selected-item",3,"hidden"],[2,"padding-left","2px","color","white",3,"click"],["data-testid","option-select-all",1,"multiselect-item-checkbox",2,"border-bottom","1px solid #ccc","padding","10px",3,"click"],["type","checkbox","aria-label","multiselect-select-all",3,"checked","disabled"],["type","text","aria-label","multiselect-search","data-testid","input-search-options",3,"ngModelChange","readOnly","placeholder","ngModel"],["data-testid","icon-clear-searchterm",1,"clear-search",3,"click"],[0,"xlink","href","#shape-close"],[1,"multiselect-item-checkbox",3,"click"],["type","checkbox",3,"checked","disabled"]],template:function(n,s){1&n&&(a.j41(0,"div",0),a.bIt("blur",function(){return s.onTouched()})("clickOutside",function(){return s.outsideClick()}),a.j41(1,"div")(2,"span",1),a.bIt("click",function(o){return s.toggleDropdown(o)}),a.nVh(3,Ah,3,1),a.nVh(4,Th,2,0,"span"),a.nVh(5,Dh,2,0),a.j41(6,"span",2),a.nVh(7,Lh,2,1,"span",3),a.nrm(8,"span",4),a.k0s()()(),a.j41(9,"div",5)(10,"ul",6),a.nVh(11,Nh,4,3,"li",7),a.nVh(12,Gh,5,5,"li",8),a.k0s(),a.j41(13,"ul",9),a.Z7z(14,jh,5,7,"li",10,a.fX1),a.nI1(16,"multiSelectFilter"),a.nVh(17,Bh,3,0,"li"),a.nI1(18,"multiSelectFilter"),a.nVh(19,Vh,3,1,"li",11),a.k0s(),a.j41(20,"div",12)(21,"button",13),a.bIt("click",function(){return s.clearAll()}),a.EFF(22,"Clear"),a.k0s(),a.j41(23,"button",14),a.bIt("click",function(){return s.closeDropdown()}),a.EFF(24,"Apply"),a.k0s()()()()),2&n&&(a.R7$(),a.AVh("disabled",s.disabled),a.R7$(),a.AVh("all-selected",s.allSelected),a.BMQ("data-testid","drpdwn-"+s.filterName),a.R7$(),a.vxM(s.noneSelected?3:-1),a.R7$(),a.vxM(s.allSelected?4:-1),a.R7$(),a.vxM(s.partiallySelected?5:-1),a.R7$(),a.Y8G("ngClass",a.eq3(23,Fh,s._settings.defaultOpen)),a.R7$(),a.vxM(s.partiallySelected&&s.itemShowRemaining()>0?7:-1),a.R7$(2),a.Y8G("hidden",!s._settings.defaultOpen),a.R7$(2),a.vxM((s._data.length>0||s._settings.allowRemoteDataSearch)&&!s._settings.singleSelection&&s._settings.enableCheckAll&&-1===s._settings.limitSelection?11:-1),a.R7$(),a.vxM((s._data.length>0||s._settings.allowRemoteDataSearch)&&s._settings.allowSearchFilter?12:-1),a.R7$(),a.xc7("max-height",s._settings.maxHeight+"px"),a.R7$(),a.Dyx(a.i5U(16,17,s._data,s.filter)),a.R7$(3),a.vxM(s.filter.text&&0===a.i5U(18,20,s._data,s.filter).length?17:-1),a.R7$(2),a.vxM(0!==s._data.length||s._settings.allowRemoteDataSearch?-1:19))},dependencies:[wt.YU,Y.me,Y.BC,Y.vS,Rh,Qo.U,Ds],styles:[".button-container[_ngcontent-%COMP%]{display:flex}.button-container[_ngcontent-%COMP%]{border-top:.1rem solid #ccc}.multiselect-dropdown[_ngcontent-%COMP%]{position:relative;width:100%;font-size:inherit;font-family:inherit}.multiselect-dropdown[_ngcontent-%COMP%]   .all-selected[_ngcontent-%COMP%]{background-color:#fff!important}.multiselect-dropdown[_ngcontent-%COMP%]   .clear-button[_ngcontent-%COMP%], .multiselect-dropdown[_ngcontent-%COMP%]   .apply-button[_ngcontent-%COMP%]{width:4rem;height:2.4rem;font-size:1rem;padding:0}.multiselect-dropdown[_ngcontent-%COMP%]   .clear-button[_ngcontent-%COMP%]{margin-left:auto}.multiselect-dropdown[_ngcontent-%COMP%]   .dropdown-btn[_ngcontent-%COMP%]{background-color:#caecff;overflow:hidden;height:27px;display:flex!important;border:1px solid #adadad;width:100%;padding:3px 6px!important;margin-bottom:0;font-weight:400;line-height:1.5286;text-align:left;vertical-align:middle;cursor:pointer;background-image:none;border-radius:4px}.multiselect-dropdown[_ngcontent-%COMP%]   .dropdown-btn[_ngcontent-%COMP%]   .selected-item[_ngcontent-%COMP%]{border:none!important;margin-right:unset!important;background:unset!important;padding:unset!important;color:unset!important;border-radius:2px;float:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.multiselect-dropdown[_ngcontent-%COMP%]   .dropdown-btn[_ngcontent-%COMP%]   .selected-item[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{display:none!important}.multiselect-dropdown[_ngcontent-%COMP%]   .dropdown-btn[_ngcontent-%COMP%]   .selected-item[_ngcontent-%COMP%]:hover{box-shadow:unset!important}.multiselect-dropdown[_ngcontent-%COMP%]   .dropdown-btn[_ngcontent-%COMP%]   .dropdown-down[_ngcontent-%COMP%]{display:inline-block;top:10;width:0;height:0;border-top:10 solid #adadad;border-left:10 solid transparent;border-right:10 solid transparent}.multiselect-dropdown[_ngcontent-%COMP%]   .dropdown-btn[_ngcontent-%COMP%]   .dropdown-up[_ngcontent-%COMP%]{display:inline-block;width:0;height:0;border-bottom:10 solid #adadad;border-left:10 solid transparent;border-right:10 solid transparent}.multiselect-dropdown[_ngcontent-%COMP%]   .dropdown-btn[_ngcontent-%COMP%]   .exclamation[_ngcontent-%COMP%]{background-image:url(\"data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-prefix='fas' data-icon='exclamation' class='svg-inline--fa fa-exclamation fa-w-6' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 192 512'%3E%3Cpath fill='%2300a9e0' d='M176 432c0 44.112-35.888 80-80 80s-80-35.888-80-80 35.888-80 80-80 80 35.888 80 80zM25.26 25.199l13.6 272C39.499 309.972 50.041 320 62.83 320h66.34c12.789 0 23.331-10.028 23.97-22.801l13.6-272C167.425 11.49 156.496 0 142.77 0H49.23C35.504 0 24.575 11.49 25.26 25.199z'%3E%3C/path%3E%3C/svg%3E\");background-repeat:no-repeat;width:14px;
1height:14px;display:inline-block;margin-left:25px;margin-top:2px}.multiselect-dropdown[_ngcontent-%COMP%]   .disabled[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{background-color:#eceeef}.dropdown-list[_ngcontent-%COMP%]{position:absolute;padding-top:6px;width:100%;z-index:9999;border:1px solid #ccc;border-radius:3px;background:#fff;margin-top:10;box-shadow:0 1px 5px #959595}.dropdown-list[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]{padding:0;list-style:none;overflow:auto;margin:0}.dropdown-list[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{padding:5px 7px!important;cursor:pointer;text-align:left}.dropdown-list[_ngcontent-%COMP%]   .filter-textbox[_ngcontent-%COMP%]{border-bottom:1px solid #ccc;position:relative;padding:5px!important}.dropdown-list[_ngcontent-%COMP%]   .filter-textbox[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{border:0;width:calc(100% - 12px);padding:0 0 0 26px}.dropdown-list[_ngcontent-%COMP%]   .filter-textbox[_ngcontent-%COMP%]   .clear-search[_ngcontent-%COMP%]{visibility:hidden}.dropdown-list[_ngcontent-%COMP%]   .filter-textbox[_ngcontent-%COMP%]   .clear-search.active[_ngcontent-%COMP%]{visibility:visible}.dropdown-list[_ngcontent-%COMP%]   .filter-textbox[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus{outline:none}.dropdown-list[_ngcontent-%COMP%]   .filter-textbox[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{height:10px;width:10px}.multiselect-item-checkbox[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]{border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.multiselect-item-checkbox[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:focus + div[_ngcontent-%COMP%]:before, .multiselect-item-checkbox[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:hover + div[_ngcontent-%COMP%]:before{border-color:#2671cb!important;background-color:#f2f2f2}.multiselect-item-checkbox[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:active + div[_ngcontent-%COMP%]:before{transition-duration:0s}.multiselect-item-checkbox[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%] + div[_ngcontent-%COMP%]{position:relative;padding-left:2em;vertical-align:middle;-webkit-user-select:none;user-select:none;cursor:pointer;margin:0;color:#000}.multiselect-item-checkbox[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%] + div[_ngcontent-%COMP%]:before{box-sizing:content-box;content:\"\";color:#2671cb!important;position:absolute;top:50%;left:0;width:11px!important;height:11px!important;margin-top:-9px;border:2px solid #2671cb!important;text-align:center;transition:all .4s ease}.multiselect-item-checkbox[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%] + div[_ngcontent-%COMP%]:after{box-sizing:content-box;content:\"\";position:absolute;top:50%;left:4px;width:6px!important;height:3px!important;margin-top:-5px!important;transform-origin:50%;transition:transform .2s ease-out;border-style:solid;border-color:#fff;border-width:0 0 2px 2px!important;border-image:none;transform:rotate(-45deg) scale(0)}.multiselect-item-checkbox[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:disabled + div[_ngcontent-%COMP%]:before{border-color:#ccc}.multiselect-item-checkbox[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:disabled:checked + div[_ngcontent-%COMP%]:before{background-color:#ccc}.multiselect-item-checkbox[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + div[_ngcontent-%COMP%]:after{content:\"\";transform:rotate(-45deg) scale(1);transition:unset!important}.multiselect-item-checkbox[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + div[_ngcontent-%COMP%]:before{animation:unset!important;background:#2671cb!important}@keyframes _ngcontent-%COMP%_borderscale{50%{box-shadow:0 0 0 2px #002d61}}.dropdown-multiselect__caret[_ngcontent-%COMP%]{display:block;position:absolute;box-sizing:border-box;width:11px;background-position:center;height:30px;line-height:16px;background-image:url(\"data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-prefix='fas' data-icon='chevron-down' class='svg-inline--fa fa-chevron-down fa-w-14' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='currentColor' d='M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z'%3E%3C/path%3E%3C/svg%3E\");background-repeat:no-repeat;right:5px;top:0;padding:0;transition:transform .2s ease}.dropdown-multiselect__caret[_ngcontent-%COMP%]:before{border:none!important;position:relative;right:0;top:65%;color:#999;border-style:solid;border-width:8px 8px 0;border-color:#999 transparent;content:\"\"}.dropdown-multiselect--active[_ngcontent-%COMP%]   .dropdown-multiselect__caret[_ngcontent-%COMP%]{transform:rotate(180deg)}.selected-item[_ngcontent-%COMP%]:nth-of-type(2):before{content:\", \"}.dropdown-btn[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:last-of-type{padding-left:2px;margin-right:10;width:22px}.button-container[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{margin:2px}"]})}}return i})();function zh(i,t){if(1&i){const e=a.RV6();a.j41(0,"ng-multiselect-dropdown",3),a.mxI("ngModelChange",function(s){P.eBV(e);const r=a.XpG();return a.DH7(r.countrySelections,s)||(r.countrySelections=s),P.Njj(s)}),a.bIt("dropDownClose",function(){P.eBV(e);const s=a.XpG();return P.Njj(s.selectionChanged("country"))})("selectAll",function(){P.eBV(e);const s=a.XpG();return P.Njj(s.selectAll("country"))})("deSelectAll",function(){P.eBV(e);const s=a.XpG();return P.Njj(s.deselectAll("country"))}),a.k0s(),a.qAN()}if(2&i){const e=a.XpG();a.AVh("ng-msd-no-options",0===e.countryOptions.length),a.Y8G("placeholder","none selected")("settings",e.dropdownSettings)("data",e.countryOptions),a.R50("ngModel",e.countrySelections),a.Y8G("filterName","country"),a.QXe()}}let Kh=(()=>{class i{constructor(){this.filterChange=new P.bkB,this.typeOptions=[{item_id:"hard",item_text:"hard"},{item_id:"soft",item_text:"soft"}],this.typeSelections=[...this.typeOptions],this.commodityOptions=[],this.commoditySelections=[],this.countrySelections=[],this.pillarOptions=[],this.pillarSelections=[],this.issueOptions=[],this.issueSelections=[],this.dropdownSettings={singleSelection:!1,idField:"item_id",textField:"item_text",selectAllText:"Select All",unSelectAllText:"Select All",itemsShowLimit:2,allowSearchFilter:!0,maxHeight:275},this.basicDropdownSettings={singleSelection:!1,idField:"item_id",textField:"item_text",enableCheckAll:!1,allowSearchFilter:!1,maxHeight:275}}set dynamicFilterOptions(e){e&&(e.visibleCommodityOptions&&this.allCommodityOptions&&(this.commodityOptions=this.allCommodityOptions.filter(n=>e.visibleCommodityOptions.includes(n.item_id)),this.commoditySelections=e.reset?[...this.commodityOptions]:[...this.commodityOptions.filter(n=>e.visibleCommodityOptions.includes(n.item_id)&&e.selectedCommodities.includes(n.item_id))]),e.visibleCountryOptions&&this.allCountryOptions&&(this.countryOptions=this.allCountryOptions.filter(n=>e.visibleCountryOptions.includes(n.item_id)),this.countrySelections=e.reset?[...this.countryOptions]:[...this.countryOptions.filter(n=>e.visibleCountryOptions.includes(n.item_id)&&e.selectedCountries.includes(n.item_id))]),e.visibleIssueOptions&&this.allIssueOptions&&(this.issueOptions=this.allIssueOptions.filter(n=>e.visibleIssueOptions.includes(n.item_id)),this.issueSelections=e.reset?[...this.issueOptions]:[...this.issueOptions.filter(n=>e.visibleIssueOptions.includes(n.item_id)&&e.selectedIssues.includes(n.item_id))]))}set allCountries(e){e&&e.length&&(this.countryOptions=e.map(n=>({item_id:n,item_text:Ye[n]})),this.countrySelections=[...this.countryOptions],this.allCountryOptions=[...this.countryOptions])}set selectedIssues(e){e&&(this.issueSelections=e.map(n=>this.issueOptions.find(s=>s.item_text.toLowerCase()===n.toLowerCase())).filter(n=>void 0!==n))}set allCommodities(e){e&&e.length&&(this.commodityOptions=e.map(n=>({item_id:n.toLowerCase(),item_text:n})),this.commoditySelections=[...this.commodityOptions],this.allCommodityOptions=[...this.commodityOptions])}set fixedFilterOptions(e){e&&e.issue.length&&(this.issueOptions=e.issue.map(n=>({item_id:n.toLowerCase(),item_text:n})),this.allIssueOptions=[...this.issueOptions],this.issueSelections=[...this.issueOptions],this.pillarOptions=e.pillar.map(n=>({item_id:n.toLowerCase(),item_text:n})),this.pillarSelections=[...this.pillarOptions],this.typeOptions=e.type.map(n=>({item_id:n.toLowerCase(),item_text:n})),this.typeSelections=[...this.typeOptions])}resetAll(){this.countrySelections=[...this.countryOptions],this.commoditySelections=[...this.commodityOptions],this.issueSelections=[...this.issueOptions],this.pillarSelections=[...this.pillarOptions],this.typeSelections=[...this.typeOptions],this.filterChange.emit(new ch)}selectAll(e){switch(e){case"commodity":this.commodityOptions.length&&(this.commoditySelections=[...this.commodityOptions]);break;case"country":this.countryOptions?.length&&(this.countrySelections=[...this.countryOptions]);break;case"issue":this.issueOptions.length&&(this.issueSelections=[...this.issueOptions]);break;case"pillar":this.pillarOptions.length&&(this.pillarOptions=[...this.pillarOptions]);break;
1case"type":this.typeSelections.length&&(this.typeSelections=[...this.typeOptions])}}deselectAll(e){switch(e){case"commodity":this.commoditySelections=[];break;case"country":this.countrySelections=[];break;case"issue":this.issueSelections=[];break;case"pillar":this.pillarSelections=[];break;case"type":this.typeSelections=[]}}selectionChanged(e){switch(e){case"commodity":this.commodityOptions.length&&this.commoditySelections.length&&this.filterChange.emit(new rh(this.commoditySelections.map(n=>n.item_text)));break;case"country":this.countryOptions?.length&&this.countrySelections.length&&this.filterChange.emit(new oh(this.countrySelections.map(n=>n.item_id)));break;case"issue":this.issueOptions.length&&this.issueSelections.length&&this.filterChange.emit(new lh(this.issueSelections.map(n=>n.item_text)));break;case"pillar":this.pillarOptions.length&&this.pillarSelections.length&&this.filterChange.emit(new ah(this.pillarSelections.map(n=>n.item_text)));break;case"type":this.typeSelections.length&&this.filterChange.emit(new sh(this.typeSelections.map(n=>n.item_text)))}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=a.VBU({type:i,selectors:[["grid-ui-commodity-data-filter"]],inputs:{dynamicFilterOptions:"dynamicFilterOptions",allCountries:"allCountries",selectedIssues:"selectedIssues",allCommodities:"allCommodities",fixedFilterOptions:"fixedFilterOptions"},outputs:{filterChange:"filterChange"},standalone:!1,decls:24,vars:23,consts:[[1,"filters-container"],[1,"dropdown-container"],[3,"ngModelChange","dropDownClose","placeholder","settings","data","ngModel","filterName"],[3,"ngModelChange","dropDownClose","selectAll","deSelectAll","placeholder","settings","data","ngModel","filterName"],[3,"placeholder","settings","data","ngModel","ng-msd-no-options","filterName"],["data-testid","btn-reset-all",1,"btn","mc-btn-primary","reset-all-button",3,"click"]],template:function(n,s){1&n&&(a.j41(0,"div",0)(1,"div",1)(2,"div")(3,"label"),a.EFF(4,"Commodity Type"),a.k0s(),a.j41(5,"ng-multiselect-dropdown",2),a.mxI("ngModelChange",function(o){return a.DH7(s.typeSelections,o)||(s.typeSelections=o),o}),a.bIt("dropDownClose",function(){return s.selectionChanged("type")}),a.k0s(),a.qAN(),a.k0s(),a.j41(6,"div")(7,"label"),a.EFF(8,"Commodity"),a.k0s(),a.j41(9,"ng-multiselect-dropdown",3),a.mxI("ngModelChange",function(o){return a.DH7(s.commoditySelections,o)||(s.commoditySelections=o),o}),a.bIt("dropDownClose",function(){return s.selectionChanged("commodity")})("selectAll",function(){return s.selectAll("commodity")})("deSelectAll",function(){return s.deselectAll("commodity")}),a.k0s(),a.qAN(),a.k0s(),a.j41(10,"div")(11,"label"),a.EFF(12,"Country"),a.k0s(),a.nVh(13,zh,1,7,"ng-multiselect-dropdown",4),a.k0s(),a.j41(14,"div")(15,"label"),a.EFF(16,"Risk Pillars"),a.k0s(),a.j41(17,"ng-multiselect-dropdown",3),a.mxI("ngModelChange",function(o){return a.DH7(s.pillarSelections,o)||(s.pillarSelections=o),o}),a.bIt("dropDownClose",function(){return s.selectionChanged("pillar")})("selectAll",function(){return s.selectAll("pillar")})("deSelectAll",function(){return s.deselectAll("pillar")}),a.k0s(),a.qAN(),a.k0s(),a.j41(18,"div")(19,"label"),a.EFF(20,"Risk Issues"),a.k0s(),a.j41(21,"ng-multiselect-dropdown",3),a.mxI("ngModelChange",function(o){return a.DH7(s.issueSelections,o)||(s.issueSelections=o),o}),a.bIt("dropDownClose",function(){return s.selectionChanged("issue")})("selectAll",function(){return s.selectAll("issue")})("deSelectAll",function(){return s.deselectAll("issue")}),a.k0s(),a.qAN(),a.k0s(),a.j41(22,"button",5),a.bIt("click",function(){return s.resetAll()}),a.EFF(23,"Reset All"),a.k0s()()()),2&n&&(a.R7$(5),a.Y8G("placeholder","none selected")("settings",s.basicDropdownSettings)("data",s.typeOptions),a.R50("ngModel",s.typeSelections),a.Y8G("filterName","commodity-type"),a.QXe(),a.R7$(4),a.AVh("ng-msd-no-options",0===s.commodityOptions.length),a.Y8G("placeholder","none selected")("settings",s.dropdownSettings)("data",s.commodityOptions),a.R50("ngModel",s.commoditySelections),a.Y8G("filterName","commodity"),a.QXe(),a.R7$(4),a.vxM(s.countryOptions?13:-1),a.R7$(4),a.Y8G("placeholder","none selected")("settings",s.dropdownSettings)("data",s.pillarOptions),a.R50("ngModel",s.pillarSelections),a.Y8G("filterName","risk-pillars"),a.QXe(),a.R7$(4),a.Y8G("placeholder","none selected")("settings",s.dropdownSettings)("data",s.issueOptions),a.R50("ngModel",s.issueSelections),a.Y8G("filterName","risk-issues"),a.QXe())},dependencies:[Y.BC,Y.vS,ea],styles:[".no-size[_ngcontent-%COMP%]{height:0;width:0;padding:0;border:0}.flex-grow-page[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto}.caption[_ngcontent-%COMP%]{font-weight:300;font-size:1rem;font-style:italic}h5[_ngcontent-%COMP%]{line-height:1.6rem}h4[_ngcontent-%COMP%]{line-height:1.9rem}h3[_ngcontent-%COMP%]{line-height:2.1rem}h2[_ngcontent-%COMP%]{line-height:2.4rem}h1[_ngcontent-%COMP%], h6[_ngcontent-%COMP%]{line-height:2.8rem}html[_ngcontent-%COMP%], body[_ngcontent-%COMP%]{font-weight:400;font-family:Roboto,sans-serif;color:#262626;line-height:2.2rem}h1[_ngcontent-%COMP%], h2[_ngcontent-%COMP%], h3[_ngcontent-%COMP%], h4[_ng
1content-%COMP%], h5[_ngcontent-%COMP%], h6[_ngcontent-%COMP%], p[_ngcontent-%COMP%], li[_ngcontent-%COMP%]{font-family:Roboto,sans-serif;margin:0}h1[_ngcontent-%COMP%], h2[_ngcontent-%COMP%], h3[_ngcontent-%COMP%], h4[_ngcontent-%COMP%], h5[_ngcontent-%COMP%], h6[_ngcontent-%COMP%]{font-weight:500;color:#002d61}h2.h-sup[_ngcontent-%COMP%], h3.h-sup[_ngcontent-%COMP%], h4.h-sup[_ngcontent-%COMP%], h5.h-sup[_ngcontent-%COMP%]{font-weight:400;color:#262626}h5.h-sup.bold[_ngcontent-%COMP%]{font-weight:700}h1.light[_ngcontent-%COMP%], h2.light[_ngcontent-%COMP%], h3.light[_ngcontent-%COMP%]{color:#979797}b[_ngcontent-%COMP%], strong[_ngcontent-%COMP%]{font-weight:700}h1[_ngcontent-%COMP%]{font-size:2.4rem;margin:0}h1.display[_ngcontent-%COMP%]{font-size:5.5rem;line-height:6.399rem}h2[_ngcontent-%COMP%]{font-size:2rem;margin:0}h3[_ngcontent-%COMP%]{font-size:1.8rem;margin:0}h4[_ngcontent-%COMP%]{font-size:1.6rem}h5[_ngcontent-%COMP%]{font-size:1.4rem;margin:0}h6[_ngcontent-%COMP%]{font-size:1.2rem;margin:0}p[_ngcontent-%COMP%]{font-size:1.4rem;line-height:2.2rem;font-weight:400;margin:0 0 2.8rem;color:#262626}p.large[_ngcontent-%COMP%]{font-size:1.6rem;line-height:2.8rem;font-weight:300;margin:2rem 0}p.small[_ngcontent-%COMP%]{font-size:1.2rem}p.x-small[_ngcontent-%COMP%]{font-size:1.1rem}.date[_ngcontent-%COMP%]{margin-top:20px;color:#54585a}p.small[_ngcontent-%COMP%], span.small[_ngcontent-%COMP%]{font-size:1.2rem;line-height:1.7rem}p.light[_ngcontent-%COMP%]{color:#979797}.summary[_ngcontent-%COMP%]{text-transform:uppercase;font-size:1.2rem;font-weight:700}a[_ngcontent-%COMP%]{color:#2671cb;text-decoration:underline;cursor:pointer}a[_ngcontent-%COMP%]:hover{color:#2671cb;text-decoration:none;filter:brightness(90%)}a.not-text-link[_ngcontent-%COMP%]{color:unset;text-decoration:unset}a.not-text-link[_ngcontent-%COMP%]:hover{color:unset;text-decoration:unset;filter:unset}a[_ngcontent-%COMP%]:not([href],[class]){color:#2671cb;text-decoration:underline}a[_ngcontent-%COMP%]:not([href],[class]):hover{color:#2671cb;text-decoration:none;filter:brightness(90%)}a.disabled-link[_ngcontent-%COMP%]{color:#d8d8d8;pointer-events:none;text-decoration:none}p[_ngcontent-%COMP%] + h3[_ngcontent-%COMP%], p[_ngcontent-%COMP%] + h4[_ngcontent-%COMP%], p[_ngcontent-%COMP%] + h5[_ngcontent-%COMP%]{margin-top:2.8rem}h1[_ngcontent-%COMP%] + h2[_ngcontent-%COMP%], h2[_ngcontent-%COMP%] + h2[_ngcontent-%COMP%], h2[_ngcontent-%COMP%] + h3[_ngcontent-%COMP%], h3[_ngcontent-%COMP%] + h4[_ngcontent-%COMP%], h4[_ngcontent-%COMP%] + h5[_ngcontent-%COMP%], h5[_ngcontent-%COMP%] + h6[_ngcontent-%COMP%]{margin-top:.5rem}h1[_ngcontent-%COMP%] + p[_ngcontent-%COMP%], h2[_ngcontent-%COMP%] + p[_ngcontent-%COMP%], h3[_ngcontent-%COMP%] + p[_ngcontent-%COMP%], h4[_ngcontent-%COMP%] + p[_ngcontent-%COMP%], h5[_ngcontent-%COMP%] + p[_ngcontent-%COMP%], h6[_ngcontent-%COMP%] + p[_ngcontent-%COMP%]{margin-top:.8rem}h3[_ngcontent-%COMP%] + p.small[_ngcontent-%COMP%], h4[_ngcontent-%COMP%] + p.small[_ngcontent-%COMP%], h5[_ngcontent-%COMP%] + p.small[_ngcontent-%COMP%]{margin-top:.8rem}.item-paragraph[_ngcontent-%COMP%]   ol[_ngcontent-%COMP%], .item-paragraph[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]{padding-left:15px}.item-paragraph[_ngcontent-%COMP%]   ol[_ngcontent-%COMP%]   li[_ngcontent-%COMP%], .item-paragraph[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{padding-bottom:.5rem}.tooltip[_ngcontent-%COMP%]{font-family:Roboto,sans-serif;font-weight:400;font-size:1.2rem;z-index:2001}.tooltip[_ngcontent-%COMP%]   .tooltip-inner[_ngcontent-%COMP%]{background-color:#002d61;color:#fff}.bs-tooltip-right[_ngcontent-%COMP%]   .arrow[_ngcontent-%COMP%]:before{border-right-color:#002d61}.bs-tooltip-left[_ngcontent-%COMP%]   .arrow[_ngcontent-%COMP%]:before{border-left-color:#002d61}.bs-tooltip-top[_ngcontent-%COMP%]   .arrow[_ngcontent-%COMP%]:before{border-top-color:#002d61}.bs-tooltip-bottom[_ngcontent-%COMP%]   .arrow[_ngcontent-%COMP%]:before{border-bottom-color:#002d61}.lh-16[_ngcontent-%COMP%]{line-height:1.6rem}.lh-19[_ngcontent-%COMP%]{line-height:1.9rem}.lh-21[_ngcontent-%COMP%]{line-height:2.1rem}.lh-22[_ngcontent-%COMP%]{line-height:2.2rem}.lh-24[_ngcontent-%COMP%]{line-height:2.4rem}.lh-26[_ngcontent-%COMP%]{line-height:2.6rem}.lh-28[_ngcontent-%COMP%]{line-height:2.8rem}.lh-30[_ngcontent-%COMP%]{line-height:3rem}.lh-34[_ngcontent-%COMP%]{line-height:3.4rem}.lh-46[_ngcontent-%COMP%]{line-height:4.6rem}@keyframes _ngcontent-%COMP%_rotate{to{transform:rotate(1turn)}}.btn[_ngcontent-%COMP%], .btn.btn-icon-square[_ngcontent-%COMP%]{height:3.6rem}.btn.btn-icon-square[_ngcontent-%COMP%]{width:3.6rem;min-width:3.6rem}.btn[_ngcontent-%COMP%]{white-space:nowrap;font-size:1.2rem;padding-left:1.6rem;padding-right:1.6rem;border-width:.1rem}.btn[_ngcontent-%COMP%]:hover{text-decoration:underline}.btn[_ngcontent-%COMP%]:not(:disabled):hover{text-decoration:underline}.btn.btn-compact[_ngcontent-%COMP%]{padding:.8rem}.btn.btn-icon-round[_ngcontent-%COMP%]{padding:.2rem;height:2.4rem;border-radius:5rem}.btn.btn-icon-square[_ngcontent-%COMP%]{padding:0}.btn[_ngcontent-%COMP%]:not(:disabled,.disabled):active, .btn[_ngcontent-%COMP%]:not(:disabled,.disabled).active{box-shadow:none}.mc-btn-danger[_ngcontent-%COMP%]{--%NS%bs-btn-color: #d40019;--%NS%bs-btn-bg: #d40019;--%NS%bs-btn-border-color: #d40019;--%NS%bs-btn-hover-color: #d40019;--%NS%bs-btn-hover-bg: #d40019;--%NS%bs-btn-hover-border-color: #d40019;--%NS%bs-btn-focus-shadow-rgb: 212, 0, 25;--%NS%bs-btn-active-color: #fff;--%NS%bs-btn-active-bg: rgb(220.6, 51, 71);--%NS%bs-btn-active-border-color: rgb(216.3, 25.5, 48);--%NS%bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);--%NS%bs-btn-disabled-color: #fff;--%NS%bs-btn-disabled-bg: #d40019;--%NS%bs-btn-disabled-border-color: #d40019;background-color:#d40019;border-radius:.4rem;font-weight:500;font-size:1.4rem;color:#fff}.mc-btn-danger[_ngcontent-%COMP%]:hover, .mc-btn-danger[_ngcontent-%COMP%]:focus{color:#fff}.mc-btn-danger.disabled[_ngcontent-%COMP%], .mc-btn-danger[_ngcontent-%COMP%]:disabled{color:#ccc;background-color:#f2f2f2;border-color:#f2f2f2;pointer-events:none}.mc-btn-danger.disabled[_ngcontent-%COMP%]:focus, .mc-btn-danger[_ngcontent-%COMP%]:disabled:focus{box-shadow:none;color:#ccc;background-color:#f2f2f2;border-color:#f2f2f2}.mc-btn-danger.disabled[_ngcontent-%COMP%]:hover, .mc-btn-danger[_ngcontent-%COMP%]:disabled:hover{filter:unset;text-decoration:none}.mc-btn-primary[_ngcontent-%COMP%], .mc-toggle.active[_ngcontent-%COMP%]{--%NS%bs-btn-color: #fff;--%NS%bs-btn-bg: #2671cb;--%NS%bs-btn-border-color: #2671cb;--%NS%bs-btn-hover-color: #fff;--%NS%bs-btn-hover-bg: #2671cb;--%NS%bs-btn-hover-border-color: #2671cb;--%NS%bs-btn-focus-shadow-rgb: 71, 134, 211;--%NS%bs-btn-active-color: #fff;--%NS%bs-btn-active-bg: rgb(30.4, 90.4, 162.4);--%NS%bs-btn-active-border-color: rgb(28.5, 84.75, 152.25);--%NS%bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);--%NS%bs-btn-disabled-color: #fff;--%NS%bs-btn-disabled-bg: #2671cb;--%NS%bs-btn-disabled-border-color: #2671cb;color:#fff;background-color:#2671cb;box-shadow:none;border-style:solid;border-radius:.4rem;font-weight:500;font-size:1.4rem}.mc-btn-primary[_ngcontent-%COMP%]:not(.error,.disabled,:disabled):hover, .mc-toggle.active[_ngcontent-%COMP%]:not(.error,.disabled,:disabled):hover, .mc-btn-primary[_ngcontent-%COMP%]:not(.error,.disabled,:disabled):focus, .mc-toggle.active[_ngcontent-%COMP%]:not(.error,.disabled,:disabled):focus{color:#fff;filter:brightness(90%);background-color:#2671cb;box-shadow:0 0 0 .1rem #2671cb}.mc-btn-primary.error[_ngcontent-%COMP%]:not(:disabled,.disabled):active, .error.mc-toggle.active[_ngcontent-%COMP%]:not(:disabled,.disabled):active{background-color:#d40019;box-shadow:0 0 0 .1rem #d40019;border:.2rem solid #d40019!important}.mc-btn-primary.disabled[_ngcontent-%COMP%], .disabled.mc-toggle.active[_ngcontent-%COMP%], .mc-btn-primary[_ngcontent-%COMP%]:disabled, .mc-toggle.active[_ngcontent-%COMP%]:disabled{color:#ccc;background-color:#f2f2f2;border-color:#f2f2f2;pointer-events:none}.mc-btn-primary.disabled[_ngcontent-%COMP%]:focus, .disabled.mc-toggle.active[_ngcontent-%COMP%]:focus, .mc-btn-primary[_ngcontent-%COMP%]:disabled:focus, .mc-toggle.active[_ngcontent-%COMP%]:disabled:focus{box-shadow:none;color:#ccc;background-color:#f2f2f2;border-color:#f2f2f2}.mc-btn-primary.disabled[_ngcontent-%COMP%]:hover, .disabled.mc-toggle.active[_ngcontent-%COMP%]:hover, .mc-btn-primary[_ngcontent-%COMP%]:disabled:hover, .mc-toggle.active[_ngcontent-%COMP%]:disabled:hover{filter:unset}.mc-btn-primary[_ngcontent-%COMP%]:not(:disabled,.disabled):active, .mc-btn-primary[_ngcontent-%COMP%]:not(:disabled,.disabled).active, .mc-toggle[_ngcontent-%COMP%]:not(:disabled,.disabled).active, .show[_ngcontent-%COMP%] > .mc-btn-primary.dropdown-toggle[_ngcontent-%COMP%], .show[_ngcontent-%COMP%] > .dropdown-toggle.mc-toggle.active[_ngcontent-%COMP%]{color:#fff}.mc-btn-secondary[_ngcontent-%COMP%], .mc-toggle[_ngcontent-%COMP%]:not(.active){--%NS%bs-btn-color: #fff;--%NS%bs-btn-bg: #fff;--%NS%bs-btn-border-color: #ccc;--%NS%bs-btn-hover-color: #00358e;--%NS%bs-btn-hover-bg: #ccc;--%NS%bs-btn-hover-border-color: #fff;--%NS%bs-btn-focus-shadow-rgb: 212, 212, 212;--%NS%bs-btn-active-color: #000;--%NS%bs-btn-active-bg: #cccccc;--%NS%bs-btn-active-border-color: #999999;--%NS%bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);--%NS%bs-btn-disabled-color: #000;--%NS%bs-btn-disabled-bg: #fff;--%NS%bs-btn-disabled-border-color: #ccc;box-shadow:none;background-color:#fff;border-color:#ccc;border-style:solid;border-radius:.4rem;font-weight:500;font-size:1.4rem;color:#2671cb}.mc-btn-secondary[_ngcontent-%COMP%]:hover, .mc-toggle[_ngcontent-%COMP%]:hover:not(.active){color:#2671cb;text-decoration:underline;border-color:#2671cb}.mc-btn-secondary[_ngcontent-%COMP%]:focus, .mc-toggle[_ngcontent-%COMP%]:focus:not(.active){box-shadow:none;color:#2671cb;background-color:#fff;border-color:#ccc}.mc-btn-secondary[_ngcontent-%COMP%]:not(:disabled):hover, .mc-toggle[_ngcontent-%COMP%]:not(:disabled):hover:not(.active){color:#2671cb;text-decoration:underline;border-color:#2671cb;background-color:#fff}.mc-btn-secondary[_ngcontent-%COMP%]:not(:disabled,.disabled):active, .mc-toggle[_ngcontent-%COMP%]:not(:disabled,.disabled):active:not(.active), .mc-btn-secondary[_ngcontent-%COMP%]:not(:disabled,.disabled).active, .mc-toggle[_ngcontent-%COMP%]:not(:disabled,.disabled).active:not(.active), .show[_ngcontent-%COMP%] > .mc-btn-secondary.dropdown-toggle[_ngcontent-%COMP%], .show[_ngcontent-%COMP%] > .dropdown-toggle.mc-toggle[_ngcontent-%COMP%]:not(.active){color:#2671cb}.mc-btn-secondary[_ngcontent-%COMP%]:not(:disabled,.disabled):active:focus, .mc-toggle[_ngcontent-%COMP%]:not(:disabled,.disabled):active:focus:not(.active), .mc-btn-secondary[_ngcontent-%COMP%]:not(:disabled,.disabled).active:focus, .mc-toggle[_ngcontent-%COMP%]:not(:disabled,.disabled).active:focus:not(.active), .show[_ngcontent-%COMP%] > .mc-btn-secondary.dropdown-toggle[_ngcontent-%COMP%]:focus, .show[_ngcontent-%COMP%] > .dropdown-toggle.mc-toggle[_ngcontent-%COMP%]:focus:not(.active){box-shadow:none}.btn-outline-maplecroft-secondary[_ngcontent-%COMP%]{--%NS%bs-btn-color: #f1f1f1;--%NS%bs-btn-bg: #fff;--%NS%bs-btn-border-color: #ccc;--%NS%bs-btn-hover-color: #ccc;--%NS%bs-btn-hover-bg: #ccc;--%NS%bs-btn-hover-border-color: #fff;--%NS%bs-btn-focus-shadow-rgb: 210, 210, 210;--%NS%bs-btn-active-color: #000;--%NS%bs-btn-active-bg: white;--%NS%bs-btn-active-border-color: rgb(209.1, 209.1, 209.1);
1--%NS%bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);--%NS%bs-btn-disabled-color: #000;--%NS%bs-btn-disabled-bg: #fff;--%NS%bs-btn-disabled-border-color: #ccc;color:#999;box-shadow:none;border-style:solid;border-radius:4px}.btn-outline-maplecroft-secondary[_ngcontent-%COMP%]:hover{color:#999}.btn-outline-maplecroft-secondary.disabled[_ngcontent-%COMP%], .btn-outline-maplecroft-secondary[_ngcontent-%COMP%]:disabled{color:#ddd;background-color:#fafafa;border-color:#ddd}.btn-outline-maplecroft-secondary[_ngcontent-%COMP%]:not(:disabled,.disabled):active, .btn-outline-maplecroft-secondary[_ngcontent-%COMP%]:not(:disabled,.disabled).active, .show[_ngcontent-%COMP%] > .btn-outline-maplecroft-secondary.dropdown-toggle[_ngcontent-%COMP%]{color:#999}.btn-maplecroft-dropdown[_ngcontent-%COMP%]{padding:.8rem;display:inline-block;text-transform:uppercase;background:#00a9e0;border:1px solid #00a9e0;border-radius:2px;color:#fff;font-size:12px;transition:background .1s ease-in}.btn-link.btn-anchor[_ngcontent-%COMP%]{padding:0;border:0;vertical-align:baseline;color:#e8f0f9}.btn-link.btn-anchor[_ngcontent-%COMP%]:focus, .btn-link.btn-anchor[_ngcontent-%COMP%]:active{box-shadow:none!important}.tag[_ngcontent-%COMP%]{font-size:12px;display:inline-block;background-color:#f3f3f1;border:1px solid #dddddc;border-radius:2px;margin:0 5px 5px 0;padding:0;transition:all .2s ease-out;max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:auto!important;float:left}.tag[_ngcontent-%COMP%]:hover{background-color:#00a9e0;border:1px solid #00a9e0}.tag[_ngcontent-%COMP%]:hover   a[_ngcontent-%COMP%]{color:#fff}.modify-serach[_ngcontent-%COMP%]{color:#000;display:block;padding:5px 10px;text-overflow:ellipsis;overflow:hidden}.modify-search[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{width:100%;text-overflow:ellipsis;overflow:hidden}.tag.selected[_ngcontent-%COMP%]:hover{background-color:#f3f3f1;border:1px solid #dddddc}.tag.selected[_ngcontent-%COMP%]:hover   a[_ngcontent-%COMP%]{color:#000}.tag.lead-tag[_ngcontent-%COMP%]{border-color:#22b8ef;background:#7dcbe8;background:linear-gradient(to bottom,#7dcbe8,#22b8ef)}.tag.lead-tag[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{color:#fff}.tabs[_ngcontent-%COMP%]{display:table;position:relative;padding:0;border-bottom:0;margin:0 0 0 1px;width:100%}.tabs[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{float:left;background:#f3f3f3;border:1px solid #ccc;text-transform:uppercase;font-size:12px;text-align:center;margin:0 0 0 -1px;display:inline-block;width:50%}.tabs[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]:first-child{right:-1px}.tabs[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{height:100%;width:100%;border-radius:0;border:0;float:left;color:#999;white-space:nowrap;padding:8px 10px;margin:0}.tabs[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{background-color:#eee}.tabs[_ngcontent-%COMP%]   li.active[_ngcontent-%COMP%]{border-bottom:0;background:#fff;color:#000}.tabs[_ngcontent-%COMP%]   li.active[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{color:#000}.tabs[_ngcontent-%COMP%]   li.active[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{background-color:#fff}.mc-toggle[_ngcontent-%COMP%]:not(.active){border-color:#ccc}.mc-toggle[_ngcontent-%COMP%]:not(.active):hover{border-color:#2671cb}.mc-toggle.toggle-compact[_ngcontent-%COMP%]{padding:.8rem;height:2.4rem;line-height:.8rem;font-size:1.2rem}.btn-group-toggle[_ngcontent-%COMP%] > .btn[_ngcontent-%COMP%]{margin-bottom:0}.btn-group-toggle[_ngcontent-%COMP%] > .btn[_ngcontent-%COMP%]   input[type=radio][_ngcontent-%COMP%]{position:absolute;clip-path:inset(50%);pointer-events:none}.filters-container[_ngcontent-%COMP%]{color:#fff;display:flex;align-items:center;background-color:#002d61;padding:10px 5px}.filters-container[_ngcontent-%COMP%]   .reset-all-button[_ngcontent-%COMP%]{height:2.4rem;font-size:1rem;margin:auto 0 0 auto}.filters-container[_ngcontent-%COMP%]   .dropdown-container[_ngcontent-%COMP%]{display:flex;width:100%}.filters-container[_ngcontent-%COMP%]   .dropdown-container[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:flex;align-items:center;max-height:55px}.filters-container[_ngcontent-%COMP%]   .dropdown-container[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{padding:0 5px;margin-bottom:0;color:#fff}.filters-container[_ngcontent-%COMP%]   .dropdown-container[_ngcontent-%COMP%]   ng-multiselect-dropdown[_ngcontent-%COMP%]{width:180px;color:#333;margin-right:10px}@media only screen and (width<=1300px){.filters-container[_ngcontent-%COMP%]{align-items:flex-end}.filters-container[_ngcontent-%COMP%]   .dropdown-container[_ngcontent-%COMP%]{flex-wrap:wrap}.filters-container[_ngcontent-%COMP%]   .dropdown-container[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:flex;flex-direction:column}.filters-container[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{margin-right:2px}}@media only screen and (width<=660px){.filters-container[_ngcontent-%COMP%]   .dropdown-container[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:150px;margin-left:5px}.filters-container[_ngcontent-%COMP%]   .dropdown-container[_ngcontent-%COMP%]   ng-multiselect-dropdown[_ngcontent-%COMP%]{width:150px}.filters-container[_ngcontent-%COMP%]   .dropdown-container[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{display:block}}@media only screen and (-ms-high-contrast:none)and (width<=1020px),only screen and (-ms-high-contrast:active)and (width<=1020px){.filters-container[_ngcontent-%COMP%]{min-height:110px}}"],changeDetection:1})}}return i})();function Xh(i,t){1&i&&a.nrm(0,"app-loading")}function Yh(i,t){if(1&i&&(a.j41(0,"a",0),a.nI1(1,"slugify"),a.EFF(2),a.k0s()),2&i){const e=t.$implicit;a.Y8G("routerLink",a.mNQ(e.link)),a.BMQ("data-testid",a.bMT(1,4,"tab-"+e.name)),a.R7$(2),a.JRh(e.name)}}function Uh(i,t){if(1&i){const e=a.RV6();a.j41(0,"nav"),a.Z7z(1,Yh,3,6,"a",0,a.fX1),a.k0s(),a.j41(3,"grid-ui-commodity-data-filter",1),a.nI1(4,"async"),a.nI1(5,"async"),a.nI1(6,"async"),a.nI1(7,"async"),a.nI1(8,"async"),a.bIt("filterChange",function(s){P.eBV(e);const r=a.XpG();return P.Njj(r.onFilterChange(s))}),a.k0s(),a.nrm(9,"router-outlet"),a.j41(10,"div",2),a.EFF(11," Extreme: "),a.j41(12,"span",3),a.EFF(13,"0.00-2.50"),a.k0s(),a.EFF(14," High: "),a.j41(15,"span",4),a.EFF(16,"2.50-5.00"),a.k0s(),a.EFF(17," Medium: "),a.j41(18,"span",5),a.EFF(19,"5.00-7.50"),a.k0s(),a.EFF(20," Low: "),a.j41(21,"span",6),a.EFF(22,"7.50-10.00"),a.k0s()()}if(2&i){const e=a.XpG();a.R7$(),a.Dyx(e.navItems),a.R7$(2),a.Y8G("allCountries",a.bMT(4,5,e.allCountries$))("allCommodities",a.bMT(5,7,e.allCommodities$))("dynamicFilterOptions",a.bMT(6,9,e.dynamicFilterOptions$))("fixedFilterOptions",a.bMT(7,11,e.allFixedFilterValues$))("selectedIssues",a.bMT(8,13,e.selectedIssues$))}}let Hh=(()=>{class i{constructor(e,n){this.router=e,this.appStateService=n,this.navItems=[{name:"RISK ANALYSIS",link:"risk-analysis"},{name:"RISK DRIVERS",link:"risk-drivers"},{name:"EVIDENCE",link:"indicator"},{name:"MAP",link:"map"},{name:"ABOUT",link:"about"}],this.filtersLoaded=!1,this.allCountries$=this.appStateService.allCountries$.pipe((0,ih.M)(()=>{setTimeout(()=>{this.filtersLoaded=!0},0)})),this.allCommodities$=this.appStateService.allCommodities$,this.allFixedFilterValues$=this.appStateService.allFixedFilterOptions$,this.selectedCountries$=this.appStateService.selectedCountries$,this.selectedCommodities$=this.appStateService.selectedCommodities$,this.selectedIssues$=this.appStateService.selectedIssues$,this.dynamicFilterOptions$=this.appStateService.dynamicFilterOptions$}onFilterChange(e){switch(e.type){case Dt.TYPE_CHANGE:this.appStateService.updateFilter("type",e.payload);break;case Dt.COMMODITY_CHANGE:this.appStateService.updateFilter("commodity",e.payload);break;case Dt.COUNTRY_CHANGE:this.appStateService.updateCountryFilter(e.payload);break;case Dt.PILLAR_CHANGE:this.appStateService.updateFilter("pillar",e.payload);break;case Dt.ISSUE_CHANGE:this.appStateService.updateFilter("issue",e.payload);break;case Dt.RESET_ALL:this.appStateService.resetFilters()}}static{this.\u0275fac=function(n){return new(n||i)(a.rXU(Ko.Ix),a.rXU(Ue))}}static{this.\u0275cmp=a.VBU({type:i,selectors:[["commodity-risk"]],hostAttrs:[1,"commodity","layout-grow"],standalone:!1,decls:3,vars:4,consts:[["routerLinkActive","selected",3,"routerLink"],[3,"filterChange","allCountries","allCommodities","dynamicFilterOptions","fixedFilterOptions","selectedIssues"],[1,"legend"],[1,"score-label","extreme"],[1,"score-label","high"],[1,"score-label","medium"],[1,"score-label","low"]],template:function(n,s){if(1&n&&(a.nVh(0,Xh,1,0,"app-loading"),a.nVh(1,Uh,23,15),a.nI1(2,"async")),2&n){let r;a.vxM(s.filtersLoaded?-1:0),a.R7$(),a.vxM((r=a.bMT(2,2,s.selectedCountries$))?1:-1,r)}},dependencies:[Ko.n3,Ft.Wk,Ft.wQ,Kh,wt.Jj,Qo.U],styles:["nav[_ngcontent-%COMP%]{font-family:Roboto,sans-serif;display:flex;justify-content:center;flex:0 0 4rem;height:4rem}nav[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{font-size:1.2rem;line-height:1.4rem;font-weight:700;color:#002d61;padding-left:1.6rem;padding-right:1.6rem;text-decoration:none;cursor:pointer;border-bottom:.4rem solid transparent;border-top:.4rem solid transparent;display:flex;align-items:center}nav[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{color:#2671cb}nav[_ngcontent-%COMP%]   a.selected[_ngcontent-%COMP%]{border-bottom-color:#2671cb;color:#2671cb}nav[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:first-child{margin-left:0}"],changeDetection:1})}}return i})();var Vn=R(39768),Wn=R(19257),yt=R(72176),H=R(69834),$h=R(92575);function X(i){const t=i.value;return Ht.A(t)||$h.A(t)?["score-cell-default","score-cell-no-score"]:t<=2.5?["score-cell-default","score-cell-extreme"]:t<=5?["
1score-cell-default","score-cell-high"]:t<=7.5?["score-cell-default","score-cell-medium"]:t<=10?["score-cell-default","score-cell-low"]:["score-cell-default","score-cell-no-score"]}function na(i){return X(i).map(t=>"export-"+t)}function Zh(i,t){1&i&&a.nrm(0,"app-loading")}let ia=(()=>{class i{constructor(){this.hostClass=!0,this.commoditySelectionChanged=new P.bkB,this.modules=[yt.JKr,yt.Q90,H.AkP,yt.n76,H.Oee,H.rcg],this.columnDefs=[{headerName:"Commodity",field:"comm",flex:3},{headerName:"Score",field:"formattedScore",width:2,minWidth:75,cellClass:X}],this.defaultColDef={sortable:!0,filter:!1,resizable:!0,suppressHeaderMenuButton:!0,suppressMovable:!0},this.gridOptions={defaultColDef:this.defaultColDef,columnDefs:this.columnDefs,headerHeight:20,rowHeight:20,rowSelection:{mode:"multiRow",checkboxes:!1,headerCheckbox:!1,enableClickSelection:!0},onCellClicked:this.cellClicked.bind(this),onRowDataUpdated:()=>this.updateRowSelections(this._selectedCommodities),suppressCsvExport:!0,getContextMenuItems:()=>[{name:"Excel Export",action:()=>{this.gridApi?.exportDataAsExcel({skipRowGroups:!0,appendContent:Vn.DISCLAIMER_NARROW_EXCEL,fileName:"Overall Commodity Risk",sheetName:"data"})}}],excelStyles:Wn.E},this._showAll=!0}get showAll(){return this._showAll}set showAll(e){this._showAll=e}set selectedCommodities(e){this._selectedCommodities=e,this.gridApi?this.updateRowSelections(e):this.savedSelectedCommodities=e}onSelectionChanged(e){const n=e.api.getSelectedRows();this.previousSelection=n,0===n.length?e.api.selectAll():["api","apiSelectAll","rowDataUpdated","rowDataChanged"].includes(e.source)||this.commoditySelectionChanged.emit(n.map(s=>s.comm))}onGridReady(e){if(this.gridApi=e.api,this.savedSelectedCommodities){const n=this.savedSelectedCommodities;this.savedSelectedCommodities=void 0,this.updateRowSelections(n)}}updateRowSelections(e){if(!this.gridApi||!e)return;this.previousSelection=[];const n=[],s=[];this.gridApi.forEachNode(r=>{e.includes(r.data.comm.toLowerCase())?(n.push(r),this.previousSelection?.push(r.data)):s.push(r)}),this.gridApi.setNodesSelected({nodes:n,newValue:!0}),this.gridApi.setNodesSelected({nodes:s,newValue:!1})}cellClicked(e){const n=e.event;if((n.metaKey||n.ctrlKey)&&(!this.previousSelection&&this._showAll||this.previousSelection?.length===this.allData?.length))return this.gridApi?.forEachNode(r=>{r.setSelected(r===e.node,!1)}),void(this.previousSelection=[e.node.data]);!this.previousSelection||1!==this.previousSelection.length||e.data.comm===this.previousSelection[0].comm&&e.api.selectAll()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=a.VBU({type:i,selectors:[["grid-ui-commodity-score-table"]],hostVars:2,hostBindings:function(n,s){2&n&&a.AVh("commodity-score-table",s.hostClass)},inputs:{allData:"allData",filteredData:"filteredData",showAll:"showAll",selectedCommodities:"selectedCommodities"},outputs:{commoditySelectionChanged:"commoditySelectionChanged"},standalone:!1,decls:3,vars:4,consts:[[1,"table-container"],[1,"ag-theme-custom-angular","row-selection-basic",3,"selectionChanged","gridReady","rowData","gridOptions","modules"]],template:function(n,s){1&n&&(a.nVh(0,Zh,1,0,"app-loading"),a.j41(1,"div",0)(2,"ag-grid-angular",1),a.bIt("selectionChanged",function(o){return s.onSelectionChanged(o)})("gridReady",function(o){return s.onGridReady(o)}),a.k0s()()),2&n&&(a.vxM(s.allData?-1:0),a.R7$(2),a.Y8G("rowData",s.showAll?s.allData:s.filteredData)("gridOptions",s.gridOptions)("modules",s.modules))},dependencies:[Rt.xs],styles:[".table-container[_ngcontent-%COMP%]{height:100%}
1ag-grid-angular[_ngcontent-%COMP%]{width:225px;height:100%}"],changeDetection:1})}}return i})();function $e(i){const t=parseFloat(i.value).toFixed(2);return"NaN"===t?"":t}let sa=(()=>{class i{agInit(e){this.value=$e(e),this.classes=X(e);const n=parseFloat(e.value);this.width=Number.isNaN(n)?0:`calc(${10*n}% - 26px)`}refresh(){return!1}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=a.VBU({type:i,selectors:[["grid-ui-commodity-score-bar-renderer"]],standalone:!1,decls:3,vars:7,consts:[[1,"score-label"]],template:function(n,s){1&n&&(a.j41(0,"div",0),a.EFF(1),a.k0s(),a.nrm(2,"div")),2&n&&(a.HbH(s.classes),a.R7$(),a.JRh(s.value),a.R7$(),a.HbH(s.classes),a.xc7("width",s.width))},styles:["[_nghost-%COMP%]{height:100%;display:flex;align-items:center;padding:.3rem 0}div.score-cell-default[_ngcontent-%COMP%]{height:30px}div.score-cell-default.score-cell-no-score[_ngcontent-%COMP%]{background-color:unset}.score-label[_ngcontent-%COMP%]{text-align:left;display:flex;align-items:center;width:36px;padding-left:.2rem;height:30px}"],changeDetection:1})}}return i})();var Jh=R(28592);function qh(i,t){if(1&i){const e=a.RV6();a.j41(0,"div",0)(1,"ag-grid-angular",2),a.nI1(2,"async"),a.bIt("gridReady",function(s){P.eBV(e);const r=a.XpG();return P.Njj(r.onGridReady(s))}),a.k0s()()}if(2&i){const e=a.XpG();a.R7$(),a.Y8G("rowData",a.bMT(2,3,e.tableData$))("gridOptions",e.gridOptions)("modules",e.modules)}}function Qh(i,t){1&i&&(a.j41(0,"div",1),a.nrm(1,"grid-ui-loading"),a.k0s())}let ra=(()=>{class i{constructor(){this.hostClass=!0,this.modules=[yt.Q90,yt.JKr,H.mZZ,H.eKf,H.yHM,H.vl5,H.l1$,H.AkP,yt.n76,H.Oee,H.rcg],this.columnDefs=[{field:"Commodity",colId:"commodity",rowGroup:!0,hide:!0},{headerName:"Country",field:"CountryName",colId:"country",rowGroup:!0,hide:!0},{headerName:"Risk Issue",field:"Index",colId:"issue",rowGroup:!0,hide:!0},{headerName:"Risk Issue Score",field:"Index Score",colId:"issueScore",width:50,sortable:!1,valueFormatter:$e,cellClass:X},{headerName:"Risk Driver",field:"Indicator",flex:1,maxWidth:250,sortable:!1},{headerName:"Risk Driver Evidence",field:"Indicator Evidence",flex:4,sortable:!1},{headerName:"Risk Driver Source",field:"Indicator Source",flex:2,tooltipField:"Indicator Source",autoHeight:!1,sortable:!1},{headerName:"Risk Driver Score",field:"Indicator Score",flex:2,minWidth:175,maxWidth:500,sortable:!1,cellClass:na,cellRenderer:"scoreBarRendererComponent"}],this.components={scoreBarRendererComponent:sa},this.defaultColDef={minWidth:60,filter:!1,resizable:!0,wrapText:!0,suppressHeaderMenuButton:!0,suppressMovable:!0,autoHeight:!0},this.autoGroupColumnDef={cellRendererParams:{suppressCount:!0},sortable:!0,pinned:"left",filterValueGetter:e=>{const n=e.colDef.colId;if(n&&e.node)return e.getValue(n)}},this.gridOptions={autoGroupColumnDef:this.autoGroupColumnDef,columnDefs:this.columnDefs,defaultColDef:this.defaultColDef,components:this.components,groupDefaultExpanded:4,groupHideOpenParents:!0,groupDisplayType:"multipleColumns",headerHeight:32,rowHeight:40,suppressCsvExport:!0,getContextMenuItems:()=>[{name:"Excel Export",action:()=>{this.gridApi?.exportDataAsExcel({appendContent:Vn.DISCLAIMER_NARROW_EXCEL,fileName:"Evidence",sheetName:"data"})}}],excelStyles:Wn.E},this.appStateService=(0,P.WQX)(Ue)}ngOnInit(){this.tableData$??=this.appStateService.getIndicatorData()}onGridReady(e){this.gridApi=e.api,e.api.setColumnWidths([{key:"ag-Grid-AutoColumn-commodity",newWidth:105},{key:"ag-Grid-AutoColumn-country",newWidth:85},{key:"ag-Grid-AutoColumn-issue",newWidth:95},{key:"ag-Grid-AutoColumn-issueScore",newWidth:75}])}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=a.VBU({type:i,selectors:[["grid-ui-commodity-indicator-table"]],hostVars:2,hostBindings:function(n,s){2&n&&a.AVh("commodity-indicator-table",s.hostClass)},inputs:{tableData$:"tableData$"},standalone:!1,decls:3,vars:3,consts:[[1,"table-container"],[1,"loading-container"],[1,"ag-theme-custom-angular",3,"gridReady","rowData","gridOptions","modules"]],template:function(n,s){1&n&&(a.nVh(0,qh,3,5,"div",0),a.nI1(1,"async"),a.vZN(2,Qh,2,0,"div",1)),2&n&&a.vxM(a.bMT(1,1,s.tableData$)?0:2)},dependencies:[Rt.xs,Jh.q,wt.Jj],styles:[".loading-container[_ngcontent-%COMP%]{display:flex}.loading-container[_ngcontent-%COMP%]{align-items:center}.loading-container[_ngcontent-%COMP%]{justify-content:center}.loading-container[_ngcontent-%COMP%]{flex-direction:row}.loading-container[_ngcontent-%COMP%]{height:100%}.loading-container[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%]{height:100%}.table-container[_ngcontent-%COMP%]{height:100%;overflow-y:hidden}
1ag-grid-angular[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:1})}}return i})();var ue=function(i){return i.SINGLE_COUNTRY="[Map Selection Action] Single Country Selected",i.COUNTRIES_ADDED="[Map Selection Action] Countries Added",i.COUNTRIES_REMOVED="[Map Selection Action] Countries Removed",i.RESET="[Map Selection Action] Reset to full country list",i}(ue||{});class td{constructor(t){this.payload=t,this.type=ue.COUNTRIES_ADDED}}class ed{constructor(t){this.payload=t,this.type=ue.COUNTRIES_REMOVED}}class oa{constructor(t){this.payload=t,this.type=ue.SINGLE_COUNTRY}}class Ls{constructor(){this.type=ue.RESET}}let aa=(()=>{class i{constructor(e){this.appStateService=e}mapSelections(e){switch(e.type){case ue.COUNTRIES_ADDED:this.appStateService.addToCountryFilter(e.payload);break;case ue.COUNTRIES_REMOVED:this.appStateService.removeFromCountryFilter(e.payload);break;case ue.SINGLE_COUNTRY:this.appStateService.selectSingleForCountryFilter(e.payload);break;case ue.RESET:this.appStateService.resetCountryFilter()}}static{this.\u0275fac=function(n){return new(n||i)(P.KVO(Ue))}}static{this.\u0275prov=P.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function zn(i){for(const t in i)delete i[t]}function Ze(i){let t;for(t in i)return!1;return!t}function K(i,t,e,n,s){if(s){const o=e;e=function(l){return i.removeEventListener(t,e),o.call(n??this,l)}}else n&&n!==i&&(e=e.bind(n));const r={target:i,type:t,listener:e};return i.addEventListener(t,e),r}function la(i,t,e,n){return K(i,t,e,n,!0)}function et(i){i&&i.target&&(i.target.removeEventListener(i.type,i.listener),zn(i))}const Ns=class nd{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function Ie(i,t){return i>t?1:i<t?-1:0}function sd(i,t){return i<t?1:i>t?-1:0}function ca(i,t,e){if(i[0]<=t)return 0;const n=i.length;if(t<=i[n-1])return n-1;if("function"==typeof e){for(let s=1;s<n;++s){const r=i[s];if(r===t)return s;if(r<t)return e(t,i[s-1],r)>0?s-1:s}return n-1}if(e>0){for(let s=1;s<n;++s)if(i[s]<t)return s-1;return n-1}if(e<0){for(let s=1;s<n;++s)if(i[s]<=t)return s;return n-1}for(let s=1;s<n;++s){if(i[s]==t)return s;if(i[s]<t)return i[s-1]-t<t-i[s]?s-1:s}return n-1}function rd(i,t,e){for(;t<e;){const n=i[t];i[t]=i[e],i[e]=n,++t,--e}}function ee(i,t){const e=Array.isArray(t)?t:[t],n=e.length;for(let s=0;s<n;s++)i[i.length]=e[s]}function Oe(i,t){const e=i.length;if(e!==t.length)return!1;for(let n=0;n<e;n++)if(i[n]!==t[n])return!1;return!0}function Kn(){return!0}function ki(){return!1}function Xn(){}function ha(i){let t,e,n;return function(){const s=Array.prototype.slice.call(arguments);return(!e||this!==n||!Oe(s,e))&&(n=this,e=s,t=i.apply(this,arguments)),t}}const Pe=class od{constructor(t){this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},Di=class ad extends Ns{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const n=this.listeners_||(this.listeners_={}),s=n[t]||(n[t]=[]);s.includes(e)||s.push(e)}dispatchEvent(t){const e="string"==typeof t,n=e?t:t.type,s=this.listeners_&&this.listeners_[n];if(!s)return;const r=e?new Pe(t):t;r.target||(r.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),l=this.pendingRemovals_||(this.pendingRemovals_={});let c;n in o||(o[n]=0,l[n]=0),++o[n];for(let h=0,d=s.length;h<d;++h)if(c="handleEvent"in s[h]?s[h].handleEvent(r):s[h].call(this,r),!1===c||r.propagationStopped){c=!1;break}if(0===--o[n]){let h=l[n];for(delete l[n];h--;)this.removeEventListener(n,Xn);delete o[n]}return c}disposeInternal(){this.listeners_&&zn(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)}removeEventListener(t,e){if(!this.listeners_)return;const n=this.listeners_[t];if(!n)return;const s=n.indexOf(e);-1!==s&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[s]=Xn,++this.pendingRemovals_[t]):(n.splice(s,1),0===n.length&&delete this.listeners_[t]))}};const ua=class Li extends Di{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent("change")}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const n=t.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=K(this,t[r],e);return s}return K(this,t,e)}onceInternal(t,e){let n;if(Array.isArray(t)){const s=t.length;n=new Array(s);for(let r=0;r<s;++r)n[r]=la(this,t[r],e)}else n=la(this,t,e);return e.ol_key=n,n}unInternal(t,e){const n=e.ol_key;if(n)!function ld(i){if(Array.isArray(i))for(let t=0,e=i.length;t<e;++t)et(i[t]);else et(i)}(n);else if(Array.isArray(t))for(let s=0,r=t.length;s<r;++s)this.removeEventListener(t[s],e);else this.removeEventListener(t,e)}};function L(){throw new Error("Unimplemented abstract method.")}let cd=0;function at(i){return i.ol_uid||(i.ol_uid=String(++cd))}class fa extends Pe{constructor(t,e,n){super(t),this.key=e,this.oldValue=n}}const Zt=class hd extends ua{constructor(t){super(),at(this),this.values_=null,void 0!==t&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}
1hasProperties(){return!!this.values_}notify(t,e){let n;n=`change:${t}`,this.hasListener(n)&&this.dispatchEvent(new fa(n,t,e)),n="propertychange",this.hasListener(n)&&this.dispatchEvent(new fa(n,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,n){const s=this.values_||(this.values_={});if(n)s[t]=e;else{const r=s[t];s[t]=e,r!==e&&this.notify(t,r)}}setProperties(t,e){for(const n in t)this.set(n,t[n],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const n=this.values_[t];delete this.values_[t],Ze(this.values_)&&(this.values_=null),e||this.notify(t,n)}}};class Ni extends Pe{constructor(t,e,n){super(t),this.element=e,this.index=n}}const Bt=class dd extends Zt{constructor(t,e){if(super(),this.unique_=!!(e=e||{}).unique,this.array_=t??[],this.unique_)for(let n=1,s=this.array_.length;n<s;++n)this.assertUnique_(this.array_[n],n);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,n=t.length;e<n;++e)this.push(t[e]);return this}forEach(t){const e=this.array_;for(let n=0,s=e.length;n<s;++n)t(e[n],n,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get("length")}insertAt(t,e){if(t<0||t>this.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new Ni("add",e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let n=0,s=e.length;n<s;++n)if(e[n]===t)return this.removeAt(n)}removeAt(t){if(t<0||t>=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Ni("remove",e,t)),e}setAt(t,e){if(t>=this.getLength())return void this.insertAt(t,e);if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const s=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Ni("remove",s,t)),this.dispatchEvent(new Ni("add",e,t))}updateLength_(){this.set("length",this.array_.length)}assertUnique_(t,e){const n=this.array_;for(let s=0,r=n.length;s<r;++s)if(n[s]===t&&s!==e)throw new Error("Duplicate item added to a unique collection")}},Sn=class ud extends Pe{constructor(t,e,n){super(t),this.map=e,this.frameState=void 0!==n?n:null}},Re=class fd extends Sn{constructor(t,e,n,s,r,o){super(t,e,r),this.originalEvent=n,this.pixel_=null,this.coordinate_=null,this.dragging=void 0!==s&&s,this.activePointers=o}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}},it={SINGLECLICK:"singleclick",CLICK:"click",DBLCLICK:"dblclick",POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Je=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",gd=(Je.includes("safari")&&!Je.includes("chrom")&&(Je.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Je)),Je.includes("webkit")&&!Je.includes("edge")),Gs=Je.includes("macintosh"),md=typeof devicePixelRatio<"u"?devicePixelRatio:1,fe=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,pd=typeof Image<"u"&&Image.prototype.decode,ma=function(){let i=!1;try{const t=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return i}(),Cd=class yd extends Di{constructor(t,e){super(t),this.map_=t,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=void 0===e?1:e,this.down_=null;const n=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=n,this.pointerdownListenerKey_=K(n,"pointerdown",this.handlePointerDown_,this),this.relayedListenerKey_=K(n,"pointermove",this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener("touchmove",this.boundHandleTouchMove_,!!ma&&{passive:!1})}emulateClick_(t){let e=new Re(it.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Re(it.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const n=new Re(it.SINGLECLICK,this.map_,t);this.dispatchEvent(n)},250)}updateActivePointers_(t){const e=t,n=e.pointerId;if(e.type==it.POINTERUP||e.type==it.POINTERCANCEL){delete this.trackedTouches_[n];for(const s in this.trackedTouches_)if(this.trackedTouches_[s].target!==e.target){delete this.trackedTouches_[s];break}}else(e.type==it.POINTERDOWN||e.type==it.POINTERMOVE)&&(this.trackedTouches_[n]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new Re(it.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_.length&&(this.dragListenerKeys_.forEach(et),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return 0===t.button}handlePointerDown_(t){this.emulateClicks_=0===this.activePointers_.length,this.updateActivePointers_(t);const e=new Re(it.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);
1if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),0===this.dragListenerKeys_.length){const n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(K(n,it.POINTERMOVE,this.handlePointerMove_,this),K(n,it.POINTERUP,this.handlePointerUp_,this),K(this.element_,it.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(K(this.element_.getRootNode(),it.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new Re(it.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Re(it.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&("boolean"!=typeof t.cancelable||!0===t.cancelable)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(et(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener("touchmove",this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(et(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(et),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}};function st(i,t){if(!i)throw new Error(t)}const Gi=1/0,Sd=class bd{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,zn(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,n=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const s=this.keyFunction_(n);return delete this.queuedElements_[s],n}enqueue(t){st(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=Gi&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}getCount(){return this.elements_.length}getLeftChildIndex_(t){return 2*t+1}getRightChildIndex_(t){return 2*t+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return 0===this.elements_.length}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,n=this.priorities_,s=e.length,r=e[t],o=n[t],l=t;for(;t<s>>1;){const c=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),d=h<s&&n[h]<n[c]?h:c;e[t]=e[d],n[t]=n[d],t=d}e[t]=r,n[t]=o,this.siftDown_(l,t)}siftDown_(t,e){const n=this.elements_,s=this.priorities_,r=n[e],o=s[e];for(;e>t;){const l=this.getParentIndex_(e);if(!(s[l]>o))break;n[e]=n[l],s[e]=s[l],e=l}n[e]=r,s[e]=o}reprioritize(){const t=this.priorityFunction_,e=this.elements_,n=this.priorities_;let s=0;const r=e.length;let o,l,c;for(l=0;l<r;++l)o=e[l],c=t(o),c==Gi?delete this.queuedElements_[this.keyFunction_(o)]:(n[s]=c,e[s++]=o);e.length=s,n.length=s,this.heapify_()}},wd=class Ed extends Sd{constructor(t,e){super(n=>t.apply(null,n),n=>n[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=e,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(t){const e=super.enqueue(t);return e&&t[0].addEventListener("change",this.boundHandleTileChange_),e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target,n=e.getState();if(2===n||3===n||4===n){3!==n&&e.removeEventListener("change",this.boundHandleTileChange_);const s=e.getKey();s in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[s],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let n=0;for(;this.tilesLoading_<t&&n<e&&this.getCount()>0;){const s=this.dequeue()[0],r=s.getKey();0===s.getState()&&!(r in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++n,s.load())}}},Jt={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function lt(i,t,e){return Math.min(Math.max(i,t),e)}function xd(i,t,e,n,s,r){const o=s-e,l=r-n;if(0!==o||0!==l){const c=((i-e)*o+(t-n)*l)/(o*o+l*l);c>1?(e=s,n=r):c>0&&(e+=o*c,n+=l*c)}return qe(i,t,e,n)}function qe(i,t,e,n){const s=e-i,r=n-t;return s*s+r*r}function pa(i){return 180*i/Math.PI}function Un(i){return i*Math.PI/180}function _a(i,t){const e=i%t;return e*t<0?e+t:e}function Nt(i,t,e){return i+e*(t-i)}function Hn(i,t){const e=Math.pow(10,t);return Math.round(i*e)/e}function Bs(i,t,e){if(i>=t&&i<e)return i;const n=e-t;return((i-t)%n+n)%n+t}function ya(i,t,e){return function(n,s,r,o,l){if(!n)return;if(!s&&!t)return n;const c=t?0:r[0]*s,h=t?0:r[1]*s,d=l?l[0]:0,u=l?l[1]:0;let f=i[0]+c/2+d,g=i[2]-c/2+d,m=i[1]+h/2+u,p=i[3]-h/2+u;f>g&&(f=(g+f)/2,g=f),m>p&&(m=(p+m)/2,p=m);let _=lt(n[0],f,g),y=lt(n[1],m,p);if(o&&e&&s){const b=30*s;_+=-b*Math.log(1+Math.max(0,f-n[0])/b)+b*Math.log(1+Math.max(0,n[0]-g)/b),y+=-b*Math.log(1+Math.max(0,m-n[1])/b)+b*Math.log(1+Math.max(0,n[1]-p)/b)}return[_,y]}}function Md(i){return i}function Vs(i,t,e){return e?(e[0]=i[0]-t,e[1]=i[1]-t,e[2]=i[2]+t,e[3]=i[3]+t,e):[i[0]-t,i[1]-t,i[2]+t,i[3]+t]}function Ca(i,t){return t?(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t):i.slice()}function Qe(i,t,e){let n,s;return n=t<i[0]?i[0]-t:i[2]<t?t-i[2]:0,s=e<i[1]?i[1]-e:i[3]<e?e-i[3]:0,n*n+s*s}function Ws(i,t){return zs(i,t[0],t[1])}function Fe(i,t){return i[0]<=t[0]&&t[2]<=i[2]&&i[1]<=t[1]&&t[3]<=i[3]}function zs(i,t,e){return i[0]<=t&&t<=i[2]&&i[1]<=e&&e<=i[3]}function Ks(i,t){const o=t[0],l=t[1];let c=0;return o<i[0]?c|=16:o>i[2]&&(c|=4),l<i[1]?c|=8:l>i[3]&&(c|=2),0===c&&(c=1),c}function tn(i,t,e,n,s){return s?(s[0]=i,s[1]=t,s[2]=e,s[3]=n,s):[i,t,e,n]}function Ae(i){return tn(1/0,1/0,-1/0,-1/0,i)}function ba(i,t){const e=i[0],n=i[1];return tn(e,n,e,n,t)}function Xs(i,t,e,n,s){return Ea(Ae(s),i,t,e,n)}function Ys(i,t){return i[0]==t[0]&&i[2]==t[2]&&i[1]==t[1]&&i[3]==t[3]}function Od(i,t){return t[0]<i[0]&&(i[0]=t[0]),t[2]>i[2]&&(i[2]=t[2]),t[1]<i[1]&&(i[1]=t[1]),t[3]>i[3]&&(i[3]=t[3]),i}function Ea(i,t,e,n,s){for(;e<n;e+=s)Rd(i,t[e],t[e+1]);return i}function Rd(i,t,e){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}function Hs(i){return[i[0],i[1]]}function $s(i){return[i[2],i[1]]}function en(i){return[(i[0]+i[2])/2,(i[1]+i[3])/2]}function Zs(i,t,e,n,s){const[r,o,l,c,h,d,u,f]=function Td(i,t,e,n){const s=t*n[0]/2,r=t*n[1]/2,o=Math.cos(e),l=Math.sin(e),c=s*o,h=s*l,d=r*o,u=r*l,f=i[0],g=i[1];
1return[f-c+u,g-h-d,f-c-u,g-h+d,f+c-u,g+h+d,f+c+u,g+h-d,f-c+u,g-h-d]}(i,t,e,n);return tn(Math.min(r,l,h,u),Math.min(o,c,d,f),Math.max(r,l,h,u),Math.max(o,c,d,f),s)}function qt(i){return i[3]-i[1]}function wa(i,t,e){const n=e||[1/0,1/0,-1/0,-1/0];return Gt(i,t)?(n[0]=i[0]>t[0]?i[0]:t[0],n[1]=i[1]>t[1]?i[1]:t[1],n[2]=i[2]<t[2]?i[2]:t[2],n[3]=i[3]<t[3]?i[3]:t[3]):Ae(n),n}function Js(i){return[i[0],i[3]]}function qs(i){return[i[2],i[3]]}function pt(i){return i[2]-i[0]}function Gt(i,t){return i[0]<=t[2]&&i[2]>=t[0]&&i[1]<=t[3]&&i[3]>=t[1]}function En(i){return i[2]<i[0]||i[3]<i[1]}function xa(i,t){const e=t.getExtent(),n=en(i);if(t.canWrapX()&&(n[0]<e[0]||n[0]>=e[2])){const s=pt(e),o=Math.floor((n[0]-e[0])/s)*s;i[0]-=o,i[2]-=o}return i}function ji(i,t){let e=!0;for(let n=i.length-1;n>=0;--n)if(i[n]!=t[n]){e=!1;break}return e}function Qs(i,t){const e=Math.cos(t),n=Math.sin(t),r=i[1]*e+i[0]*n;return i[0]=i[0]*e-i[1]*n,i[1]=r,i}function Pa(i,t){if(t.canWrapX()){const e=pt(t.getExtent()),n=function Xd(i,t,e){const n=t.getExtent();let s=0;return t.canWrapX()&&(i[0]<n[0]||i[0]>n[2])&&(e=e||pt(n),s=Math.floor((i[0]-n[0])/e)),s}(i,t,e);n&&(i[0]-=n*e)}return i}function wn(i){return 1-function Ud(i){return Math.pow(i,3)}(1-i)}function tr(i){return 3*i*i-2*i*i*i}function Hd(i){return i}const $n_warn=2;let Bi=1;function Ra(...i){Bi>$n_warn||console.warn(...i)}const Fa={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937},er=class Zd{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Fa[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}},Zn=6378137,vn=Math.PI*Zn,Jd=[-vn,-vn,vn,vn],qd=[-180,-85,180,85],Vi=Zn*Math.log(Math.tan(Math.PI/2));class xn extends er{constructor(t){super({code:t,units:"m",extent:Jd,global:!0,worldExtent:qd,getPointResolution:function(e,n){return e/Math.cosh(n[1]/Zn)}})}}const Aa=[new xn("EPSG:3857"),new xn("EPSG:102100"),new xn("EPSG:102113"),new xn("EPSG:900913"),new xn("http://www.opengis.net/def/crs/EPSG/0/3857"),new xn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Qd(i,t,e,n){const s=i.length;e=e>1?e:2,n=n??e,void 0===t&&(t=e>2?i.slice():new Array(s));for(let r=0;r<s;r+=n){t[r]=vn*i[r]/180;let o=Zn*Math.log(Math.tan(Math.PI*(+i[r+1]+90)/360));o>Vi?o=Vi:o<-Vi&&(o=-Vi),t[r+1]=o}return t}function tu(i,t,e,n){const s=i.length;e=e>1?e:2,n=n??e,void 0===t&&(t=e>2?i.slice():new Array(s));for(let r=0;r<s;r+=n)t[r]=180*i[r]/vn,t[r+1]=360*Math.atan(Math.exp(i[r+1]/Zn))/Math.PI-90;return t}const Ta=[-180,-90,180,90],nu=6378137*Math.PI/180;class nn extends er{constructor(t,e){super({code:t,units:"degrees",extent:Ta,axisOrientation:e,global:!0,metersPerUnit:nu,worldExtent:Ta})}}const ka=[new nn("CRS:84"),new nn("EPSG:4326","neu"),new nn("urn:ogc:def:crs:OGC:1.3:CRS84"),new nn("urn:ogc:def:crs:OGC:2:84"),new nn("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new nn("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new nn("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Wi={},Qt={};function Jn(i,t,e){const n=i.getCode(),s=t.getCode();n in Qt||(Qt[n]={}),Qt[n][s]=e}function nr(i,t){return i in Qt&&t in Qt[i]?Qt[i][t]:null}const zi=.9996,Vt=.00669438,Xi=Vt*Vt*Vt,sn=Vt/(1-Vt),Da=Math.sqrt(1-Vt),Mn=(1-Da)/(1+Da),La=Mn*Mn,ir=La*Mn,sr=ir*Mn,Na=sr*Mn,Ga=.9983242984503243,lu=35*Xi/3072,cu=1.5*Mn-27/32*ir+269/512*Na,hu=21/16*La-55/32*sr,du=151/96*ir-417/128*Na,uu=1097/512*sr,Yi=6378137;function fu(i,t,e){const n=i-5e5,o=(e.north?t:t-1e7)/zi/(Yi*Ga),l=o+cu*Math.sin(2*o)+hu*Math.sin(4*o)+du*Math.sin(6*o)+uu*Math.sin(8*o),c=Math.sin(l),h=c*c,d=Math.cos(l),u=c/d,f=u*u,g=f*f,m=1-Vt*h,p=Math.sqrt(1-Vt*h),b=sn*d**2,E=b*b,C=n/(Yi/p*zi),w=C*C,v=w*C,F=v*C,O=F*C,M=l-u/((1-Vt)/m)*(w/2-F/24*(5+3*f+10*b-4*E-9*sn))+O*C/720*(61+90*f+298*b+45*g-252*sn-3*E);let z=(C-v/6*(1+2*f+b)+O/120*(5-2*b+28*f-3*E+8*sn+24*g))/d;return z=Bs(z+Un(Va(e.number)),-Math.PI,Math.PI),[pa(z),pa(M)]}function pu(i,t,e){i=Bs(i,-180,180),t<-80?t=-80:t>84&&(t=84);const n=Un(t),s=Math.sin(n),r=Math.cos(n),o=s/r,l=o*o,c=l*l,h=Un(i),u=Un(Va(e.number)),f=Yi/Math.sqrt(1-Vt*s**2),g=sn*r**2,m=r*Bs(h-u,-Math.PI,Math.PI),p=m*m,_=p*m,y=_*m,b=y*m,E=b*m,C=Yi*(Ga*n-.002514607064228144*Math.sin(2*n)+26390466021299826e-22*Math.sin(4*n)-lu*Math.sin(6*n));let v=zi*(C+f*o*(p/2+y/24*(5-l+9*g+4*g**2)+E/720*(61-58*l+c+600*g-330*sn)));return e.north||(v+=1e7),[zi*f*(m+_/6*(1-l+g)+b/120*(5-18*l+c+72*g-58*sn))+5e5,v]}function Va(i){return 6*(i-1)-180+3}const _u=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Wa(i){let t=0;for(const s of _u){const r=i.match(s);if(r){t=parseInt(r[1]);break}}if(!t)return null;let e=0,n=!1;return t>32700&&t<32761?e=t-32700:t>32600&&t<32661&&(n=!0,e=t-32600),e?{number:e,north:n}:null}function za(i,t){return function(e,n,s,r){const o=e.length;s=s>1?s:2,r=r??s,n||(n=s>2?e.slice():new Array(o));for(let l=0;l<o;l+=r){const d=i(e[l],e[l+1],t);n[l]=d[0],n[l+1]=d[1]}return n}}const vu=[function Cu(i){const t=Wa(i.getCode());return t?{forward:za(pu,t),inverse:za(fu,t)}:null}],xu=[function yu(i){return Wa(i)?new er({code:i,units:"m"}):null}];let rr=!0;function or(i,t){if(void 0!==t)for(let e=0,n=i.length;e<n;++e)t[e]=i[e];else t=i.slice();return t}function ar(i){(function su(i,t){Wi[i]=t})(i.getCode(),i),Jn(i,i,or)}function nt(i){if("string"!=typeof i)return i;const t=function iu(i){return Wi[i]||Wi[i.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}(i);if(t)return t;for(const e of xu){const n=e(i);if(n)return n}return null}
1function Za(i){(function Mu(i){i.forEach(ar)})(i),i.forEach(function(t){i.forEach(function(e){t!==e&&Jn(t,e,or)})})}function lr(i,t){return i?"string"==typeof i?nt(i):i:nt(t)}function In(i,t){const e=i.getCode(),n=t.getCode();let s=nr(e,n);if(s)return s;let r=null,o=null;for(const c of vu)r||(r=c(i)),o||(o=c(t));if(!r&&!o)return null;const l="EPSG:4326";if(o)if(r)s=cr(r.inverse,o.forward);else{const c=nr(e,l);c&&(s=cr(c,o.forward))}else{const c=nr(l,n);c&&(s=cr(r.inverse,c))}return s&&(ar(i),ar(t),Jn(i,t,s)),s}function cr(i,t){return function(e,n,s,r){return n=i(e,n,s,r),t(n,n,s,r)}}function qn(i,t){return In(nt(i),nt(t))}let xt=null;function Hi(){return xt}function hr(i,t){return i}function pe(i,t){return rr&&!ji(i,[0,0])&&i[0]>=-180&&i[0]<=180&&i[1]>=-90&&i[1]<=90&&(rr=!1,Ra("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),i}function $i(i,t){return i}function On(i,t){return i}function Ru(i,t){return i}!function Fu(){Za(Aa),Za(ka),function Iu(i,t,e,n){i.forEach(function(s){t.forEach(function(r){Jn(s,r,e),Jn(r,s,n)})})}(ka,Aa,Qd,tu)}();const Au=[1,0,0,1,0,0];function Wt(){return Au.slice(0)}function Mt(i,t){const e=t[0],n=t[1];return t[0]=i[0]*e+i[2]*n+i[4],t[1]=i[1]*e+i[3]*n+i[5],t}function _e(i,t,e,n,s,r,o,l){const c=Math.sin(r),h=Math.cos(r);return i[0]=n*h,i[1]=s*c,i[2]=-n*c,i[3]=s*h,i[4]=o*n*h-l*n*c+t,i[5]=o*s*c+l*s*h+e,i}function fr(i,t){const e=function ku(i){return i[0]*i[3]-i[1]*i[2]}(t);st(0!==e,"Transformation matrix cannot be inverted");const n=t[0],s=t[1],r=t[2],o=t[3],l=t[4],c=t[5];return i[0]=o/e,i[1]=-s/e,i[2]=-r/e,i[3]=n/e,i[4]=(r*c-o*l)/e,i[5]=-(n*c-s*l)/e,i}new Array(6);const Du=[1e5,1e5,1e5,1e5,2,2];function gr(i){return i.substring(7,i.length-1).split(",").map(parseFloat)}function Te(i,t,e,n,s,r,o){r=r||[],o=o||2;let l=0;for(let c=t;c<e;c+=n){const h=i[c],d=i[c+1];r[l++]=s[0]*h+s[2]*d+s[4],r[l++]=s[1]*h+s[3]*d+s[5];for(let u=2;u<o;u++)r[l++]=i[c+u]}return r&&r.length!=l&&(r.length=l),r}function tl(i,t,e,n,s,r,o){o=o||[];const l=Math.cos(s),c=Math.sin(s),h=r[0],d=r[1];let u=0;for(let f=t;f<e;f+=n){const g=i[f]-h,m=i[f+1]-d;o[u++]=h+g*l-m*c,o[u++]=d+g*c+m*l;for(let p=f+2;p<f+n;++p)o[u++]=i[p]}return o&&o.length!=u&&(o.length=u),o}const el=Wt(),ju=[NaN,NaN],nl=class Bu extends Zt{constructor(){super(),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=ha((t,e,n)=>{if(!n)return this.getSimplifiedGeometry(e);const s=this.clone();return s.applyTransform(n),s.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return L()}closestPointXY(t,e,n,s){return L()}containsXY(t,e){return 0===this.closestPointXY(t,e,ju,Number.MIN_VALUE)}getClosestPoint(t,e){return this.closestPointXY(t[0],t[1],e=e||[NaN,NaN],1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return L()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Ae(e),this.extentRevision_=this.getRevision()}return function kd(i,t){return t?(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t):i}(this.extent_,t)}rotate(t,e){L()}scale(t,e,n){L()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return L()}getType(){return L()}applyTransform(t){L()}intersectsExtent(t){return L()}translate(t,e){L()}transform(t,e){const n=nt(t),s="tile-pixels"==n.getUnits()?function(r,o,l){const c=n.getExtent(),h=n.getWorldExtent(),d=qt(h)/qt(c);_e(el,h[0],h[3],d,-d,0,0,0);const u=Te(r,0,r.length,l,el,o),f=qn(n,e);return f?f(u,u,l):u}:qn(n,e);return this.applyTransform(s),this}};function rn(i){let t;return 2==i?t="XY":3==i?t="XYZ":4==i&&(t="XYZM"),t}function il(i){let t;return"XY"==i?t=2:"XYZ"==i||"XYM"==i?t=3:"XYZM"==i&&(t=4),t}const on=class Vu extends nl{constructor(){super(),this.layout="XY",this.stride=2}computeExtent(t){return Xs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return L()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=il(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){L()}setLayout(t,e,n){let s;if(t)s=il(t);else{for(let r=0;r<n;++r){if(0===e.length)return this.layout="XY",void(this.stride=2);e=e[0]}s=e.length,t=rn(s)}this.layout=t,this.stride=s}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,e){const n=this.getFlatCoordinates();if(n){const s=this.getStride();tl(n,0,n.length,s,t,e,n),this.changed()}}scale(t,e,n){void 0===e&&(e=t),n||(n=en(this.getExtent()));const s=this.getFlatCoordinates();if(s){const r=this.getStride();(function Nu(i,t,e,n,s,r,o,l){l=l||[];const c=o[0],h=o[1];let d=0;for(let u=t;u<e;u+=n){const g=i[u+1]-h;l[d++]=c+s*(i[u]-c),l[d++]=h+r*g;for(let m=u+2;m<u+n;++m)l[d++]=i[m]}l&&l.length!=d&&(l.length=d)})(s,0,s.length,r,t,e,n,s),this.changed()}}translate(t,e){const n=this.getFlatCoordinates();if(n){const s=this.getStride();(function Gu(i,t,e,n,s,r,o){o=o||[];let l=0;for(let c=t;c<e;c+=n){o[l++]=i[c]+s,o[l++]=i[c+1]+r;for(let h=c+2;h<c+n;++h)o[l++]=i[h]}o&&o.length!=l&&(o.length=l)})(n,0,n.length,s,t,e,n),this.changed()}}};function sl(i,t,e,n){let s=0;const r=i[e-n],o=i[e-n+1];let l=0,c=0;for(;t<e;t+=n){const h=i[t]-r,d=i[t+1]-o;s+=c*h-l*d,l=h,c=d}return s/2}function rl(i,t,e,n){let s=0;for(let r=0,o=e.length;r<o;++r){const l=e[r];s+=sl(i,t,l,n),t=l}return s}function ol(i,t,e,n,s,r,o){const l=i[t],c=i[t+1],h=i[e]-l,d=i[e+1]-c;let u;if(0===h&&0===d)u=t;else{const f=((s-l)*h+(r-c)*d)/(h*h+d*d);if(f>1)u=e;else{if(f>0){for(let g=0;g<n;++g)o[g]=Nt(i[t+g],i[e+g],f);return void(o.length=n)}u=t}}for(let f=0;f<n;++f)o[f]=i[u+f];o.length=n}function mr(i,t,e,n,s){let r=i[t],o=i[t+1];for(t+=n;t<e;t+=n){const l=i[t],c=i[t+1],h=qe(r,o,l,c);h>s&&(s=h),r=l,o=c}return s}function pr(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r){const l=e[r];s=mr(i,t,l,n,s),t=l}return s}function _r(i,t,e,n,s,r,o,l,c,h,d){if(t==e)return h;let u,f;
vendor: 10,750 bytes, line 1
1if(0===s){if(f=qe(o,l,i[t],i[t+1]),f<h){for(u=0;u<n;++u)c[u]=i[t+u];return c.length=n,f}return h}d=d||[NaN,NaN];let g=t+n;for(;g<e;)if(ol(i,g-n,g,n,o,l,d),f=qe(o,l,d[0],d[1]),f<h){for(h=f,u=0;u<n;++u)c[u]=d[u];c.length=n,g+=n}else g+=n*Math.max((Math.sqrt(f)-Math.sqrt(h))/s|0,1);if(r&&(ol(i,e-n,t,n,o,l,d),f=qe(o,l,d[0],d[1]),f<h)){for(h=f,u=0;u<n;++u)c[u]=d[u];c.length=n}return h}function yr(i,t,e,n,s,r,o,l,c,h,d){d=d||[NaN,NaN];for(let u=0,f=e.length;u<f;++u){const g=e[u];h=_r(i,t,g,n,s,r,o,l,c,h,d),t=g}return h}function Zi(i,t,e,n){for(let s=0,r=e.length;s<r;++s){const o=e[s];for(let l=0;l<n;++l)i[t++]=o[l]}return t}function ti(i,t,e,n,s){s=s||[];let r=0;for(let o=0,l=e.length;o<l;++o){const c=Zi(i,t,e[o],n);s[r++]=c,t=c}return s.length=r,s}function al(i,t,e,n,s){s=s||[];let r=0;for(let o=0,l=e.length;o<l;++o){const c=ti(i,t,e[o],n,s[r]);0===c.length&&(c[0]=t),s[r++]=c,t=c[c.length-1]}return s.length=r,s}function ke(i,t,e,n,s){s=void 0!==s?s:[];let r=0;for(let o=t;o<e;o+=n)s[r++]=i.slice(o,o+n);return s.length=r,s}function ei(i,t,e,n,s){s=void 0!==s?s:[];let r=0;for(let o=0,l=e.length;o<l;++o){const c=e[o];s[r++]=ke(i,t,c,n,s[r]),t=c}return s.length=r,s}function Cr(i,t,e,n,s){s=void 0!==s?s:[];let r=0;for(let o=0,l=e.length;o<l;++o){const c=e[o];s[r++]=1===c.length&&c[0]===t?[]:ei(i,t,c,n,s[r]),t=c[c.length-1]}return s.length=r,s}function Uu(i,t,e,n,s){return!function Fd(i,t){let e;return e=t(Hs(i)),!!(e||(e=t($s(i)),e)||(e=t(qs(i)),e)||(e=t(Js(i)),e))&&e}(s,function(o){return!an(i,t,e,n,o[0],o[1])})}function an(i,t,e,n,s,r){let o=0,l=i[e-n],c=i[e-n+1];for(;t<e;t+=n){const h=i[t],d=i[t+1];c<=r?d>r&&(h-l)*(r-c)-(s-l)*(d-c)>0&&o++:d<=r&&(h-l)*(r-c)-(s-l)*(d-c)<0&&o--,l=h,c=d}return 0!==o}function br(i,t,e,n,s,r){if(0===e.length||!an(i,t,e[0],n,s,r))return!1;for(let o=1,l=e.length;o<l;++o)if(an(i,e[o-1],e[o],n,s,r))return!1;return!0}function ll(i,t,e,n,s){let r;for(t+=n;t<e;t+=n)if(r=s(i.slice(t-n,t),i.slice(t,t+n)),r)return r;return!1}function ni(i,t,e,n,s,r){return r=r??Ea([1/0,1/0,-1/0,-1/0],i,t,e,n),!!Gt(s,r)&&(r[0]>=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]||ll(i,t,e,n,function(o,l){return function Dd(i,t,e){let n=!1;const s=Ks(i,t),r=Ks(i,e);if(1===s||1===r)n=!0;else{const o=i[0],l=i[1],c=i[2],h=i[3],f=e[0],g=e[1],m=(g-t[1])/(f-t[0]);let p,_;2&r&&!(2&s)&&(p=f-(g-h)/m,n=p>=o&&p<=c),!n&&4&r&&!(4&s)&&(_=g-(f-c)*m,n=_>=l&&_<=h),!n&&8&r&&!(8&s)&&(p=f-(g-l)/m,n=p>=o&&p<=c),!n&&16&r&&!(16&s)&&(_=g-(f-o)*m,n=_>=l&&_<=h)}return n}(s,o,l)}))}function cl(i,t,e,n,s){if(!function Zu(i,t,e,n,s){return!!(ni(i,t,e,n,s)||an(i,t,e,n,s[0],s[1])||an(i,t,e,n,s[0],s[3])||an(i,t,e,n,s[2],s[1])||an(i,t,e,n,s[2],s[3]))}(i,t,e[0],n,s))return!1;if(1===e.length)return!0;for(let r=1,o=e.length;r<o;++r)if(Uu(i,e[r-1],e[r],n,s)&&!ni(i,e[r-1],e[r],n,s))return!1;return!0}function ii(i,t,e,n,s,r,o){const l=(e-t)/n;if(l<3){for(;t<e;t+=n)r[o++]=i[t],r[o++]=i[t+1];return o}const c=new Array(l);c[0]=1,c[l-1]=1;const h=[t,e-n];let d=0;for(;h.length>0;){const u=h.pop(),f=h.pop();let g=0;const m=i[f],p=i[f+1],_=i[u],y=i[u+1];for(let b=f+n;b<u;b+=n){const w=xd(i[b],i[b+1],m,p,_,y);w>g&&(d=b,g=w)}g>s&&(c[(d-t)/n]=1,f+n<d&&h.push(f,d),d+n<u&&h.push(d,u))}for(let u=0;u<l;++u)c[u]&&(r[o++]=i[t+u*n],r[o++]=i[t+u*n+1]);return o}function Sr(i,t,e,n,s,r,o,l){for(let c=0,h=e.length;c<h;++c){const d=e[c];o=ii(i,t,d,n,s,r,o),l.push(o),t=d}return o}function ln(i,t){return t*Math.round(i/t)}function tf(i,t,e,n,s,r,o){if(t==e)return o;let h,d,l=ln(i[t],s),c=ln(i[t+1],s);t+=n,r[o++]=l,r[o++]=c;do{if(h=ln(i[t],s),d=ln(i[t+1],s),(t+=n)==e)return r[o++]=h,r[o++]=d,o}while(h==l&&d==c);for(;t<e;){const u=ln(i[t],s),f=ln(i[t+1],s);if(t+=n,u==h&&f==d)continue;const g=h-l,m=d-c,p=u-l,_=f-c;g*_==m*p&&(g<0&&p<g||g==p||g>0&&p>g)&&(m<0&&_<m||m==_||m>0&&_>m)?(h=u,d=f):(r[o++]=h,r[o++]=d,l=h,c=d,h=u,d=f)}return r[o++]=h,r[o++]=d,o}function Er(i,t,e,n,s,r,o,l){for(let c=0,h=e.length;c<h;++c){const d=e[c];o=tf(i,t,d,n,s,r,o),l.push(o),t=d}return o}class Ji extends on{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}clone(){return new Ji(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,n,s){return s<Qe(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(mr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),_r(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,s))}getArea(){return sl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return ke(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=ii(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new Ji(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return ni(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Zi(this.flatCoordinates,0,t,this.stride),this.changed()}}const hl=Ji;class wr extends on{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new wr(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,s){const r=this.flatCoordinates,o=qe(t,e,r[0],r[1]);if(o<s){const l=this.stride;for(let c=0;c<l;++c)n[c]=r[c];return n.length=l,o}return s}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return ba(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return zs(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=function Yu(i,t,e){for(let s=0,r=e.length;s<r;++s)i[t++]=e[s];return t}(this.flatCoordinates,0,t),this.changed()}}const qi=wr;function vr(i,t,e,n,s,r,o){let l,c,h,d,u,f,g;const m=s[r+1],p=[];for(let b=0,E=e.length;b<E;++b){const C=e[b];for(d=i[C-n],f=i[C-n+1],l=t;l<C;l+=n)u=i[l],g=i[l+1],(m<=f&&g<=m||f<=m&&m<=g)&&(h=(m-f)/(g-f)*(u-d)+d,p.push(h)),d=u,f=g}let _=NaN,y=-1/0;for(p.sort(Ie),d=p[0],l=1,c=p.length;l<c;++l){u=p[l];const b=Math.abs(u-d);b>y&&(h=(d+u)/2,br(i,t,e,n,h,m)&&(_=h,y=b)),d=u}return isNaN(_)&&(_=s[r]),o?(o.push(_,m,y),o):[_,m,y]}function dl(i,t,e,n,s){let r=[];for(let o=0,l=e.length;o<l;++o){const c=e[o];r=vr(i,t,c,n,s,2*o,r),t=c[c.length-1]}return r}function nf(i,t,e,n){for(;t<e-n;){for(let s=0;s<n;++s){const r=i[t+s];i[t+s]=i[e-n+s],i[e-n+s]=r}t+=n,e-=n}}function xr(i,t,e,n){let s=0,r=i[e-n],o=i[e-n+1];for(;t<e;t+=n){const l=i[t],c=i[t+1];s+=(l-r)*(c+o),r=l,o=c}return 0===s?void 0:s>0}function Mr(i,t,e,n,s){s=void 0!==s&&s;for(let r=0,o=e.length;r<o;++r){const l=e[r],c=xr(i,t,l,n);if(0===r){if(s&&c||!s&&!c)return!1}else if(s&&!c||!s&&c)return!1;t=l}return!0}function ul(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r){const l=e[r];if(!Mr(i,t,l,n,s))return!1;l.length&&(t=l[l.length-1])}return!0}function Qi(i,t,e,n,s){s=void 0!==s&&s;for(let r=0,o=e.length;r<o;++r){const l=e[r],c=xr(i,t,l,n);(0===r?s&&c||!s&&!c:s&&!c||!s&&c)&&nf(i,t,l,n),t=l}return t}function Ir(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r)t=Qi(i,t,e[r],n,s);return t}class cn extends on{constructor(t,e,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==e&&n?(this.setFlatCoordinates(e,t),this.ends_=n):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?ee(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new cn(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,n,s){return s<Qe(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(pr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),yr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,s))}containsXY(t,e){return br(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return rl(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),Qi(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,ei(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=en(this.getExtent());this.flatInteriorPoint_=vr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new qi(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new hl(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,n=this.ends_,s=[];let r=0;for(let o=0,l=n.length;o<l;++o){const c=n[o],h=new hl(e.slice(r,c),t);s.push(h),r=c}return s}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;Mr(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Qi(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=Er(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,n),new cn(e,"XY",n)}getType(){return"Polygon"}intersectsExtent(t){return cl(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=ti(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()}}const ts=cn;function Or(i){if(En(i))throw new Error("Cannot create polygon from empty extent");const t=i[0],e=i[1],n=i[2],s=i[3],r=[t,e,t,s,n,s,n,e,t,e];return new cn(r,"XY",[r.length])}function Pr(i,t,e,n){const s=pt(t)/e[0],r=qt(t)/e[1];return n?Math.min(i,Math.max(s,r)):Math.min(i,Math.min(s,r))}function Rr(i,t,e){let n=Math.min(i,t);return n*=Math.log(1+50*Math.max(0,i/t-1))/50+1,e&&(n=Math.max(n,e),n/=Math.log(1+50*Math.max(0,e/i-1))/50+1),lt(n,e/2,2*t)}function fl(i,t,e,n,s){return e=void 0===e||e,function(r,o,l,c){if(void 0!==r){const h=n?Pr(i,n,l,s):i;
1return e&&c?Rr(r,h,t):lt(r,t,h)}}}function Fr(i){if(void 0!==i)return 0}function gl(i){if(void 0!==i)return i}function es(i,t){setTimeout(function(){i(t)},0)}function Cf(i){return!(i.sourceCenter&&i.targetCenter&&!ji(i.sourceCenter,i.targetCenter)||i.sourceResolution!==i.targetResolution||i.sourceRotation!==i.targetRotation)}function Tr(i,t,e,n,s){const r=Math.cos(-s);let o=Math.sin(-s),l=i[0]*r-i[1]*o,c=i[1]*r+i[0]*o;return l+=(t[0]/2-e[0])*n,c+=(e[1]-t[1]/2)*n,o=-o,[l*r-c*o,c*r+l*o]}const ne=class mf extends Zt{constructor(t){super(),t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.projection_=lr(t.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.nextCenter_=null,this.cancelAnchor_=void 0,t.projection&&function $a(i){rr=!(void 0===i||i)}(),t.center&&(t.center=pe(t.center)),t.extent&&(t.extent=On(t.extent)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const l in Jt)delete e[l];this.setProperties(e,!0);const n=function _f(i){let t,e,n,o=void 0!==i.minZoom?i.minZoom:0,l=void 0!==i.maxZoom?i.maxZoom:28;const c=void 0!==i.zoomFactor?i.zoomFactor:2,h=void 0!==i.multiWorld&&i.multiWorld,d=void 0===i.smoothResolutionConstraint||i.smoothResolutionConstraint,u=void 0!==i.showFullExtent&&i.showFullExtent,f=lr(i.projection,"EPSG:3857"),g=f.getExtent();let m=i.constrainOnlyCenter,p=i.extent;if(!h&&!p&&f.isGlobal()&&(m=!1,p=g),void 0!==i.resolutions){const _=i.resolutions;e=_[o],n=void 0!==_[l]?_[l]:_[_.length-1],t=i.constrainResolution?function cf(i,t,e,n){return t=void 0===t||t,function(s,r,o,l){if(void 0!==s){const c=i[0],h=i[i.length-1],d=e?Pr(c,e,o,n):c;if(l)return t?Rr(s,d,h):lt(s,h,d);const u=Math.min(d,s),f=Math.floor(ca(i,u,r));return i[f]>d&&f<i.length-1?i[f+1]:i[f]}}}(_,d,!m&&p,u):fl(e,n,d,!m&&p,u)}else{const y=(g?Math.max(pt(g),qt(g)):360*Fa.degrees/f.getMetersPerUnit())/256/Math.pow(2,0),b=y/Math.pow(2,28);e=i.maxResolution,void 0!==e?o=0:e=y/Math.pow(c,o),n=i.minResolution,void 0===n&&(n=void 0!==i.maxZoom?void 0!==i.maxResolution?e/Math.pow(c,l):y/Math.pow(c,l):b),l=o+Math.floor(Math.log(e/n)/Math.log(c)),n=e/Math.pow(c,l-o),t=i.constrainResolution?function hf(i,t,e,n,s,r){return n=void 0===n||n,e=void 0!==e?e:0,function(o,l,c,h){if(void 0!==o){const d=s?Pr(t,s,c,r):t;if(h)return n?Rr(o,d,e):lt(o,e,d);const u=1e-9,f=Math.ceil(Math.log(t/d)/Math.log(i)-u),g=-l*(.5-u)+.5,m=Math.min(d,o),p=Math.floor(Math.log(t/m)/Math.log(i)+g),_=Math.max(f,p);return lt(t/Math.pow(i,_),e,d)}}}(c,e,n,d,!m&&p,u):fl(e,n,d,!m&&p,u)}return{constraint:t,maxResolution:e,minResolution:n,minZoom:o,zoomFactor:c}}(t);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=n.minZoom;const s=function pf(i){if(void 0!==i.extent)return ya(i.extent,i.constrainOnlyCenter,void 0===i.smoothExtentConstraint||i.smoothExtentConstraint);const t=lr(i.projection,"EPSG:3857");if(!0!==i.multiWorld&&t.isGlobal()){const e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,ya(e,!1,!1)}return Md}(t),r=n.constraint,o=function yf(i){if(void 0===i.enableRotation||i.enableRotation){const e=i.constrainRotation;return void 0===e||!0===e?function uf(i){const t=void 0===i?Un(5):i;return function(e,n){return n||void 0===e?e:Math.abs(e)<=t?0:e}}():!1===e?gl:"number"==typeof e?function df(i){const t=2*Math.PI/i;return function(e,n){return n?e:void 0!==e?e=Math.floor(e/t+.5)*t:void 0}}(e):gl}return Fr}(t);this.constraints_={center:s,resolution:r,rotation:o},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)}get padding(){return this.padding_}set padding(t){let e=this.padding_;this.padding_=t;const n=this.getCenterInternal();if(n){const s=t||[0,0,0,0];e=e||[0,0,0,0];const r=this.getResolution();this.setCenterInternal([n[0]+r/2*(s[3]-e[3]+e[1]-s[1]),n[1]-r/2*(s[0]-e[0]+e[2]-s[2])])}}getUpdatedOptions_(t){const e=this.getProperties();return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Object.assign({},e,t)}animate(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const e=new Array(arguments.length);for(let n=0;n<e.length;++n){let s=arguments[n];s.center&&(s=Object.assign({},s),s.center=pe(s.center,this.getProjection())),s.anchor&&(s=Object.assign({}
vendor: 7,440 bytes, line 1
1,s),s.anchor=pe(s.anchor,this.getProjection())),e[n]=s}this.animateInternal.apply(this,e)}animateInternal(t){let n,e=arguments.length;e>1&&"function"==typeof arguments[e-1]&&(n=arguments[e-1],--e);let s=0;for(;s<e&&!this.isDef();++s){const d=arguments[s];d.center&&this.setCenterInternal(d.center),void 0!==d.zoom?this.setZoom(d.zoom):d.resolution&&this.setResolution(d.resolution),void 0!==d.rotation&&this.setRotation(d.rotation)}if(s===e)return void(n&&es(n,!0));let r=Date.now(),o=this.targetCenter_.slice(),l=this.targetResolution_,c=this.targetRotation_;const h=[];for(;s<e;++s){const d=arguments[s],u={start:r,complete:!1,anchor:d.anchor,duration:void 0!==d.duration?d.duration:1e3,easing:d.easing||tr,callback:n};if(d.center&&(u.sourceCenter=o,u.targetCenter=d.center.slice(),o=u.targetCenter),void 0!==d.zoom?(u.sourceResolution=l,u.targetResolution=this.getResolutionForZoom(d.zoom),l=u.targetResolution):d.resolution&&(u.sourceResolution=l,u.targetResolution=d.resolution,l=u.targetResolution),void 0!==d.rotation){u.sourceRotation=c;const f=_a(d.rotation-c+Math.PI,2*Math.PI)-Math.PI;u.targetRotation=c+f,c=u.targetRotation}Cf(u)?u.complete=!0:r+=u.duration,h.push(u)}this.animations_.push(h),this.setHint(0,1),this.updateAnimations_()}getAnimating(){return this.hints_[0]>0}getInteracting(){return this.hints_[1]>0}cancelAnimations(){let t;this.setHint(0,-this.hints_[0]);for(let e=0,n=this.animations_.length;e<n;++e){const s=this.animations_[e];if(s[0].callback&&es(s[0].callback,!1),!t)for(let r=0,o=s.length;r<o;++r){const l=s[r];if(!l.complete){t=l.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const t=Date.now();let e=!1;for(let n=this.animations_.length-1;n>=0;--n){const s=this.animations_[n];let r=!0;for(let o=0,l=s.length;o<l;++o){const c=s[o];if(c.complete)continue;let d=c.duration>0?(t-c.start)/c.duration:1;d>=1?(c.complete=!0,d=1):r=!1;const u=c.easing(d);if(c.sourceCenter){const f=c.sourceCenter[0],g=c.sourceCenter[1],m=c.targetCenter[0],p=c.targetCenter[1];this.nextCenter_=c.targetCenter,this.targetCenter_=[f+u*(m-f),g+u*(p-g)]}if(c.sourceResolution&&c.targetResolution){const f=1===u?c.targetResolution:c.sourceResolution+u*(c.targetResolution-c.sourceResolution);if(c.anchor){const g=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(f,0,g,!0);this.targetCenter_=this.calculateCenterZoom(m,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=f,this.applyTargetState_(!0)}if(void 0!==c.sourceRotation&&void 0!==c.targetRotation){const f=1===u?_a(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+u*(c.targetRotation-c.sourceRotation);if(c.anchor){const g=this.constraints_.rotation(f,!0);this.targetCenter_=this.calculateCenterRotate(g,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=f}if(this.applyTargetState_(!0),e=!0,!c.complete)break}if(r){this.animations_[n]=null,this.setHint(0,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=s[0].callback;o&&es(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let n;const s=this.getCenterInternal();return void 0!==s&&(n=[s[0]-e[0],s[1]-e[1]],Qs(n,t-this.getRotation()),function Bd(i,t){i[0]+=+t[0],i[1]+=+t[1]}(n,e)),n}calculateCenterZoom(t,e){let n;const s=this.getCenterInternal(),r=this.getResolution();return void 0!==s&&void 0!==r&&(n=[e[0]-t*(e[0]-s[0])/r,e[1]-t*(e[1]-s[1])/r]),n}getViewportSize_(t){const e=this.viewportSize_;if(t){const n=e[0],s=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(s*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(s*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&hr(t,this.getProjection())}getCenterInternal(){return this.get(Jt.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){return $i(this.calculateExtentInternal(t),this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();st(e,"The view center is not defined");const n=this.getResolution();st(void 0!==n,"The view resolution is not defined");const s=this.getRotation();return st(void 0!==s,"The view rotation is not defined"),Zs(e,n,s,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Jt.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(On(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const n=pt(t)/e[0],s=qt(t)/e[1];return Math.max(n,s)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),s=Math.log(e/this.minResolution_)/Math.log(t);return function(r){return e/Math.pow(t,r*s)}}getRotation(){return this.get(Jt.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),r=Math.log(n/this.minResolution_)/e;return function(o){return Math.log(n/o)/e/r}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),n=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const o=this.getViewportSizeMinusPadding_();s=Tr(s,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],e,n)}return{center:s.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let n,s,e=this.minZoom_||0;if(this.resolutions_){const r=ca(this.resolutions_,t,1);e=r,n=this.resolutions_[r],s=r==this.resolutions_.length-1?2:n/this.resolutions_[r+1]}else n=this.maxResolution_,s=this.zoomFactor_;return e+Math.log(n/t)/Math.log(s)}getResolutionForZoom(t){if(this.resolutions_?.length){if(1===this.resolutions_.length)return this.resolutions_[0];const e=lt(Math.floor(t),0,this.resolutions_.length-2);return this.resolutions_[e]/Math.pow(this.resolutions_[e]/this.resolutions_[e+1],lt(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}
1fit(t,e){let n;if(st(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,"Invalid extent or geometry provided as `geometry`"),Array.isArray(t))st(!En(t),"Cannot fit empty extent provided as `geometry`"),n=Or(On(t,this.getProjection()));else if("Circle"===t.getType()){const s=On(t.getExtent(),this.getProjection());n=Or(s),n.rotate(this.getRotation(),en(s))}else{const s=Hi();n=s?t.clone().transform(s,this.getProjection()):t}this.fitInternal(n,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),n=Math.cos(e),s=Math.sin(-e),r=t.getFlatCoordinates(),o=t.getStride();let l=1/0,c=1/0,h=-1/0,d=-1/0;for(let u=0,f=r.length;u<f;u+=o){const g=r[u]*n-r[u+1]*s,m=r[u]*s+r[u+1]*n;l=Math.min(l,g),c=Math.min(c,m),h=Math.max(h,g),d=Math.max(d,m)}return[l,c,h,d]}fitInternal(t,e){let n=(e=e||{}).size;n||(n=this.getViewportSizeMinusPadding_());const s=void 0!==e.padding?e.padding:[0,0,0,0],r=void 0!==e.nearest&&e.nearest;let o;o=void 0!==e.minResolution?e.minResolution:void 0!==e.maxZoom?this.getResolutionForZoom(e.maxZoom):0;const l=this.rotatedExtentForGeometry(t);let c=this.getResolutionForExtentInternal(l,[n[0]-s[1]-s[3],n[1]-s[0]-s[2]]);c=isNaN(c)?o:Math.max(c,o),c=this.getConstrainedResolution(c,r?0:1);const h=this.getRotation(),d=Math.sin(h),u=Math.cos(h),f=en(l);f[0]+=(s[1]-s[3])/2*c,f[1]+=(s[0]-s[2])/2*c;const p=this.getConstrainedCenter([f[0]*u-f[1]*d,f[1]*u+f[0]*d],c),_=e.callback?e.callback:Xn;void 0!==e.duration?this.animateInternal({resolution:c,center:p,duration:e.duration,easing:e.easing},_):(this.targetResolution_=c,this.targetCenter_=p,this.applyTargetState_(!1,!0),es(_,!0))}centerOn(t,e,n){this.centerOnInternal(pe(t,this.getProjection()),e,n)}centerOnInternal(t,e,n){this.setCenterInternal(Tr(t,e,n,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,n,s){let r;const o=this.padding_;if(o&&t){const l=this.getViewportSizeMinusPadding_(-n),c=Tr(t,s,[l[0]/2+o[3],l[1]/2+o[0]],e,n);r=[t[0]-c[0],t[1]-c[1]]}return r}isDef(){return!!this.getCenterInternal()&&void 0!==this.getResolution()}adjustCenter(t){const e=hr(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])}adjustCenterInternal(t){const e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])}adjustResolution(t,e){e=e&&pe(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){const n=this.getAnimating()||this.getInteracting(),s=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,s,n);e&&(this.targetCenter_=this.calculateCenterZoom(r,e)),this.targetResolution_*=t,this.applyTargetState_()}adjustZoom(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)}adjustRotation(t,e){e&&(e=pe(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){const n=this.getAnimating()||this.getInteracting(),s=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(s,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t&&pe(t,this.getProjection()))}setCenterInternal(t){this.targetCenter_=t,this.applyTargetState_()}setHint(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]}setResolution(t){this.targetResolution_=t,this.applyTargetState_()}setRotation(t){this.targetRotation_=t,this.applyTargetState_()}setZoom(t){this.setResolution(this.getResolutionForZoom(t))}applyTargetState_(t,e){const n=this.getAnimating()||this.getInteracting()||e,s=this.constraints_.rotation(this.targetRotation_,n),r=this.getViewportSize_(s),o=this.constraints_.resolution(this.targetResolution_,0,r,n),l=this.constraints_.center(this.targetCenter_,o,r,n,this.calculateCenterShift(this.targetCenter_,o,s,r));this.get(Jt.ROTATION)!==s&&this.set(Jt.ROTATION,s),this.get(Jt.RESOLUTION)!==o&&(this.set(Jt.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!l||!this.get(Jt.CENTER)||!ji(this.get(Jt.CENTER),l))&&this.set(Jt.CENTER,l),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,e,n){t=void 0!==t?t:200;const s=e||0,r=this.constraints_.rotation(this.targetRotation_),o=this.getViewportSize_(r),l=this.constraints_.resolution(this.targetResolution_,s,o),c=this.constraints_.center(this.targetCenter_,l,o,!1,this.calculateCenterShift(this.targetCenter_,l,r,o));if(0===t&&!this.cancelAnchor_)return this.targetResolution_=l,this.targetRotation_=r,this.targetCenter_=c,void this.applyTargetState_();n=n||(0===t?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==l||this.getRotation()!==r||!this.getCenterInternal()||!ji(this.getCenterInternal(),c))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:c,resolution:l,duration:t,easing:wn,anchor:n}))}beginInteraction(){this.resolveConstraints(0),this.setHint(1,1)}endInteraction(t,e,n){n=n&&pe(n,this.getProjection()),this.endInteractionInternal(t,e,n)}endInteractionInternal(t,e,n){this.getInteracting()&&(this.setHint(1,-1),this.resolveConstraints(t,e,n))}getConstrainedCenter(t,e){const n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)}getConstrainedZoom(t,e){const n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))}getConstrainedResolution(t,e){e=e||0;const n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,n)}};var ns=R(95386);const is="ol-hidden",si="ol-unselectable",ss="ol-control",ml="ol-collapsed",Sf=ne
vendor: 13,789 bytes, line 1
1w RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z0-9]+?)\\s*$"].join(""),"i"),pl=["style","variant","weight","size","lineHeight","family"],Dr={normal:400,bold:700},Lr=function(i){const t=i.match(Sf);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"400",variant:"normal"};for(let n=0,s=pl.length;n<s;++n){const r=t[n+1];void 0!==r&&(e[pl[n]]="string"==typeof r?r.trim():r)}return isNaN(Number(e.weight))&&e.weight in Dr&&(e.weight=Dr[e.weight]),e.families=e.family.split(/,\s?/).map(n=>n.trim().replace(/^['"]|['"]$/g,"")),e};function St(i,t,e,n){let s;return s=e&&e.length?e.shift():fe?new class extends OffscreenCanvas{style={}}(i??300,t??150):document.createElement("canvas"),i&&(s.width=i),t&&(s.height=t),s.getContext("2d",n)}let Nr;function Gr(){return Nr||(Nr=St(1,1)),Nr}function wf(i){let t=i.offsetWidth;const e=getComputedStyle(i);return t+=parseInt(e.marginLeft,10)+parseInt(e.marginRight,10),t}function vf(i){let t=i.offsetHeight;const e=getComputedStyle(i);return t+=parseInt(e.marginTop,10)+parseInt(e.marginBottom,10),t}function _l(i,t){const e=t.parentNode;e&&e.replaceChild(i,t)}function yl(i){for(;i.lastChild;)i.lastChild.remove()}function Cl(){return new Proxy({childNodes:[],appendChild:function(t){return this.childNodes.push(t),t},remove:function(){},removeChild:function(t){const e=this.childNodes.indexOf(t);if(-1===e)throw new Error("Node to remove was not found");return this.childNodes.splice(e,1),t},insertBefore:function(t,e){const n=this.childNodes.indexOf(e);if(-1===n)throw new Error("Reference node not found");return this.childNodes.splice(n,0,t),t},style:{}},{get:(t,e,n)=>"firstElementChild"===e?t.childNodes.length>0?t.childNodes[0]:null:Reflect.get(t,e,n)})}function ie(i){return typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas}const rs=class Mf extends Zt{constructor(t){super();const e=t.element;e&&!t.target&&!e.style.pointerEvents&&(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&this.element?.remove();for(let e=0,n=this.listenerKeys.length;e<n;++e)et(this.listenerKeys[e]);if(this.listenerKeys.length=0,this.map_=t,t){const e=this.target_??t.getOverlayContainerStopEvent();this.element&&e.appendChild(this.element),this.render!==Xn&&this.listenerKeys.push(K(t,"postrender",this.render,this)),t.render()}}render(t){}setTarget(t){this.target_="string"==typeof t?document.getElementById(t):t}},Of=class If extends rs{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=void 0===t.collapsed||t.collapsed,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=void 0!==t.collapsible,this.collapsible_=void 0===t.collapsible||t.collapsible,this.collapsible_||(this.collapsed_=!1),this.attributions_=t.attributions;const e=void 0!==t.className?t.className:"ol-attribution",n=void 0!==t.tipLabel?t.tipLabel:"Attributions",s=void 0!==t.expandClassName?t.expandClassName:e+"-expand",r=void 0!==t.collapseLabel?t.collapseLabel:"\u203a",o=void 0!==t.collapseClassName?t.collapseClassName:e+"-collapse";"string"==typeof r?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=r,this.collapseLabel_.className=o):this.collapseLabel_=r;const l=void 0!==t.label?t.label:"i";"string"==typeof l?(this.label_=document.createElement("span"),this.label_.textContent=l,this.label_.className=s):this.label_=l;const c=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=n,this.toggleButton_.appendChild(c),this.toggleButton_.addEventListener("click",this.handleClick_.bind(this),!1);const d=this.element;d.className=e+" "+si+" "+ss+(this.collapsed_&&this.collapsible_?" "+ml:"")+(this.collapsible_?"":" ol-uncollapsible"),d.appendChild(this.toggleButton_),d.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){const e=this.getMap().getAllLayers(),n=new Set(e.flatMap(s=>s.getAttributions(t)));if(void 0!==this.attributions_&&(Array.isArray(this.attributions_)?this.attributions_.forEach(s=>n.add(s)):n.add(this.attributions_)),!this.overrideCollapsible_){const s=!e.some(r=>!1===r.getSource()?.getAttributionsCollapsible());this.setCollapsible(s)}return Array.from(n)}updateElement_(t){var e=this;return ns(function*(){if(!t)return void(e.renderedVisible_&&(e.element.style.display="none",e.renderedVisible_=!1));const n=yield Promise.all(e.collectSourceAttributions_(t).map(r=>function da(i){return function t(){let e;try{e=i()}catch(n){return Promise.reject(n)}return e instanceof Promise?e:Promise.resolve(e)}()}(()=>r))),s=n.length>0;if(e.renderedVisible_!=s&&(e.element.style.display=s?"":"none",e.renderedVisible_=s),!Oe(n,e.renderedAttributions_)){yl(e.ulElement_);for(let r=0,o=n.length;r<o;++r){const l=document.createElement("li");l.innerHTML=n[r],e.ulElement_.appendChild(l)}e.renderedAttributions_=n}})()}handleClick_(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(ml),this.collapsed_?_l(this.collapseLabel_,this.label_):_l(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(t){this.updateElement_(t.frameState)}},Rf=class Pf extends rs{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target});const e=void 0!==t.className?t.className:"ol-rotate",n=void 0!==t.label?t.label:"\u21e7",s=void 0!==t.compassClassName?t.compassClassName:"ol-compass";this.label_=null,"string"==typeof n?(this.label_=document.createElement("span"),this.label_.className=s,this.label_.textContent=n):(this.label_=n,this.label_.classList.add(s));const r=t.tipLabel?t.tipLabel:"Reset rotation",o=document.createElement("button");o.className=e+"-reset",o.setAttribute("type","button"),o.title=r,o.appendChild(this.label_),o.addEventListener("click",this.handleClick_.bind(this),!1);const c=this.element;c.className=e+" "+si+" "+ss,c.appendChild(o),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=void 0!==t.duration?t.duration:250,this.autoHide_=void 0===t.autoHide||t.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(is)}handleClick_(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const e=this.getMap().getView();if(!e)return;const n=e.getRotation();void 0!==n&&(this.duration_>0&&n%(2*Math.PI)!=0?e.animate({rotation:0,duration:this.duration_,easing:wn}):e.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const n=e.viewState.rotation;if(n!=this.rotation_){const s="rotate("+n+"rad)";if(this.autoHide_){const r=this.element.classList.contains(is);r||0!==n?r&&0!==n&&this.element.classList.remove(is):this.element.classList.add(is)}this.label_.style.transform=s}this.rotation_=n}},Af=class Ff extends rs{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=void 0!==t.className?t.className:"ol-zoom",n=void 0!==t.delta?t.delta:1,s=void 0!==t.zoomInClassName?t.zoomInClassName:e+"-in",r=void 0!==t.zoomOutClassName?t.zoomOutClassName:e+"-out",o=void 0!==t.zoomInLabel?t.zoomInLabel:"+",l=void 0!==t.zoomOutLabel?t.zoomOutLabel:"\u2013",c=void 0!==t.zoomInTipLabel?t.zoomInTipLabel:"Zoom in",h=void 0!==t.zoomOutTipLabel?t.zoomOutTipLabel:"Zoom out",d=document.createElement("button");d.className=s,d.setAttribute("type","button"),d.title=c,d.appendChild("string"==typeof o?document.createTextNode(o):o),d.addEventListener("click",this.handleClick_.bind(this,n),!1);const u=document.createElement("button");u.className=r,u.setAttribute("type","button"),u.title=h,u.appendChild("string"==typeof l?document.createTextNode(l):l),u.addEventListener("click",this.handleClick_.bind(this,-n),!1);const g=this.element;g.className=e+" "+si+" "+ss,g.appendChild(d),g.appendChild(u),this.duration_=void 0!==t.duration?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const n=this.getMap().getView();if(!n)return;const s=n.getZoom();if(void 0!==s){const r=n.getConstrainedZoom(s+t);this.duration_>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:r,duration:this.duration_,easing:wn})):n.setZoom(r)}}};function bl(i){i=i||{};const t=new Bt;return(void 0===i.zoom||i.zoom)&&t.push(new Af(i.zoomOptions)),(void 0===i.rotate||i.rotate)&&t.push(new Rf(i.rotateOptions)),(void 0===i.attribution||i.attribution)&&t.push(new Of(i.attributionOptions)),t}const kf=class Tf{constructor(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;let n=e-3;for(;n>0&&this.points_[n+2]>t;)n-=3;const s=this.points_[e+2]-this.points_[n+2];if(s<1e3/60)return!1;const r=this.points_[e]-this.points_[n],o=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/s,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}};function jr(i,t,e,n){const s=i.getZoom();if(void 0===s)return;const r=i.getConstrainedZoom(s+t),o=i.getResolutionForZoom(r);i.getAnimating()&&i.cancelAnimations(),i.animate({resolution:o,anchor:e,duration:void 0!==n?n:250,easing:wn})}const ri=class Df extends Zt{constructor(t){super(),t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get("active")}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set("active",t)}setMap(t){this.map_=t}},Gf=class Nf extends ri{constructor(t){super(),this.delta_=(t=t||{}).delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:250}handleEvent(t){let e=!1;if(t.type==it.DBLCLICK){const n=t.originalEvent,r=t.coordinate,o=n.shiftKey?-this.delta_:this.delta_;jr(t.map.getView(),o,r,this.duration_),n.preventDefault(),e=!0}return!e}};function Vr(i){const t=arguments;return function(e){let n=!0;for(let s=0,r=t.length;s<r&&(n=n&&t[s](e),n);++s);return n}}const jf=function(i){const t=i.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},El=function(i){const t=i.map.getTargetElement(),e=t.getRootNode();return!(e instanceof ShadowRoot?e.host:t).hasAttribute("tabindex")||function(i){const t=i.map.getTargetElement(),e=t.getRootNode(),n=i.map.getOwnerDocument().activeElement;return e instanceof ShadowRoot?e.host.contains(n):t.contains(n)}(i)},Vf=Kn,wl=function(i){const t=i.originalEvent;return"pointerId"in t&&0==t.button&&!(gd&&Gs&&t.ctrlKey)},vl=function(i){const t=i.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},Kf=function(i){const t=i.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},xl=function(i){const t=i.originalEvent,e=t.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e&&!t.target.isContentEditable},Wr=function(i){const t=i.originalEvent;return"pointerId"in t&&"mouse"==t.pointerType},Xf=function(i){const t=i.originalEvent;return"pointerId"in t&&t.isPrimary&&0===t.button};function zr(i){const t=i.length;let e=0,n=0;for(let s=0;s<t;s++)e+=i[s].clientX,n+=i[s].clientY;return{clientX:e/t,clientY:n/t}}const oi=class Yf extends ri{constructor(t){super(t=t||{}),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==it.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==it.POINTERUP){const n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==it.POINTERDOWN){const n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==it.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}},Hf=class Uf extends oi{constructor(t){super({stopDown:ki}
1),this.kinetic_=(t=t||{}).kinetic,this.lastCentroid=null,this.panning_=!1;const e=t.condition?t.condition:Vr(vl,Xf);this.condition_=t.onFocusOnly?Vr(El,e):e,this.noKinetic_=!1}handleDragEvent(t){const e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());const n=this.targetPointers,s=e.getEventPixel(zr(n));if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(s[0],s[1]),this.lastCentroid){const r=[this.lastCentroid[0]-s[0],s[1]-this.lastCentroid[1]],l=t.map.getView();(function zd(i,t){i[0]*=t,i[1]*=t})(r,l.getResolution()),Qs(r,l.getRotation()),l.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=s,this.lastPointersCount_=n.length,t.originalEvent.preventDefault()}handleUpEvent(t){const e=t.map,n=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const s=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=n.getCenterInternal(),l=e.getPixelFromCoordinateInternal(o),c=e.getCoordinateFromPixelInternal([l[0]-s*Math.cos(r),l[1]-s*Math.sin(r)]);n.animateInternal({center:n.getConstrainedCenter(c),duration:500,easing:wn})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){const n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}},Zf=class $f extends oi{constructor(t){t=t||{},super({stopDown:ki}),this.condition_=t.condition?t.condition:jf,this.lastAngle_=void 0,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){if(!Wr(t))return;const e=t.map,n=e.getView();if(n.getConstraints().rotation===Fr)return;const s=e.getSize(),r=t.pixel,o=Math.atan2(s[1]/2-r[1],r[0]-s[0]/2);void 0!==this.lastAngle_&&n.adjustRotationInternal(-(o-this.lastAngle_)),this.lastAngle_=o}handleUpEvent(t){return!Wr(t)||(t.map.getView().endInteraction(this.duration_),!1)}handleDownEvent(t){return!!(Wr(t)&&wl(t)&&this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0)}},qf=class Jf extends Ns{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,e=this.endPixel_,n="px",s=this.element_.style;s.left=Math.min(t[0],e[0])+n,s.top=Math.min(t[1],e[1])+n,s.width=Math.abs(e[0]-t[0])+n,s.height=Math.abs(e[1]-t[1])+n}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const t=this.startPixel_,e=this.endPixel_,s=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new ts([s])}getGeometry(){return this.geometry_}};class ai extends Pe{constructor(t,e,n){super(t),this.coordinate=e,this.mapBrowserEvent=n}}const tg=class Qf extends oi{constructor(t){super(),this.box_=new qf((t=t??{}
1).className||"ol-dragbox"),this.minArea_=t.minArea??64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??wl,this.boxEndCondition_=t.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,n){const s=n[0]-e[0],r=n[1]-e[1];return s*s+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new ai("boxdrag",t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new ai(e?"boxend":"boxcancel",t.coordinate,t)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new ai("boxstart",t.coordinate,t)),!0)}onBoxEnd(t){}setActive(t){t||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new ai("boxcancel",this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}setMap(t){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new ai("boxcancel",this.startPixel_,null)),this.startPixel_=null)),super.setMap(t)}},ng=class eg extends tg{constructor(t){super({condition:(t=t||{}).condition?t.condition:Kf,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=void 0!==t.duration?t.duration:200,this.out_=void 0!==t.out&&t.out}onBoxEnd(t){const n=this.getMap().getView();let s=this.getGeometry();if(this.out_){const r=n.rotatedExtentForGeometry(s),o=n.getResolutionForExtentInternal(r),l=n.getResolution()/o;s=s.clone(),s.scale(l*l)}n.fitInternal(s,{duration:this.duration_,easing:wn})}},sg=class ig extends ri{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return vl(e)&&xl(e)},this.condition_=void 0!==t.condition?t.condition:this.defaultCondition_,this.duration_=void 0!==t.duration?t.duration:100,this.pixelDelta_=void 0!==t.pixelDelta?t.pixelDelta:128}handleEvent(t){let e=!1;if("keydown"==t.type){const n=t.originalEvent,s=n.key;if(this.condition_(t)&&("ArrowDown"==s||"ArrowLeft"==s||"ArrowRight"==s||"ArrowUp"==s)){const o=t.map.getView(),l=o.getResolution()*this.pixelDelta_;let c=0,h=0;
1"ArrowDown"==s?h=-l:"ArrowLeft"==s?c=-l:"ArrowRight"==s?c=l:h=l;const d=[c,h];Qs(d,o.getRotation()),function Lf(i,t,e){const n=i.getCenterInternal();n&&i.animateInternal({duration:void 0!==e?e:250,easing:Hd,center:i.getConstrainedCenter([n[0]+t[0],n[1]+t[1]])})}(o,d,this.duration_),n.preventDefault(),e=!0}}return!e}},og=class rg extends ri{constructor(t){super(),this.condition_=(t=t||{}).condition?t.condition:function(e){return!function(i){const t=i.originalEvent;return Gs?t.metaKey:t.ctrlKey}(e)&&xl(e)},this.delta_=t.delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:100}handleEvent(t){let e=!1;if("keydown"==t.type||"keypress"==t.type){const n=t.originalEvent,s=n.key;if(this.condition_(t)&&("+"===s||"-"===s)){const o="+"===s?this.delta_:-this.delta_;jr(t.map.getView(),o,void 0,this.duration_),n.preventDefault(),e=!0}}return!e}},dg=class hg extends ri{constructor(t){super(t=t||{}),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=void 0!==t.maxDelta?t.maxDelta:1,this.duration_=void 0!==t.duration?t.duration:250,this.timeout_=void 0!==t.timeout?t.timeout:80,this.useAnchor_=void 0===t.useAnchor||t.useAnchor,this.constrainResolution_=void 0!==t.constrainResolution&&t.constrainResolution;const e=t.condition?t.condition:Vf;this.condition_=t.onFocusOnly?Vr(El,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.mode_=void 0,this.trackpadEventGap_=400,this.deltaPerZoom_=300,this.ctrlKeyPressed_=!1,this.ctrlKeyListenerKeys_=[]}setMap(t){if(this.ctrlKeyListenerKeys_.forEach(et),this.ctrlKeyListenerKeys_.length=0,this.ctrlKeyPressed_=!1,super.setMap(t),t){const e=t.getOwnerDocument();this.ctrlKeyListenerKeys_.push(K(e,"keydown",n=>{"Control"===n.key&&(this.ctrlKeyPressed_=!0)}),K(e,"keyup",n=>{"Control"===n.key&&(this.ctrlKeyPressed_=!1)}))}}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();if(!t)return;const e=t.getView(),n=this.lastDelta_?this.lastDelta_>0?1:-1:0;e.endInteraction(this.constrainResolution_||e.getConstrainResolution()?100:void 0,n,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(t){if(!this.condition_(t)||"wheel"!==t.type)return!0;const n=t.map,s=t.originalEvent;s.preventDefault();const r=s.ctrlKey&&!this.ctrlKeyPressed_;s.ctrlKey||(this.ctrlKeyPressed_=!1),this.useAnchor_&&(this.lastAnchor_=t.pixel);let o=s.deltaY;switch(s.deltaMode){case WheelEvent.DOM_DELTA_LINE:o*=40;break;case WheelEvent.DOM_DELTA_PAGE:o*=300}if(0===o)return!1;this.lastDelta_=o;const l=Date.now();void 0===this.startTime_&&(this.startTime_=l),(!this.mode_||l-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(o)<4?"trackpad":"wheel");const c=n.getView();if("trackpad"===this.mode_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(c.getAnimating()&&c.cancelAnimations(),c.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r&&(o*=3),c.adjustZoom(-o/this.deltaPerZoom_,this.lastAnchor_?n.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=l,!1;this.totalDelta_+=o;const h=Math.max(this.timeout_-(l-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),h),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let n=-lt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),jr(e,n,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}},fg=class ug extends oi{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=ki),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==t.threshold?t.threshold:.3,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){let e=0;const n=this.targetPointers[0],s=this.targetPointers[1],r=Math.atan2(s.clientY-n.clientY,s.clientX-n.clientX);if(void 0!==this.lastAngle_){const c=r-this.lastAngle_;this.rotationDelta_+=c,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=c}this.lastAngle_=r;const o=t.map,l=o.getView();l.getConstraints().rotation!==Fr&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(zr(this.targetPointers))),this.rotating_&&(o.render(),l.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return!(this.targetPointers.length<2&&(t.map.getView().endInteraction(this.duration_),1))}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}},mg=class gg extends oi{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=ki),super(e),this.anchor_=null,this.duration_=void 0!==t.duration?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const n=this.targetPointers[0],s=this.targetPointers[1],r=n.clientX-s.clientX,o=n.clientY-s.clientY,l=Math.sqrt(r*r+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/l),this.lastDistance_=l;const c=t.map,h=c.getView();1!=e&&(this.lastScaleDelta_=e),this.anchor_=c.getCoordinateFromPixelInternal(c.getEventPixel(zr(this.targetPointers))),c.render(),h.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_,this.lastScaleDelta_>1?1:-1),!1)}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}},Ml=class _g extends Zt{constructor(t){super(),this.background_=t.background;const e=Object.assign({},t);"object"==typeof t.properties&&(delete e.properties,Object.assign(e,t.properties)),e.opacity=void 0!==t.opacity?t.opacity:1,st("number"==typeof e.o
1pacity,"Layer opacity must be a number"),e.visible=void 0===t.visible||t.visible,e.zIndex=t.zIndex,e.maxResolution=void 0!==t.maxResolution?t.maxResolution:1/0,e.minResolution=void 0!==t.minResolution?t.minResolution:0,e.minZoom=void 0!==t.minZoom?t.minZoom:-1/0,e.maxZoom=void 0!==t.maxZoom?t.maxZoom:1/0,this.className_=void 0!==e.className?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:void 0===t||t},n=this.getZIndex();return e.opacity=lt(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==n||e.managed?n:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return L()}getLayerStatesArray(t){return L()}getExtent(){return this.get("extent")}getMaxResolution(){return this.get("maxResolution")}getMinResolution(){return this.get("minResolution")}getMinZoom(){return this.get("minZoom")}getMaxZoom(){return this.get("maxZoom")}getOpacity(){return this.get("opacity")}getSourceState(){return L()}getVisible(){return this.get("visible")}getZIndex(){return this.get("zIndex")}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set("extent",t)}setMaxResolution(t){this.set("maxResolution",t)}setMinResolution(t){this.set("minResolution",t)}setMaxZoom(t){this.set("maxZoom",t)}setMinZoom(t){this.set("minZoom",t)}setOpacity(t){st("number"==typeof t,"Layer opacity must be a number"),this.set("opacity",t)}setVisible(t){this.set("visible",t)}setZIndex(t){this.set("zIndex",t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}};class Le extends Pe{constructor(t,e){super(t),this.layer=e}}class Xr extends Ml{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let n=t.layers;super(e),this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener("layers",this.handleLayersChanged_),n?Array.isArray(n)?n=new Bt(n.slice(),{unique:!0}):st("function"==typeof n.getArray,"Expected `layers` to be an array or a `Collection`"):n=new Bt(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(et),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(K(t,"add",this.handleLayersAdd_,this),K(t,"remove",this.handleLayersRemove_,this));for(const n in this.listenerKeys_)this.listenerKeys_[n].forEach(et);zn(this.listenerKeys_);const e=t.getArray();for(let n=0,s=e.length;n<s;n++){const r=e[n];this.registerLayerListeners_(r),this.dispatchEvent(new Le("addlayer",r))}this.changed()}registerLayerListeners_(t){const e=[K(t,"propertychange",this.handleLayerChange_,this),K(t,"change",this.handleLayerChange_,this)];t instanceof Xr&&e.push(K(t,"addlayer",this.handleLayerGroupAdd_,this),K(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[at(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new Le("addlayer",t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new Le("removelayer",t.layer))}handleLayersAdd_(t){const e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new Le("addlayer",e)),this.changed()}handleLayersRemove_(t){const e=t.element,n=at(e);this.listenerKeys_[n].forEach(et),delete this.listenerKeys_[n],this.dispatchEvent(new Le("removelayer",e)),this.changed()}getLayers(){return this.get("layers")}setLayers(t){const e=this.getLayers();if(e){const n=e.getArray();for(let s=0,r=n.length;s<r;++s)this.dispatchEvent(new Le("removelayer",n[s]))}this.set("layers",t)}getLayersArray(t){return t=void 0!==t?t:[],this.getLayers().forEach(function(e){e.getLayersArray(t)}),t}getLayerStatesArray(t){const e=void 0!==t?t:[],n=e.length;this.getLayers().forEach(function(o){o.getLayerStatesArray(e)});const s=this.getLayerState();let r=s.zIndex;!t&&void 0===s.zIndex&&(r=0);for(let o=n,l=e.length;o<l;o++){const c=e[o];c.opacity*=s.opacity,c.visible=c.visible&&s.visible,c.maxResolution=Math.min(c.maxResolution,s.maxResolution),c.minResolution=Math.max(c.minResolution,s.minResolution),c.minZoom=Math.max(c.minZoom,s.minZoom),c.maxZoom=Math.min(c.maxZoom,s.maxZoom),void 0!==s.extent&&(c.extent=void 0!==c.extent?wa(c.extent,s.extent):s.extent),void 0===c.zIndex&&(c.zIndex=r)}return e}getSourceState(){return"ready"}}const os=Xr;function Yr(i,t){if(!i.visible)return!1;const e=t.resolution;if(e<i.minResolution||e>=i.maxResolution)return!1;const n=t.zoom;return n>i.minZoom&&n<=i.maxZoom}const Ur=class yg extends Ml{constructor(t){const e=Object.assign({},t);delete e.source,super(e),this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener("source",this.handleSourcePropertyChange_),this.setSource(t.source?t.source:null)}
vendor: 13,702 bytes, line 1
1getLayersArray(t){return(t=t||[]).push(this),t}getLayerStatesArray(t){return(t=t||[]).push(this.getLayerState()),t}getSource(){return this.get("source")||null}getRenderSource(){return this.getSource()}getSourceState(){const t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),!this.sourceReady_&&"ready"===this.getSource().getState()&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(et(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=K(t,"change",this.handleSourceChange_,this),"ready"===t.getState()&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null}isVisible(t){let e;const n=this.getMapInternal();let s;if(!t&&n&&(t=n.getView()),e=t instanceof ne?{viewState:t.getState(),extent:t.calculateExtent()}:t,!e.layerStatesArray&&n&&(e.layerStatesArray=n.getLayerGroup().getLayerStatesArray()),e.layerStatesArray){if(s=e.layerStatesArray.find(o=>o.layer===this),!s)return!1}else s=this.getLayerState();const r=this.getExtent();return Yr(s,e.viewState)&&(!r||Gt(r,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];const e=this.getSource()?.getAttributions();if(!e)return[];let s=e(t instanceof ne?t.getViewStateAndExtent():t);return Array.isArray(s)||(s=[s]),s}render(t,e){const n=this.getRenderer();return n.prepareFrame(t)?(this.rendered=!0,n.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set("map",t)}getMapInternal(){return this.get("map")}setMap(t){this.mapPrecomposeKey_&&(et(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(et(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=K(t,"precompose",this.handlePrecompose_,this),this.mapRenderKey_=K(this,"change",t.render,t),this.changed())}handlePrecompose_(t){const e=t.frameState.layerStatesArray,n=this.getLayerState(!1);st(!e.some(s=>s.layer===n.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(n)}setSource(t){this.set("source",t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}clearRenderer(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_)}disposeInternal(){this.clearRenderer(),this.setSource(null),super.disposeInternal()}};function Il(i,t,e=0,n=i.length-1,s=Cg){for(;n>e;){if(n-e>600){const c=n-e+1,h=t-e+1,d=Math.log(c),u=.5*Math.exp(2*d/3),f=.5*Math.sqrt(d*u*(c-u)/c)*(h-c/2<0?-1:1);Il(i,t,Math.max(e,Math.floor(t-h*u/c+f)),Math.min(n,Math.floor(t+(c-h)*u/c+f)),s)}const r=i[t];let o=e,l=n;for(li(i,e,t),s(i[n],r)>0&&li(i,e,n);o<l;){for(li(i,o,l),o++,l--;s(i[o],r)<0;)o++;for(;s(i[l],r)>0;)l--}0===s(i[e],r)?li(i,e,l):(l++,li(i,l,n)),l<=t&&(e=l+1),t<=l&&(n=l-1)}}function li(i,t,e){const n=i[t];i[t]=i[e],i[e]=n}function Cg(i,t){return i<t?-1:i>t?1:0}class Ol{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!ls(t,e))return n;const s=this.toBBox,r=[];for(;e;){for(let o=0;o<e.children.length;o++){const l=e.children[o],c=e.leaf?s(l):l;ls(t,c)&&(e.leaf?n.push(l):$r(t,c)?this._all(l,n):r.push(l))}e=r.pop()}return n}collides(t){let e=this.data;if(!ls(t,e))return!1;const n=[];for(;e;){for(let s=0;s<e.children.length;s++){const r=e.children[s],o=e.leaf?this.toBBox(r):r;if(ls(t,o)){if(e.leaf||$r(t,o))return!0;n.push(r)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let n=0;n<t.length;n++)this.insert(t[n]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const n=this.data;this.data=e,e=n}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=Fn([]),this}remove(t,e){if(!t)return this;let n=this.data;const s=this.toBBox(t),r=[],o=[];let l,c,h;for(;n||r.length;){if(n||(n=r.pop(),c=r[r.length-1],l=o.pop(),h=!0),n.leaf){const d=bg(t,n.children,e);if(-1!==d)return n.children.splice(d,1),r.push(n),this._condense(r),this}h||n.leaf||!$r(n,s)?c?(l++,n=c.children[l],h=!1):n=null:(r.push(n),o.push(l),l=0,c=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,s){const r=n-e+1;let l,o=this._maxEntries;if(r<=o)return l=Fn(t.slice(e,n+1)),Rn(l,this.toBBox),l;s||(s=Math.ceil(Math.log(r)/Math.log(o)),o=Math.ceil(r/Math.pow(o,s-1))),l=Fn([]),l.leaf=!1,l.height=s;const c=Math.ceil(r/o),h=c*Math.ceil(Math.sqrt(o));Pl(t,e,n,h,this.compareMinX);for(let d=e;d<=n;d+=h){const u=Math.min(d+h-1,n);Pl(t,d,u,c,this.compareMinY);for(let f=d;f<=u;f+=c){const g=Math.min(f+c-1,u);l.children.push(this._build(t,f,g,s-1))}}return Rn(l,this.toBBox),l}_chooseSubtree(t,e,n,s){for(;s.push(e),!e.leaf&&s.length-1!==n;){let l,r=1/0,o=1/0;for(let c=0;c<e.children.length;c++){const h=e.children[c],d=Hr(h),u=wg(t,h)-d;u<o?(o=u,r=d<r?d:r,l=h):u===o&&d<r&&(r=d,l=h)}e=l||e.children[0]}return e}_insert(t,e,n){const s=n?t:this.toBBox(t),r=[],o=this._chooseSubtree(s,this.data,e,r);for(o.children.push(t),hi(o,s);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)}_split(t,e){const n=t[e],s=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,s);const o=this._chooseSplitIndex(n,r,s),l=Fn(n.children.splice(o,n.children.length-o));l.height=n.height,l.leaf=n.leaf,Rn(n,this.toBBox),Rn(l,this.toBBox),e?t[e-1].children.push(l):this._splitRoot(n,l)}_splitRoot(t,e){this.data=Fn([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Rn(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let s,r=1/0,o=1/0;for(let l=e;l<=n-e;l++){const c=ci(t,0,l,this.toBBox),h=ci(t,l,n,this.toBBox),d=vg(c,h),u=Hr(c)+Hr(h);d<r?(r=d,s=l,o=u<o?u:o):d===r&&u<o&&(o=u,s=l)}return s||n-e}_chooseSplitAxis(t,e,n){const s=t.leaf?this.compareMinX:Sg,r=t.leaf?this.compareMinY:Eg;this._allDistMargin(t,e,n,s)<this._allDistMargin(t,e,n,r)&&t.children.sort(s)}_allDistMargin(t,e,n,s){t.children.sort(s);const r=this.toBBox,o=ci(t,0,e,r),l=ci(t,n-e,n,r);let c=as(o)+as(l);for(let h=e;h<n-e;h++){const d=t.children[h];hi(o,t.leaf?r(d):d),c+=as(o)}for(let h=n-e-1;h>=e;h--){const d=t.children[h];hi(l,t.leaf?r(d):d),c+=as(l)}return c}_adjustParentBBoxes(t,e,n){for(let s=n;s>=0;s--)hi(e[s],t)}_condense(t){for(let n,e=t.length-1;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():Rn(t[e],this.toBBox)}}function bg(i,t,e){if(!e)return t.indexOf(i);for(let n=0;n<t.length;n++)if(e(i,t[n]))return n;return-1}function Rn(i,t){ci(i,0,i.children.length,t,i)}function ci(i,t,e,n,s){s||(s=Fn(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let r=t;r<e;r++){const o=i.children[r];hi(s,i.leaf?n(o):o)}return s}function hi(i,t){return i.minX=Math.min(i.minX,t.minX),i.minY=Math.min(i.minY,t.minY),i.maxX=Math.max(i.maxX,t.maxX),i.maxY=Math.max(i.maxY,t.maxY),i}function Sg(i,t){return i.minX-t.minX}function Eg(i,t){return i.minY-t.minY}function Hr(i){return(i.maxX-i.minX)*(i.maxY-i.minY)}function as(i){return i.maxX-i.minX+(i.maxY-i.minY)}function wg(i,t){return(Math.max(t.maxX,i.maxX)-Math.min(t.minX,i.minX))*(Math.max(t.maxY,i.maxY)-Math.min(t.minY,i.minY))}function vg(i,t){const e=Math.max(i.minX,t.minX),n=Math.max(i.minY,t.minY),s=Math.min(i.maxX,t.maxX),r=Math.min(i.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,r-n)}function $r(i,t){return i.minX<=t.minX&&i.minY<=t.minY&&t.maxX<=i.maxX&&t.maxY<=i.maxY}function ls(i,t){return t.minX<=i.maxX&&t.minY<=i.maxY&&t.maxX>=i.minX&&t.maxY>=i.minY}function Fn(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Pl(i,t,e,n,s){const r=[t,e];for(;r.length;){if((e=r.pop())-(t=r.pop())<=n)continue;const o=t+Math.ceil((e-t)/n/2)*n;Il(i,o,t,e,s),r.push(t,o,o,e)}}const Zr=[NaN,NaN,NaN,0];let Jr;const Mg=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Ig=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Og=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Pg=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function cs(i,t){return i.endsWith("%")?Number(i.substring(0,i.length-1))/t:Number(i)}function di(i){throw new Error('failed to parse "'+i+'" as color')}function Rl(i){if(i.toLowerCase().startsWith("rgb")){const r=i.match(Ig)||i.match(Mg)||i.match(Og);if(r){const o=r[4],l=100/255;return[lt(cs(r[1],l)+.5|0,0,255),lt(cs(r[2],l)+.5|0,0,255),lt(cs(r[3],l)+.5|0,0,255),void 0!==o?lt(cs(o,100),0,1):1]}di(i)}if(i.startsWith("#")){if(Pg.test(i)){const r=i.substring(1),o=r.length<=4?1:2,l=[0,0,0,255];for(let c=0,h=r.length;c<h;c+=o){let d=parseInt(r.substring(c,c+o),16);1===o&&(d+=d<<4),l[c/o]=d}return l[3]=l[3]/255,l}di(i)}const t=function xg(){return Jr||(Jr=St(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),Jr}();t.fillStyle="#abcdef";let e=t.fillStyle;t.fillStyle=i,t.fillStyle===e&&(t.fillStyle="#fedcba",e=t.fillStyle,t.fillStyle=i,t.fillStyle===e&&di(i));const n=t.fillStyle;if(n.startsWith("#")||n.startsWith("rgba"))return Rl(n);t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);const s=Array.from(t.getImageData(0,0,1,1).data);return s[3]=Hn(s[3]/255,3),s}const ui={};let qr=0;function Ag(i){if(4===i.length)return i;const t=i.slice();return t[3]=1,t}function Qr(i){return i>.0031308?269.025*Math.pow(i,1/2.4)-14.025:3294.6*i}function to(i){return i>.2068965?Math.pow(i,3):108/841*(i-4/29)}function eo(i){return i>10.314724?Math.pow((i+14.025)/269.025,2.4):i/3294.6}function no(i){return i>.0088564?Math.pow(i,1/3):i/(108/841)+4/29}function Fl(i){const t=eo(i[0]),e=eo(i[1]),n=eo(i[2]),s=no(.222488403*t+.716873169*e+.06060791*n),r=500*(no(.452247074*t+.399439023*e+.148375274*n)-s),o=200*(s-no(.016863605*t+.117638439*e+.865350722*n)),l=Math.atan2(o,r)*(180/Math.PI);return[116*s-16,Math.sqrt(r*r+o*o),l<0?l+360:l,i[3]]}function hs(i){if("none"===i)return Zr;if(ui.hasOwnProperty(i))return ui[i];if(qr>=1024){let e=0;for(const n in ui)!(3&e++)&&(delete ui[n],--qr)}const t=Rl(i);4!==t.length&&di(i);for(const e of t)isNaN(e)&&di(i);return ui[i]=t,++qr,t}function dn(i){return Array.isArray(i)?i:hs(i)}function io(i){let t=i[0];t!=(0|t)&&(t=t+.5|0);let e=i[1];e!=(0|e)&&(e=e+.5|0);let n=i[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+t+","+e+","+n+","+(void 0===i[3]?1:Math.round(1e3*i[3])/1e3)+")"}function Al(i){return i[0]>0&&i[1]>0}function An(i,t){return Array.isArray(i)?i:(void 0===t?t=[i,i]:(t[0]=i,t[1]=i),t)}let un=0;const It=1<<un++,W=1<<un++,Ot=1<<un++,jt=1<<un++,Ne=1<<un++,fn=1<<un++,us=Math.pow(2,6)-1,so={[It]:"boolean",[W]:"number",[Ot]:"string",[jt]:"color",[Ne]:"number[]",[fn]:"size"},kg=Object.keys(so).map(Number).sort(Ie);function ye(i){const t=[];for(const e of kg)fi(i,e)&&t.push(so[e]);return 0===t.length?"untyped":t.length<3?t.join(" or "):t.slice(0,-1).join(", ")+", or "+t[t.length-1]}function fi(i,t){return(i&t)===t}function fs(i,t){return!!(i&t)}function Ge(i,t){return i===t}class ut{constructor(t,e){if(!function Dg(i){return i in so}(t))throw new Error(`literal expressions must have a specific type, got ${ye(t)}`);this.type=t,this.value=e}}class Tl{constructor(t,e,...n){this.type=t,this.operator=e,this.args=n}}function ro(i){return{variables:new Map,properties:new Map,featureId:!1,geometryType:!1,mCoordinate:!1,mapState:!1,inputVariables:i}}function ct(i,t,e){switch(typeof i){case"boolean":if(Ge(t,Ot))return new ut(Ot,i?"true":"false");if(!fi(t,It))throw new Error(`got a boolean, but expected ${ye(t)}`);return new ut(It,i);case"number":if(Ge(t,fn))return new ut(fn,An(i));if(Ge(t,It))return new ut(It,!!i);if(Ge(t,Ot))return new ut(Ot,i.toString());if(!fi(t,W))throw new Error(`got a number, but expected ${ye(t)}`);return new ut(W,i);case"string":if(Ge(t,jt))return new ut(jt,hs(i));if(Ge(t,It))return new ut(It,!!i);if(!fi(t,Ot))throw new Error(`got a string, but expected ${ye(t)}`);return new ut(Ot,i)}if(!Array.isArray(i))throw new Error("expression must be an array or a primitive value");if(0===i.length)throw new Error("empty expression");if("string"==typeof i[0])return function Ug(i,t,e){const n=i[0],s=Lg[n];if(!s)throw new Error(`unknown operator: ${n}`);return s(i,t,e)}(i,t,e);for(const n of i)if("number"!=typeof n)throw new Error("expected an array of numbers");if(Ge(t,fn)){if(2!==i.length)throw new Error(`expected an array of two values for a size, got ${i.length}`);return new ut(fn,i)}if(Ge(t,jt)){if(3===i.length)return new ut(jt,[...i,1]);if(4===i.length)return new ut(jt,i);throw new Error(`expected an array of 3 or 4 values for a color, got ${i.length}`)}if(!fi(t,Ne))throw new Error(`got an array of numbers, but expected ${ye(t)}`);return new ut(Ne,i)}const S_Get="get",S_Var="var",S_Concat="concat",S_GeometryType="geometry-type",S_LineMetric="line-metric",S_Any="any",S_All="all",S_Not="!",S_Resolution="resolution",S_Zoom="zoom",S_Time="time",
1S_Equal="==",S_NotEqual="!=",S_GreaterThan=">",S_GreaterThanOrEqualTo=">=",S_LessThan="<",S_LessThanOrEqualTo="<=",S_Multiply="*",S_Divide="/",S_Add="+",S_Subtract="-",S_Clamp="clamp",S_Mod="%",S_Pow="^",S_Abs="abs",S_Floor="floor",S_Ceil="ceil",S_Round="round",S_Sin="sin",S_Cos="cos",S_Atan="atan",S_Sqrt="sqrt",S_Match="match",S_Between="between",S_Interpolate="interpolate",S_Coalesce="coalesce",S_Case="case",S_In="in",S_Number="number",S_String="string",S_Array="array",S_Color="color",S_Id="id",S_Band="band",S_Palette="palette",S_ToString="to-string",S_Has="has",Lg={[S_Get]:D(j(1,1/0),kl),[S_Var]:function Ng(){return function(i,t,e){const n=i[1];if("string"!=typeof n)throw new Error("expected a string argument for var operation");let s=t;const r=e.inputVariables?.[n];if(void 0!==r){const o=ct(r,us,e);if(!(o instanceof ut))throw new Error(`style variables should only be literal values (no expressions!), variable name: ${n}`);let l=o.type;if("string"==typeof r&&fs(s,jt)&&!fs(s,Ot)?l=jt:Array.isArray(r)&&2===r.length&&fs(s,fn)&&!fs(s,Ne)&&(l=fn),s&=l,0===s)throw new Error(`the type expected from the var operator (${ye(t)}) did not have any overlap with the type of the corresponding style variables (${ye(l)}), variable name: ${n}`)}if(e.variables.has(n)){const o=e.variables.get(n);if(s&=o,0===s)throw new Error(`a new type expected from the var operator (${ye(t)}) did not have any overlap with the previous type expected for it (${ye(o)}), variable name: ${n}`)}return e.variables.set(n,s),new Tl(s,"var",new ut(Ot,n))}}(),[S_Has]:D(j(1,1/0),kl),[S_Id]:D(function Gg(i,t,e){e.featureId=!0},Tn),[S_Concat]:D(j(2,1/0),J(Ot)),[S_GeometryType]:D(function jg(i,t,e){e.geometryType=!0},Tn),[S_LineMetric]:D(function Bg(i,t,e){e.mCoordinate=!0},Tn),[S_Resolution]:D(oo,Tn),[S_Zoom]:D(oo,Tn),[S_Time]:D(oo,Tn),[S_Any]:D(j(2,1/0),J(It)),[S_All]:D(j(2,1/0),J(It)),[S_Not]:D(j(1,1),J(It)),[S_Equal]:D(j(2,2),Ll()),[S_NotEqual]:D(j(2,2),Ll()),[S_GreaterThan]:D(j(2,2),J(W)),[S_GreaterThanOrEqualTo]:D(j(2,2),J(W)),[S_LessThan]:D(j(2,2),J(W)),[S_LessThanOrEqualTo]:D(j(2,2),J(W)),[S_Multiply]:D(j(2,1/0),Dl),[S_Coalesce]:D(j(2,1/0),Dl),[S_Divide]:D(j(2,2),J(W)),[S_Add]:D(j(2,1/0),J(W)),[S_Subtract]:D(j(2,2),J(W)),[S_Clamp]:D(j(3,3),J(W)),[S_Mod]:D(j(2,2),J(W)),[S_Pow]:D(j(2,2),J(W)),[S_Abs]:D(j(1,1),J(W)),[S_Floor]:D(j(1,1),J(W)),[S_Ceil]:D(j(1,1),J(W)),[S_Round]:D(j(1,1),J(W)),[S_Sin]:D(j(1,1),J(W)),[S_Cos]:D(j(1,1),J(W)),[S_Atan]:D(j(1,2),J(W)),[S_Sqrt]:D(j(1,1),J(W)),[S_Match]:D(j(4,1/0),Nl,function Wg(i,t,e){const n=i.length-1,s=ct(i[i.length-1],t,e);let r=Ot|W|It;const o=new Array(n-2);for(let c=0;c<n-2;c+=2){try{r&=ct(i[c+2],r,e).type}catch(h){throw new Error(`failed to parse argument ${c+1} of match expression: ${h.message}`)}if(0===r)throw new Error("no common type was found among the arguments of match expression")}for(let c=0;c<n-2;c+=2){try{const h=ct(i[c+2],r,e);o[c]=h}catch(h){throw new Error(`failed to parse argument ${c+1} of match expression: ${h.message}`)}try{const h=ct(i[c+3],s.type,e);o[c+1]=h}catch(h){throw new Error(`failed to parse argument ${c+2} of match expression: ${h.message}`)}}return[ct(i[1],r,e),...o,s]}),[S_Between]:D(j(3,3),J(W)),[S_Interpolate]:D(j(6,1/0),Nl,function zg(i,t,e){const n=i[1];let s;switch(n[0]){case"linear":s=1;break;case"exponential":const c=n[1];if("number"!=typeof c||c<=0)throw new Error(`expected a number base for exponential interpolation, got ${JSON.stringify(c)} instead`);s=c;break;default:throw new Error(`invalid interpolation type: ${JSON.stringify(n)}`)}const r=new ut(W,s);let o;try{o=ct(i[2],W,e)}catch(c){throw new Error(`failed to parse argument 1 in interpolate expression: ${c.message}`)}const l=new Array(i.length-3);for(let c=0;c<l.length;c+=2){try{const h=ct(i[c+3],W,e);l[c]=h}catch(h){throw new Error(`failed to parse argument ${c+2} for interpolate expression: ${h.message}`)}try{const h=ct(i[c+4],t,e);l[c+1]=h}catch(h){throw new Error(`failed to parse argument ${c+3} for interpolate expression: ${h.message}`)}}return[r,o,...l]}),[S_Case]:D(j(3,1/0),function Vg(i,t,e){const s=i.length-1;if(s%2==0)throw new Error(`expected an odd number of arguments for ${i[0]}, got ${s} instead`)},function Kg(i,t,e){const n=ct(i[i.length-1],t,e),s=new Array(i.length-1);for(let r=0;r<s.length-1;r+=2){try{const o=ct(i[r+1],It,e);s[r]=o}catch(o){throw new Error(`failed to parse argument ${r} of case expression: ${o.message}`)}try{const o=ct(i[r+2],n.type,e);s[r+1]=o}catch(o){throw new Error(`failed to parse argument ${r+1} of case expression: ${o.message}`)}}return s[s.length-1]=n,s}),[S_In]:D(j(2,2),function Xg(i,t,e){let s,n=i[2];if(!Array.isArray(n))throw new Error('the second argument for the "in" operator must be an array');
1if("literal"===n[0]){if(n=n[1],!Array.isArray(n))throw new Error('failed to parse "in" expression: the literal operator must be followed by an array')}else if("string"==typeof n[0])throw new Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');s="string"==typeof n[0]?Ot:W;const r=new Array(n.length);for(let l=0;l<r.length;l++)try{const c=ct(n[l],s,e);r[l]=c}catch(c){throw new Error(`failed to parse haystack item ${l} for "in" expression: ${c.message}`)}return[ct(i[1],s,e),...r]}),[S_Number]:D(j(1,1/0),J(us)),[S_String]:D(j(1,1/0),J(us)),[S_Array]:D(j(1,1/0),J(W)),[S_Color]:D(j(1,4),J(W)),[S_Band]:D(j(1,3),J(W)),[S_Palette]:D(j(2,2),function Yg(i,t,e){let n;try{n=ct(i[1],W,e)}catch(o){throw new Error(`failed to parse first argument in palette expression: ${o.message}`)}const s=i[2];if(!Array.isArray(s))throw new Error("the second argument of palette must be an array");const r=new Array(s.length);for(let o=0;o<r.length;o++){let l;try{l=ct(s[o],jt,e)}catch(c){throw new Error(`failed to parse color at index ${o} in palette expression: ${c.message}`)}if(!(l instanceof ut))throw new Error(`the palette color at index ${o} must be a literal value`);r[o]=l}return[n,...r]}),[S_ToString]:D(j(1,1),J(It|W|Ot|jt))};function kl(i,t,e){const n=i.length-1,s=new Array(n);for(let r=0;r<n;++r){const o=i[r+1];switch(typeof o){case"number":s[r]=new ut(W,o);break;case"string":s[r]=new ut(Ot,o);break;default:throw new Error(`expected a string key or numeric array index for a get operation, got ${o}`)}0===r&&e.properties.set(String(o),t)}return s}function oo(i,t,e){e.mapState=!0}function Tn(i,t,e){if(1!==i.length)throw new Error(`expected no arguments for ${i[0]} operation`);return[]}function j(i,t){return function(e,n,s){const r=e[0],o=e.length-1;if(i===t){if(o!==i)throw new Error(`expected ${i} argument${1===i?"":"s"} for ${r}, got ${o}`)}else if(o<i||o>t)throw new Error(`expected ${t===1/0?`${i} or more`:`${i} to ${t}`} arguments for ${r}, got ${o}`)}}function Dl(i,t,e){const n=i.length-1,s=new Array(n);for(let r=0;r<n;++r){const o=ct(i[r+1],t,e);s[r]=o}return s}function J(i){return function(t,e,n){const s=t.length-1,r=new Array(s);for(let o=0;o<s;++o){const l=ct(t[o+1],i,n);r[o]=l}return r}}function Ll(){return function(i,t,e){const n=i[0],s=i.length-1,r=new Array(s);let o=us;for(let l=0;l<s;++l)o&=ct(i[l+1],o,e).type;if(0===o)throw new Error(`no common type was found among the arguments of ${n}`);for(let l=0;l<s;++l){const c=ct(i[l+1],o,e);r[l]=c}return r}}function Nl(i,t,e){const s=i.length-1;if(s%2==1)throw new Error(`expected an even number of arguments for operation ${i[0]}, got ${s} instead`)}function D(...i){return function(t,e,n){const s=t[0];let r;for(let o=0;o<i.length;o++){const l=i[o](t,e,n);if(o==i.length-1){if(!l)throw new Error("expected last argument validator to return the parsed args");r=l}}return new Tl(e,s,...r)}}function ao(i){if(!i)return"";const t=i.getType();switch(t){case"Point":case"LineString":case"Polygon":return t;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return t.substring(5);case"Circle":return"Polygon";
1case"GeometryCollection":return ao(i.getGeometries()[0]);default:return""}}function se(i,t,e){return te(ct(i,t,e),e)}function te(i,t){if(i instanceof ut){if(i.type===jt&&"string"==typeof i.value){const n=hs(i.value);return function(){return n}}return function(){return i.value}}const e=i.operator;switch(e){case"number":case"string":case"coalesce":return function Hg(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=te(i.args[r],t);switch(e){case"coalesce":return r=>{for(let o=0;o<n;++o){const l=s[o](r);if(typeof l<"u"&&null!==l)return l}throw new Error("Expected one of the values to be non-null")};case"number":case"string":return r=>{for(let o=0;o<n;++o){const l=s[o](r);if(typeof l===e)return l}throw new Error(`Expected one of the values to be a ${e}`)};default:throw new Error(`Unsupported assertion operator ${e}`)}}(i,t);case"get":case"var":case"has":return function $g(i){const n=i.args[0].value;switch(i.operator){case"get":return s=>{const r=i.args;let o=s.properties[n];for(let l=1,c=r.length;l<c;++l)o=o[r[l].value];return o};case"var":return s=>s.variables[n];case"has":return s=>{const r=i.args;if(!(n in s.properties))return!1;let o=s.properties[n];for(let l=1,c=r.length;l<c;++l){const d=r[l].value;if(!o||!Object.hasOwn(o,d))return!1;o=o[d]}return!0};default:throw new Error(`Unsupported accessor operator ${i.operator}`)}}(i);case"id":return n=>n.featureId;case"geometry-type":return n=>n.geometryType;case"concat":{const n=i.args.map(s=>te(s,t));return s=>"".concat(...n.map(r=>r(s).toString()))}case"resolution":return n=>n.resolution;case"any":case"all":case"between":case"in":case"!":return function Jg(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=te(i.args[r],t);switch(e){case"any":return r=>{for(let o=0;o<n;++o)if(s[o](r))return!0;return!1};case"all":return r=>{for(let o=0;o<n;++o)if(!s[o](r))return!1;return!0};case"between":return r=>{const o=s[0](r),l=s[1](r),c=s[2](r);return o>=l&&o<=c};case"in":return r=>{const o=s[0](r);for(let l=1;l<n;++l)if(o===s[l](r))return!0;return!1};case"!":return r=>!s[0](r);default:throw new Error(`Unsupported logical operator ${e}`)}}(i,t);case"==":case"!=":case"<":case"<=":case">":case">=":return function Zg(i,t){const e=i.operator,n=te(i.args[0],t),s=te(i.args[1],t);switch(e){case"==":return r=>n(r)===s(r);case"!=":return r=>n(r)!==s(r);case"<":return r=>n(r)<s(r);case"<=":return r=>n(r)<=s(r);case">":return r=>n(r)>s(r);case">=":return r=>n(r)>=s(r);default:throw new Error(`Unsupported comparison operator ${e}`)}}(i,t);case"*":case"/":case"+":case"-":case"clamp":case"%":case"^":case"abs":case"floor":case"ceil":case"round":case"sin":case"cos":case"atan":case"sqrt":return function qg(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=te(i.args[r],t);switch(e){case"*":return r=>{let o=1;for(let l=0;l<n;++l)o*=s[l](r);return o};case"/":return r=>s[0](r)/s[1](r);case"+":return r=>{let o=0;for(let l=0;l<n;++l)o+=s[l](r);return o};case"-":return r=>s[0](r)-s[1](r);case"clamp":return r=>{const o=s[0](r),l=s[1](r);if(o<l)return l;const c=s[2](r);return o>c?c:o};case"%":return r=>s[0](r)%s[1](r);case"^":return r=>Math.pow(s[0](r),s[1](r));case"abs":return r=>Math.abs(s[0](r));case"floor":return r=>Math.floor(s[0](r));case"ceil":return r=>Math.ceil(s[0](r));case"round":return r=>Math.round(s[0](r));case"sin":return r=>Math.sin(s[0](r));case"cos":return r=>Math.cos(s[0](r));case"atan":return 2===n?r=>Math.atan2(s[0](r),s[1](r)):r=>Math.atan(s[0](r));case"sqrt":return r=>Math.sqrt(s[0](r));default:throw new Error(`Unsupported numeric operator ${e}`)}}(i,t);case"case":return function Qg(i,t){const e=i.args.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=te(i.args[s],t);return s=>{for(let r=0;r<e-1;r+=2)if(n[r](s))return n[r+1](s);return n[e-1](s)}}(i,t);case"match":return function tm(i,t){const e=i.args.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=te(i.args[s],t);return s=>{const r=n[0](s);for(let o=1;o<e-1;o+=2)if(r===n[o](s))return n[o+1](s);return n[e-1](s)}}(i,t);case"interpolate":return function em(i,t){const e=i.args.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=te(i.args[s],t);return s=>{const r=n[0](s),o=n[1](s);let l,c;for(let h=2;h<e;h+=2){const d=n[h](s);let u=n[h+1](s);const f=Array.isArray(u);if(f&&(u=Ag(u)),d>=o)return 2===h?u:f?im(r,o,l,c,d,u):gi(r,o,l,c,d,u);l=d,c=u}return c}}(i,t);case"to-string":return function nm(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=te(i.args[r],t);if("to-string"===e)return r=>{const o=s[0](r);return i.args[0].type===jt?io(o):o.toString()};throw new Error(`Unsupported convert operator ${e}`)}(i,t);default:throw new Error(`Unsupported operator ${e}`)}}function gi(i,t,e,n,s,r){const o=s-e;if(0===o)return n;const l=t-e;return n+(1===i?l/o:(Math.pow(i,l)-1)/(Math.pow(i,o)-1))*(r-n)}function im(i,t,e,n,s,r){if(s-e===0)return n;const l=Fl(n),c=Fl(r);let h=c[2]-l[2];return h>180?h-=360:h<-180&&(h+=360),function Tg(i){const t=(i[0]+16)/116,e=i[1],n=i[2]*Math.PI/180,s=to(t),r=to(t+e/500*Math.cos(n)),o=to(t-e/200*Math.sin(n)),l=Qr(3.021973625*r-1.617392459*s-.404875592*o),c=Qr(-.943766287*r+1.916279586*s+.027607165*o),h=Qr(.069407491*r-.22898585*s+1.159737864*o);return[lt(l+.5|0,0,255),lt(c+.5|0,0,255),lt(h+.5|0,0,255),i[3]]}([gi(i,t,e,l[0],s,c[0]),gi(i,t,e,l[1],s,c[1]),l[2]+gi(i,t,e,0,s,h),gi(i,t,e,n[3],s,r[3])])}function lo(i,t){return i+":"+(t?dn(t):"null")}
1const Kt=new class am{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_)!(3&t++)&&!this.cache_[e].hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}get(t,e){const n=lo(t,e);return n in this.cache_?this.cache_[n]:null}getPattern(t,e){const n=lo(t,e);return n in this.patternCache_?this.patternCache_[n]:null}set(t,e,n,s){const r=lo(t,e),o=r in this.cache_;this.cache_[r]=n,s&&(0===n.getImageState()&&n.load(),1===n.getImageState()?n.ready().then(()=>{this.patternCache_[r]=Gr().createPattern(n.getImage(1),"repeat")}):this.patternCache_[r]=Gr().createPattern(n.getImage(1),"repeat")),o||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}};let mi=null;class zl extends Di{constructor(t,e,n,s,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=n?.crossOrigin,this.referrerPolicy_=n?.referrerPolicy,this.canvas_={},this.color_=r,this.imageState_=void 0===s?0:s,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.ready_=null}initializeImage_(){this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_),void 0!==this.referrerPolicy_&&(this.image_.referrerPolicy=this.referrerPolicy_)}isTainted_(){if(void 0===this.tainted_&&2===this.imageState_){mi||(mi=St(1,1,void 0,{willReadFrequently:!0})),mi.drawImage(this.image_,0,0);try{mi.getImageData(0,0,1,1),this.tainted_=!1}catch{mi=null,this.tainted_=!0}}return!0===this.tainted_}dispatchChangeEvent_(){this.dispatchEvent("change")}handleImageError_(){this.imageState_=3,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=2,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}setImage(t){this.image_=t}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],n=St(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(0===this.imageState_){this.image_||this.initializeImage_(),this.imageState_=1;try{void 0!==this.src_&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&function Wl(i,t){return t&&(i.src=t),i.src&&pd?new Promise((e,n)=>i.decode().then(()=>e(i)).catch(s=>i.complete&&i.width?e(i):n(s))):function om(i,t){return new Promise((e,n)=>{function s(){o(),e(i)}function r(){o(),n(new Error("Image load error"))}function o(){i.removeEventListener("load",s),i.removeEventListener("error",r)}i.addEventListener("load",s),i.addEventListener("error",r),t&&(i.src=t)})}(i)}(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||2!==this.imageState_)return;const e=this.image_,n=St(Math.ceil(e.width*t),Math.ceil(e.height*t)),s=n.canvas;n.scale(t,t),n.drawImage(e,0,0),n.globalCompositeOperation="multiply",n.fillStyle=function Rg(i){return"string"==typeof i?i:io(i)}(this.color_),n.fillRect(0,0,s.width/t,s.height/t),n.globalCompositeOperation="destination-in",n.drawImage(e,0,0),this.canvas_[t]=s}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(2===this.imageState_||3===this.imageState_)t();else{const e=()=>{(2===this.imageState_||3===this.imageState_)&&(this.removeEventListener("change",e),t())};this.addEventListener("change",e)}})),this.ready_}}function pi(i,t,e,n,s,r){let o=void 0===t?void 0:Kt.get(t,s);return o||(o=new zl(i,i&&"src"in i?i.src||void 0:t,e,n,s),Kt.set(t,s,o,r)),r&&o&&!Kt.getPattern(t,s)&&Kt.set(t,s,o,r),o}const lm=zl;function re(i){return i?Array.isArray(i)?io(i):"object"==typeof i&&"src"in i?function cm(i){if(!i.offset||!i.size)return Kt.getPattern(i.src,i.color);const t=i.src+":"+i.offset,e=Kt.getPattern(t,i.color);if(e)return e;const n=Kt.get(i.src,null);if(2!==n.getImageState())return null;const s=St(i.size[0],i.size[1]);return s.drawImage(n.getImage(1),i.offset[0],i.offset[1],i.size[0],i.size[1],0,0,i.size[0],i.size[1]),pi(s.canvas,t,void 0,2,i.color,!0),Kt.getPattern(t,i.color)}(i):i:null}class co{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=An(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new co({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return L()}getImage(t){return L()}getHitDetectionImage(){return L()}getPixelRatio(t){return 1}getImageState(){return L()}getImageSize(){return L()}getOrigin(){return L()}getSize(){return L()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=An(t)}listenImageChange(t){L()}load(){L()}unlistenImageChange(t){L()}ready(){return Promise.resolve()}}const Kl=co;
1class ho extends Kl{constructor(t){super({opacity:1,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,rotation:void 0!==t.rotation?t.rotation:0,scale:void 0!==t.scale?t.scale:1,displacement:void 0!==t.displacement?t.displacement:[0,0],declutterMode:t.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius=t.radius,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.imageState_=this.fill_&&this.fill_.loading()?1:2,1===this.imageState_&&this.ready().then(()=>this.imageState_=2),this.render()}clone(){const t=this.getScale(),e=new ho({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),n=this.getScaleArray();return[t[0]/2-e[0]/n[0],t[1]/2+e[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){const e=this.fill_?.getKey(),n=`${t},${this.angle_},${this.radius},${this.radius2_},${this.points_},${e}`+Object.values(this.renderOptions_).join(",");let s=Kt.get(n,null)?.getImage(1);if(!s){const r=this.renderOptions_,o=Math.ceil(r.size*t),l=St(o,o);this.draw_(r,l,t),s=l.canvas;const c=new lm(s,void 0,null,2,null);Kt.set(n,null,c),createImageBitmap(s).then(h=>{c.setImage(h)})}return s}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}setRadius(t){this.radius!==t&&(this.radius=t,this.render())}getRadius2(){return this.radius2_}setRadius2(t){this.radius2_!==t&&(this.radius2_=t,this.render())}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,n){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;let s=this.radius,r=void 0===this.radius2_?s:this.radius2_;if(s<r){const v=s;s=r,r=v}const l=2*Math.PI/(void 0===this.radius2_?this.points_:2*this.points_),c=r*Math.sin(l),d=s-Math.sqrt(r*r-c*c),u=Math.sqrt(c*c+d*d),f=u/c;if("miter"===t&&f<=n)return f*e;const g=e/2/f,m=e/2*(d/u),_=Math.sqrt((s+g)*(s+g)+m*m)-s;if(void 0===this.radius2_||"bevel"===t)return 2*_;const y=s*Math.sin(l),E=r-Math.sqrt(s*s-y*y),w=Math.sqrt(y*y+E*E)/y;return w<=n?2*Math.max(_,w*e/2-r-s):2*_}createRenderOptions(){let o,t="round",e="round",n=0,s=null,r=0,l=0;this.stroke_&&(o=re(this.stroke_.getColor()??"#000"),l=this.stroke_.getWidth()??1,s=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset()??0,e=this.stroke_.getLineJoin()??"round",t=this.stroke_.getLineCap()??"round",n=this.stroke_.getMiterLimit()??10);const c=this.calculateLineJoinSize_(e,l,n),h=Math.max(this.radius,this.radius2_||0);return{strokeStyle:o,strokeWidth:l,size:Math.ceil(2*h+c),lineCap:t,lineDash:s,lineDashOffset:r,lineJoin:e,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[t,t]}draw_(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let s=this.fill_.getColor();null===s&&(s="#000"),e.fillStyle=re(s),e.fill()}t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}createHitDetectionCanvas_(t){let e;if(this.fill_){let n=this.fill_.getColor(),s=0;"string"==typeof n&&(n=dn(n)),null===n?s=1:Array.isArray(n)&&(s=4===n.length?n[3]:1),0===s&&(e=St(t.size,t.size),this.drawHitDetectionCanvas_(t,e))}return e?e.canvas:this.getImage(1)}createPath_(t){let e=this.points_;const n=this.radius;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{const s=void 0===this.radius2_?n:this.radius2_;void 0!==this.radius2_&&(e*=2);const r=this.angle_-Math.PI/2,o=2*Math.PI/e;for(let l=0;l<e;l++){const c=r+l*o,h=l%2==0?n:s;t.lineTo(h*Math.cos(c),h*Math.sin(c))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle="#000",e.fill(),t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}const Xl=ho;class uo extends Xl{constructor(t){super({points:1/0,fill:(t=t||{radius:5}).fill,radius:t.radius,stroke:t.stroke,scale:void 0!==t.scale?t.scale:1,rotation:void 0!==t.rotation?t.rotation:0,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,displacement:void 0!==t.displacement?t.dis
1placement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale(),e=new uo({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}}const Yl=uo;class fo{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,void 0!==t.color&&this.setColor(t.color)}clone(){const t=this.getColor();return new fo({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(null!==t&&"object"==typeof t&&"src"in t){const e=pi(null,t.src,{crossOrigin:"anonymous"},void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then(()=>{this.patternImage_=null}),0===e.getImageState()&&e.load(),1===e.getImageState()&&(this.patternImage_=e)}this.color_=t}getKey(){const t=this.getColor();return t?t instanceof CanvasPattern||t instanceof CanvasGradient?at(t):"object"==typeof t&&"src"in t?t.src+":"+t.offset:dn(t).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}const kn=fo;function Ul(i,t,e,n){return void 0!==e&&void 0!==n?[e/i,n/t]:void 0!==e?e/i:void 0!==n?n/t:1}class go extends Kl{constructor(t){super({opacity:void 0!==(t=t||{}).opacity?t.opacity:1,rotation:void 0!==t.rotation?t.rotation:0,scale:void 0!==t.scale?t.scale:1,displacement:void 0!==t.displacement?t.displacement:[0,0],rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,declutterMode:t.declutterMode}),this.anchor_=void 0!==t.anchor?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==t.anchorOrigin?t.anchorOrigin:"top-left",this.anchorXUnits_=void 0!==t.anchorXUnits?t.anchorXUnits:"fraction",this.anchorYUnits_=void 0!==t.anchorYUnits?t.anchorYUnits:"fraction",this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null,this.referrerPolicy_=t.referrerPolicy;const o=void 0!==t.img?t.img:null;let c,l=t.src;if(st(!(void 0!==l&&o),"`image` and `src` cannot be provided at the same time"),(void 0===l||0===l.length)&&o&&(l=o.src||at(o)),st(void 0!==l&&l.length>0,"A defined and non-empty `src` or `image` must be provided"),st(!((void 0!==t.width||void 0!==t.height)&&void 0!==t.scale),"`width` or `height` cannot be provided together with `scale`"),void 0!==t.src?c=0:void 0!==o&&(c="complete"in o?o.complete?o.src?2:0:1:2),this.color_=void 0!==t.color?dn(t.color):null,this.iconImage_=pi(o,l,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},c,this.color_),this.offset_=void 0!==t.offset?t.offset:[0,0],this.offsetOrigin_=void 0!==t.offsetOrigin?t.offsetOrigin:"top-left",this.origin_=null,this.size_=void 0!==t.size?t.size:null,void 0!==t.width||void 0!==t.height){let h,d;if(t.size)[h,d]=t.size;else{const u=this.getImage(1);if(u.width&&u.height)h=u.width,d=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=t;const f=()=>{if(this.unlistenImageChange(f),!this.initialOptions_)return;const g=this.iconImage_.getSize();this.setScale(Ul(g[0],g[1],t.width,t.height))};return void this.listenImageChange(f)}}void 0!==h&&this.setScale(Ul(h,d,t.width,t.height))}}clone(){let t,e,n;return this.initialOptions_?(e=this.initialOptions_.width,n=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new go({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:n,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const s=this.getSize();if("fraction"==this.anchorXUnits_||"fraction"==this.anchorYUnits_){if(!s)return null;t=this.anchor_.slice(),"fraction"==this.anchorXUnits_&&(t[0]*=s[0]),"fraction"==this.anchorYUnits_&&(t[1]*=s[1])}if("top-left"!=this.anchorOrigin_){if(!s)return null;t===this.anchor_&&(t=this.anchor_.slice()),("top-right"==this.anchorOrigin_||"bottom-right"==this.anchorOrigin_)&&(t[0]=-t[0]+s[0]),("bottom-left"==this.anchorOrigin_||"bottom-right"==this.anchorOrigin_)&&(t[1]=-t[1]+s[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),n=this.getScaleArray();return[t[0]-e[0]/n[0],t[1]+e[1]/n[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}setColor(t){const e=t?dn(t):null;if(this.color_===e||this.color_&&e&&this.color_.length===e.length&&this.color_.every((o,l)=>o===e[l]))return;this.color_=e;const n=this.getSrc(),s=void 0!==n?null:this.getHitDetectionImage(),r=void 0!==n?0:this.iconImage_.getImageState();this.iconImage_=pi(s,n,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},r,this.color_)}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if("top-left"!=this.offsetOrigin_){const e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),("top-right"==this.offsetOrigin_||"bottom-right"==this.offsetOrigin_)&&(t[0]=n[0]-e[0]-t[0]),("bottom-left"==this.offsetOrigin_||"bottom-right"==this.offsetOrigin_)&&(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}setSrc(t){this.iconImage_=pi(null,t,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},0,this.color_)}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();return this.size_?this.size_[0]*t[0]:2==this.iconImage_.getImageState()?this.iconImage_.getSize()[0]*t[0]:void 0}getHeight(){const t=this.getScaleArray();return this.size_?this.size_[1]*t[1]:2==this.iconImage_.getImageState()?this.iconImage_.getSize()[1]*t[1]:void 0}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener("change",t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener("change",t)}ready(){return this.iconImage_.ready()}}const Hl=go;class mo{constructor(t){this.color_=void 0!==(t=t||{}).color?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=void 0!==t.lineDash?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.offset_=t.offset,this.width_=t.width}clone(){const t=this.getColor();return new mo({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),offset:this.getOffset(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getOffset(){return this.offset_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setOffset(t){this.offset_=t}setWidth(t){this.width_=t}}const gs=mo;class je{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=Jl,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.hitDetectionRenderer_=void 0!==t.hitDetectionRenderer?t.hitDetectionRenderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new je({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.get
vendor: 4,256 bytes, line 1
1Stroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Jl,this.geometry_=t}setZIndex(t){this.zIndex_=t}}let _o=null;function Zl(i,t){if(!_o){const e=new kn({color:"rgba(255,255,255,0.4)"}),n=new gs({color:"#3399CC",width:1.25});_o=[new je({image:new Yl({fill:e,stroke:n,radius:5}),fill:e,stroke:n})]}return _o}function Jl(i){return i.getGeometry()}const gn=je;class yo{constructor(t){this.font_=(t=t||{}).font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.keepUpright_=t.keepUpright,this.scale_=t.scale,this.scaleArray_=An(void 0!==t.scale?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=void 0!==t.fill?t.fill:new kn({color:"#333"}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=void 0!==t.stroke?t.stroke:null,this.offsetX_=void 0!==t.offsetX?t.offsetX:0,this.offsetY_=void 0!==t.offsetY?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=void 0===t.padding?null:t.padding,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new yo({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()instanceof kn?this.getFill().clone():this.getFill(),stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getKeepUpright(){return this.keepUpright_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setKeepUpright(t){this.keepUpright_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=An(void 0!==t?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}
1setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}const fm=yo;function gm(i){return!0}function ql(i,t){t=t??ro();const e=i.length,n=new Array(e);for(let o=0;o<e;++o)n[o]=Co(i[o],t);const s={variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""},r=new Array(e);return function(o,l){if(s.properties=o.getPropertiesInternal(),s.resolution=l,t.featureId){const h=o.getId();s.featureId=void 0!==h?h:null}t.geometryType&&(s.geometryType=ao(o.getGeometry()));let c=0;for(let h=0;h<e;++h){const d=n[h](s);d&&(r[c]=d,c+=1)}return r.length=c,r}}function Co(i,t){const e=_i(i,"",t),n=yi(i,"",t),s=function ym(i,t){const e="text-",n=be(i,e+"value",t);if(!n)return null;const s=_i(i,e,t),r=_i(i,e+"background-",t),o=yi(i,e,t),l=yi(i,e+"background-",t),c=be(i,e+"font",t),h=_t(i,e+"max-angle",t),d=_t(i,e+"offset-x",t),u=_t(i,e+"offset-y",t),f=Dn(i,e+"overflow",t),g=be(i,e+"placement",t),m=_t(i,e+"repeat",t),p=_s(i,e+"scale",t),_=Dn(i,e+"rotate-with-view",t),y=_t(i,e+"rotation",t),b=be(i,e+"align",t),E=be(i,e+"justify",t),C=be(i,e+"baseline",t),w=Dn(i,e+"keep-upright",t),v=Ql(i,e+"padding",t),F=ys(i,e+"declutter-mode"),O=new fm({declutterMode:F});return function(x){if(O.setText(n(x)),s&&O.setFill(s(x)),r&&O.setBackgroundFill(r(x)),o&&O.setStroke(o(x)),l&&O.setBackgroundStroke(l(x)),c&&O.setFont(c(x)),h&&O.setMaxAngle(h(x)),d&&O.setOffsetX(d(x)),u&&O.setOffsetY(u(x)),f&&O.setOverflow(f(x)),g){const M=g(x);if("point"!==M&&"line"!==M)throw new Error("Expected point or line for text-placement");O.setPlacement(M)}if(m&&O.setRepeat(m(x)),p&&O.setScale(p(x)),_&&O.setRotateWithView(_(x)),y&&O.setRotation(y(x)),b){const M=b(x);if("left"!==M&&"center"!==M&&"right"!==M&&"end"!==M&&"start"!==M)throw new Error("Expected left, right, center, start, or end for text-align");O.setTextAlign(M)}if(E){const M=E(x);if("left"!==M&&"right"!==M&&"center"!==M)throw new Error("Expected left, right, or center for text-justify");O.setJustify(M)}if(C){const M=C(x);if("bottom"!==M&&"top"!==M&&"middle"!==M&&"alphabetic"!==M&&"hanging"!==M)throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");O.setTextBaseline(M)}return v&&O.setPadding(v(x)),w&&O.setKeepUpright(w(x)),O}}(i,t),r=function Cm(i,t){return"icon-src"in i?function bm(i,t){const e="icon-",n=e+"src",s=ic(i[n],n),r=ps(i,e+"anchor",t),o=_s(i,e+"scale",t),l=_t(i,e+"opacity",t),c=ps(i,e+"displacement",t),h=_t(i,e+"rotation",t),d=Dn(i,e+"rotate-with-view",t),u=ec(i,e+"anchor-origin"),f=nc(i,e+"anchor-x-units"),g=nc(i,e+"anchor-y-units"),m=Ce(i,e+"color");let p,_=null;void 0!==m&&(Array.isArray(m)&&m.length>0&&"string"==typeof m[0]?_=ms(i,e+"color",t):p=sc(m,e+"color"));const y=function xm(i,t){const e=i[t];if(void 0!==e){if("string"!=typeof e)throw new Error(`Expected a string for ${t}`);return e}}(i,e+"cross-origin"),b=function Mm(i,t){const e=i[t];if(void 0!==e)return Ci(e,t)}(i,e+"offset"),E=ec(i,e+"offset-origin"),C=bo(i,e+"width"),w=bo(i,e+"height"),v=function vm(i,t){const e=i[t];if(void 0!==e){if("number"==typeof e)return An(e);if(!Array.isArray(e))throw new Error(`Expected a number or size array for ${t}`);if(2!==e.length||"number"!=typeof e[0]||"number"!=typeof e[1])throw new Error(`Expected a number or size array for ${t}`);return e}}(i,e+"size"),O={src:s,anchorOrigin:u,anchorXUnits:f,anchorYUnits:g,crossOrigin:y,offset:b,offsetOrigin:E,height:w,width:C,size:v,declutterMode:ys(i,e+"declutter-mode")};let x=null;return function(M){if(x)_&&x.setColor(_(M));else{const z=_?_(M):p;x=new Hl(void 0!==z?Object.assign({},O,{color:z}):Object.assign({},O))}return l&&x.setOpacity(l(M)),c&&x.setDisplacement(c(M)),h&&x.setRotation(h(M)),d&&x.setRotateWithView(d(M)),o&&x.setScale(o(M)),r&&x.setAnchor(r(M)),x}}(i,t):"shape-points"in i?function Sm(i,t){const e="shape-",n=e+"points",s=e+"radius",r=So(i[n],n);if(!(s in i))throw new Error(`Expected a number for ${s}`);const o=_t(i,s,t),l="number"==typeof i[s]?i[s]:5,c=e+"radius2",h=_t(i,c,t),d="number"==typeof i[c]?i[c]:void 0,u=_i(i,e,t),f=yi(i,e,t),g=_s(i,e+"scale",t),m=ps(i,e+"displacement",t),p=_t(i,e+"rotation",t),_=Dn(i,e+"rotate-with-view",t),y=bo(i,e+"angle"),b=ys(i,e+"declutter-mode"),E=new Xl({points:r,radius:l,radiu
vendor: 4,448 bytes, line 1
1s2:d,angle:y,declutterMode:b});return function(C){return o&&E.setRadius(o(C)),h&&E.setRadius2(h(C)),u&&E.setFill(u(C)),f&&E.setStroke(f(C)),m&&E.setDisplacement(m(C)),p&&E.setRotation(p(C)),_&&E.setRotateWithView(_(C)),g&&E.setScale(g(C)),E}}(i,t):"circle-radius"in i?function Em(i,t){const e="circle-",n=_i(i,e,t),s=yi(i,e,t),r=_t(i,e+"radius",t),o=_s(i,e+"scale",t),l=ps(i,e+"displacement",t),c=_t(i,e+"rotation",t),h=Dn(i,e+"rotate-with-view",t),d=ys(i,e+"declutter-mode"),u=new Yl({radius:5,declutterMode:d});return function(f){return r&&u.setRadius(r(f)),n&&u.setFill(n(f)),s&&u.setStroke(s(f)),l&&u.setDisplacement(l(f)),c&&u.setRotation(c(f)),h&&u.setRotateWithView(h(f)),o&&u.setScale(o(f)),u}}(i,t):null}(i,t),o=_t(i,"z-index",t);if(!(e||n||s||r||Ze(i)))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(i));const l=new gn;return function(c){let h=!0;if(e){const d=e(c);d&&(h=!1),l.setFill(d)}if(n){const d=n(c);d&&(h=!1),l.setStroke(d)}if(s){const d=s(c);d&&(h=!1),l.setText(d)}if(r){const d=r(c);d&&(h=!1),l.setImage(d)}return o&&l.setZIndex(o(c)),h?null:l}}function _i(i,t,e){let n;if(t+"fill-pattern-src"in i)n=function wm(i,t,e){const n=be(i,t+"pattern-src",e),s=tc(i,t+"pattern-offset",e),r=tc(i,t+"pattern-size",e),o=ms(i,t+"color",e);return function(l){return{src:n(l),offset:s&&s(l),size:r&&r(l),color:o&&o(l)}}}(i,t+"fill-",e);else{if("none"===i[t+"fill-color"])return r=>null;n=ms(i,t+"fill-color",e)}if(!n)return null;const s=new kn;return function(r){const o=n(r);return o===Zr?null:(s.setColor(o),s)}}function yi(i,t,e){const n=_t(i,t+"stroke-width",e),s=ms(i,t+"stroke-color",e);if(!n&&!s)return null;const r=be(i,t+"stroke-line-cap",e),o=be(i,t+"stroke-line-join",e),l=Ql(i,t+"stroke-line-dash",e),c=_t(i,t+"stroke-line-dash-offset",e),h=_t(i,t+"stroke-miter-limit",e),d=_t(i,t+"stroke-offset",e),u=new gs;return function(f){if(s){const g=s(f);if(g===Zr)return null;u.setColor(g)}if(n&&u.setWidth(n(f)),r){const g=r(f);if("butt"!==g&&"round"!==g&&"square"!==g)throw new Error("Expected butt, round, or square line cap");u.setLineCap(g)}if(o){const g=o(f);if("bevel"!==g&&"round"!==g&&"miter"!==g)throw new Error("Expected bevel, round, or miter line join");u.setLineJoin(g)}return l&&u.setLineDash(l(f)),c&&u.setLineDashOffset(c(f)),h&&u.setMiterLimit(h(f)),d&&u.setOffset(d(f)),u}}function Ce(i,t){if(!(t in i))return;const e=i[t];return void 0===e?void 0:e}function _t(i,t,e){const n=Ce(i,t);if(void 0===n)return;const s=se(n,W,e);return function(r){return So(s(r),t)}}function be(i,t,e){const n=Ce(i,t);if(void 0===n)return null;const s=se(n,Ot,e);return function(r){return ic(s(r),t)}}function Dn(i,t,e){const n=Ce(i,t);if(void 0===n)return null;const s=se(n,It,e);return function(r){const o=s(r);if("boolean"!=typeof o)throw new Error(`Expected a boolean for ${t}`);return o}}function ms(i,t,e){const n=Ce(i,t);if(void 0===n)return null;const s=se(n,jt,e);return function(r){return sc(s(r),t)}}function Ql(i,t,e){const n=Ce(i,t);if(void 0===n)return null;if(Array.isArray(n)&&(0===n.length||"string"!=typeof n[0])){const r=n.map((o,l)=>{if("number"==typeof o)return()=>o;const c=se(o,W,e);return function(h){return So(c(h),`${t}[${l}]`)}});return function(o){const l=new Array(r.length);for(let c=0;c<r.length;++c)l[c]=r[c](o);return l}}const s=se(n,Ne,e);return function(r){return Ci(s(r),t)}}function ps(i,t,e){const n=Ce(i,t);if(void 0===n)return null;const s=se(n,Ne,e);return function(r){const o=Ci(s(r),t);if(2!==o.length)throw new Error(`Expected two numbers for ${t}`);return o}}function tc(i,t,e){const n=Ce(i,t);if(void 0===n)return null;const s=se(n,Ne,e);return function(r){return rc(s(r),t)}}function _s(i,t,e){const n=Ce(i,t);if(void 0===n)return null;const s=se(n,Ne|W,e);return function(r){return function Im(i,t){return"number"==typeof i?i:rc(i,t)}(s(r),t)}}function bo(i,t){const e=i[t];if(void 0!==e){if("number"!=typeof e)throw new Error(`Expected a number for ${t}`);return e}}function ec(i,t){const e=i[t];if(void 0!==e){if("bottom-left"!==e&&"bottom-right"!==e&&"top-left"!==e&&"top-right"!==e)throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return e}}function nc(i,t){const e=i[t];if(void 0!==e){if("pixels"!==e&&"fraction"!==e)throw new Error(`Expected pixels or fraction for ${t}`);return e}}function ys(i,t){const e=i[t];if(void 0!==e){if("string"!=typeof e)throw new Error(`Expected a string for ${t}`);
1if("declutter"!==e&&"obstacle"!==e&&"none"!==e)throw new Error(`Expected declutter, obstacle, or none for ${t}`);return e}}function Ci(i,t){if(!Array.isArray(i))throw new Error(`Expected an array for ${t}`);const e=i.length;for(let n=0;n<e;++n)if("number"!=typeof i[n])throw new Error(`Expected an array of numbers for ${t}`);return i}function ic(i,t){if("string"!=typeof i)throw new Error(`Expected a string for ${t}`);return i}function So(i,t){if("number"!=typeof i)throw new Error(`Expected a number for ${t}`);return i}function sc(i,t){if("string"==typeof i)return i;const e=Ci(i,t),n=e.length;if(n<3||n>4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function rc(i,t){const e=Ci(i,t);if(2!==e.length)throw new Error(`Expected an array of two numbers for ${t}`);return e}const ac=class Om extends Ur{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=void 0!==t.renderBuffer?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=void 0!==t.updateWhileAnimating&&t.updateWhileAnimating,this.updateWhileInteracting_=void 0!==t.updateWhileInteracting&&t.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get("renderOrder")}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const n=this.getDeclutter();n in t.declutter||(t.declutter[n]=new Ol(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set("renderOrder",t)}setStyle(t){this.style_=void 0===t?Zl:t;const e=function Pm(i){if(void 0===i)return Zl;if(!i)return null;if("function"==typeof i||i instanceof gn)return i;if(Array.isArray(i)&&0===i.length)return[];if(Array.isArray(i)&&i[0]instanceof gn){const e=i.length,n=new Array(e);for(let s=0;s<e;++s){const r=i[s];if(!(r instanceof gn))throw new Error("Expected a list of style instances");n[s]=r}return n}return function pm(i,t){if(t=t??ro(),!Array.isArray(i))return ql([i],t);const e=i.length;if("style"in i[0]){const r=new Array(e);for(let o=0;o<e;++o){const l=i[o];if(!("style"in l))throw new Error("Expected a list of rules with a style property");r[o]=l}return function mm(i,t){const e=function _m(i,t){const e=i.length,n=new Array(e);for(let s=0;s<e;++s){const r=i[s],o="filter"in r?se(r.filter,It,t):gm;let l;if(Array.isArray(r.style)){const c=r.style.length;l=new Array(c);for(let h=0;h<c;++h)l[h]=Co(r.style[h],t)}else l=[Co(r.style,t)];n[s]={filter:o,styles:l}}return function(s){const r=[];let o=!1;for(let l=0;l<e;++l)if((0,n[l].filter)(s)&&(!i[l].else||!o)){o=!0;for(const h of n[l].styles){const d=h(s);d&&r.push(d)}}return r}}(i,t=t??ro()),n={variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""};return function(s,r){if(n.properties=s.getPropertiesInternal(),n.resolution=r,t.featureId){const o=s.getId();n.featureId=void 0!==o?o:null}return t.geometryType&&(n.geometryType=ao(s.getGeometry())),e(n)}}(r,t)}return ql(i,t)}(i)}(t);this.styleFunction_=null===t?void 0:function dm(i){let t;if("function"==typeof i)t=i;else{let e;Array.isArray(i)?e=i:(st("function"==typeof i.getZIndex,"Expected an `Style` or an array of `Style`"),e=[i]),t=function(){return e}}return t}(e),this.changed()}setDeclutter(t){this.declutter_=t?String(t):void 0,this.changed()}},lc=class Rm extends Pe{constructor(t,e,n,s){super(t),this.inversePixelTransform=e,this.frameState=n,this.context=s}},cc="10px sans-serif",Se=[],mn=[0,0,0,0],Ln=new Zt;let hc,bi=null;const Eo={},Fm=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function Am(i,t,e){return`${i} ${t} 16px "${e}"`}const Tm=function(){let t,e;function n(l){return s.apply(this,arguments)}function s(){return(s=ns(function*(l){yield e.ready;const c=Lr(l),h=c.families[0].toLowerCase(),d=c.weight,u=[];return e.forEach(g=>{g.family.replace(/^['"]|['"]$/g,"").toLowerCase()===h&&g.style===c.style&&(Dr[g.weight]||g.weight)==d&&u.push(g)}),0!==u.length&&(yield Promise.all(u.map(g=>g.load().then(()=>!0,()=>!1)))).some(g=>g)})).apply(this,arguments)}function r(){return o.apply(this,arguments)}function o(){return(o=ns(function*(){yield e.ready;let l=!0;const c=Ln.getProperties(),h=Object.keys(c).filter(d=>c[d]<100);for(let d=h.length-1;d>=0;--d){const u=h[d];let f=c[u];f<100&&((yield n(u))?(zn(Eo),Ln.set(u,100)):(f+=10,Ln.set(u,f,!0),f<100&&(l=!1)))}t=void 0,l||(t=setTimeout(r,100))})).apply(this,arguments)}return function(){var l=ns(function*(c){e||(e=fe?self.fonts:document.fonts);const h=Lr(c);if(!h)return;const d=h.families;let u=!1;for(const f of d){if(Fm.has(f))continue;const g=Am(h.style,h.weight,f);void 0===Ln.get(g)&&(Ln.set(g,0,!0),u=!0)}u&&(clearTimeout(t),t=setTimeout(r,100))});return function(c){return l.apply(this,arguments)}}()}(),km=function(){let i;return function(t){let e=Eo[t];if(null==e){if(fe){const n=Lr(t),s=dc(t,"\u017dg");e=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(s.actualBoundingBoxAscent+s.actualBoundingBoxDescent)}else i||(i=document.createElement("div"),i.innerHTML="M",i.style.minHeight="0",i.style.maxHeight="none",i.style.height="auto",i.style.padding="0",i.style.border="none",i.style.position="absolute",i.style.display="block",i.style.left="-99999px"),i.style.font=t,document.body.appendChild(i),e=i.offsetHeight,document.body.removeChild(i);Eo[t]=e}return e}}();function dc(i,t){return bi||(bi=St(1,1)),i!=hc&&(bi.font=i,hc=bi.font),bi.measureText(t)}
1function uc(i,t){return dc(i,t).width}function fc(i,t,e){if(t in e)return e[t];const n=t.split("\n").reduce((s,r)=>Math.max(s,uc(i,r)),0);return e[t]=n,n}function jm(i,t){Kt.expire()}const Bm=class Gm extends Ns{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){L()}calculateMatrices2D(t){const e=t.viewState,n=t.coordinateToPixelTransform,s=t.pixelToCoordinateTransform;_e(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),fr(s,n)}forEachFeatureAtCoordinate(t,e,n,s,r,o,l,c){let h;const d=e.viewState;function u(C,w,v,F){return r.call(o,w,C?v:null,F)}const f=d.projection,g=Pa(t.slice(),f),m=[[0,0]];if(f.canWrapX()&&s){const w=pt(f.getExtent());m.push([-w,0],[w,0])}const p=e.layerStatesArray,_=p.length,y=[],b=[];for(let C=0;C<m.length;C++)for(let w=_-1;w>=0;--w){const v=p[w],F=v.layer;if(F.hasRenderer()&&Yr(v,d)&&l.call(c,F)){const O=F.getRenderer(),x=F.getSource();if(O&&x){const M=x.getWrapX()?g:t,z=u.bind(null,v.managed);b[0]=M[0]+m[C][0],b[1]=M[1]+m[C][1],h=O.forEachFeatureAtCoordinate(b,e,n,z,y)}if(h)return h}}if(0===y.length)return;const E=1/y.length;return y.forEach((C,w)=>C.distanceSq+=w*E),y.sort((C,w)=>C.distanceSq-w.distanceSq),y.some(C=>h=C.callback(C.feature,C.layer,C.geometry)),h}hasFeatureAtCoordinate(t,e,n,s,r,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,n,s,Kn,this,r,o)}getMap(){return this.map_}renderFrame(t){L()}scheduleExpireIconCache(t){Kt.canExpireCache()&&t.postRenderFunctions.push(jm)}},Wm=class Vm extends Bm{constructor(t){super(t),this.fontChangeListenerKey_=K(Ln,"propertychange",t.redrawText,t),this.element_=fe?Cl():document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=si+" ol-layers";const n=t.getViewport();n&&n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){const n=this.getMap();if(n.hasListener(t)){const s=new lc(t,void 0,e);n.dispatchEvent(s)}}disposeInternal(){et(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(t){if(!t)return void(this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1));this.calculateMatrices2D(t),this.dispatchRenderEvent("precompose",t);const e=t.layerStatesArray.sort((d,u)=>d.zIndex-u.zIndex);e.some(d=>d.layer instanceof ac&&d.layer.getDeclutter())&&(t.declutter={});const s=t.viewState;this.children_.length=0;const o=this.getMap().getTargetElement();let l;ie(o)&&(l=o.getContext("2d"),l.setTransform(1,0,0,1,0,0),l.clearRect(0,0,o.width,o.height));const c=[];let h=l?o:null;for(let d=0,u=e.length;d<u;++d){const f=e[d];t.layerIndex=d;const g=f.layer,m=g.getSourceState();if(!Yr(f,s)||"ready"!=m&&"undefined"!=m){g.unrender();continue}const p=g.render(t,h);p&&(p!==h&&(this.children_.push(p),h=p),c.push(f))}this.declutter(t,c),function xf(i,t){const e=i.childNodes;for(let n=0;;++n){const s=e[n],r=t[n];if(!s&&!r)break;if(s!==r){if(!s){i.appendChild(r);continue}if(!r){i.removeChild(s),--n;continue}i.insertBefore(r,s)}}}(this.element_,this.children_);for(const d of l?this.children_:[]){const u=d.firstElementChild||d,f=d.style.backgroundColor;if(f&&(!ie(u)||u.width>0)&&(l.fillStyle=f,l.fillRect(0,0,l.canvas.width,l.canvas.height)),!ie(u)||0===u.width)continue;l.save();const g=d.style.opacity||u.style.opacity;l.globalAlpha=""===g?1:Number(g);const m=u.style.transform;if(m)l.transform(...gr(m));else{const p=parseFloat(u.style.width)/u.width,_=parseFloat(u.style.height)/u.height;l.transform(p,0,0,_,0,0)}l.drawImage(u,0,0),l.restore()}this.dispatchRenderEvent("postcompose",t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}declutter(t,e){if(t.declutter){for(let n=e.length-1;n>=0;--n){const s=e[n],r=s.layer;r.getDeclutter()&&r.renderDeclutter(t,s)}e.forEach(n=>n.layer.renderDeferred(t))}}};function gc(i){i instanceof Ur?i.setMapInternal(null):i instanceof os&&i.getLayers().forEach(gc)}function mc(i,t){if(i instanceof Ur)i.setMapInternal(t);else if(i instanceof os){const e=i.getLayers().getArray();for(let n=0,s=e.length;n<s;++n)mc(e[n],t)}}const Xm=class zm extends Zt{constructor(t){super();const e=function Km(i){let t=null;void 0!==i.keyboardEventTarget&&(t="string"==typeof i.keyboardEventTarget?document.getElementById(i.keyboardEventTarget):i.keyboardEventTarget);const e={},n=i.layers&&"function"==typeof i.layers.getLayers?i.layers:new os({layers:i.layers});let s,r,o;return e.layergroup=n,e.target=i.target,e.view=i.view instanceof ne?i.view:new ne,void 0!==i.controls&&(Array.isArray(i.controls)?s=new Bt(i.controls.slice()):(st("function"==typeof i.controls.getArray,"Expected `controls` to be an array or an `ol/Collection.js`"),s=i.controls)),void 0!==i.interactions&&(Array.isArray(i.interactions)?r=new Bt(i.interactions.slice()):(st("function"==typeof i.interactions.getArray,"Expected `interactions` to be an array or an `ol/Collection.js`"),r=i.interactions)),void 0!==i.overlays?Array.isArray(i.overlays)?o=new Bt(i.overlays.slice()):(st("function"==typeof i.overlays.getArray,"Expected `overlays` to be an array or an `ol/Collection.js`"),o=i.overlays):o=new Bt,{controls:s,interactions:r,keyboardEventTarget:t,overlays:o,values:e}}(t=t||{});this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=void 0!==t.maxTilesLoading?t.maxTilesLoading:16,this.pixelRatio_=void 0!==t.pixelRatio?t.pixelRatio:md,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=Wt(),this.pixelToCoordinateTransform_=Wt(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,fe||(this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_)),this.mapBrowserEventHandler_=null,this.moveTolerance_=t.moveTolerance,this.keyboardEventTarget_=e.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,fe||(this.resizeObserver_=new ResizeObserver(()=>this.updateSize())),this.controls=e.controls||(fe?new Bt:bl()),this.interactions=e.interactions||(fe?new Bt:function pg(i){i=i||{};const t=new Bt,e=new kf(-.005,.05,100);return(void 0===i.altShiftDragRotate||i.altShiftDragRotate)&&t.push(new Zf),(void 0===i.doubleClickZoom||i.doubleClickZoom)&&t.push(new Gf({delta:i.zoomDelta,duration:i.zoomDuration})),(void 0===i.dragPan||i.dragPan)&&t.push(new Hf({onFocusOnly:i.onFocusOnly,kinetic:e})),(void 0===i.pinchRotate||i.pinchRotate)&&t.push(new fg),(void 0===i.pinchZoom||i.pinchZoom)&&t.push(new mg({duration:i.zoomDuration})),(void 0===i.keyboard||i.keyboard)&&(t.push(new sg),t.push(new og({delta:i.zoomDelta,duration:i.zoomDuration}))),(void 0===i.mouseWheelZoom||i.mouseWheelZoom)&&t.push(new dg({onFocusOnly:i.onFocusOnly,duration:i.zoomDuration})),(void 0===i.shiftDragZoom||i.shiftDragZoom)&&t.push(new ng({duration:i.zoomDuration})),t}({onFocusOnly:!0}
1)),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new wd(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener("layergroup",this.handleLayerGroupChanged_),this.addChangeListener("view",this.handleViewChanged_),this.addChangeListener("size",this.handleSizeChanged_),this.addChangeListener("target",this.handleTargetChanged_),this.setProperties(e.values);const n=this;t.view&&!(t.view instanceof ne)&&t.view.then(function(s){n.setView(new ne(s))}),this.controls.addEventListener("add",s=>{s.element.setMap(this)}),this.controls.addEventListener("remove",s=>{s.element.setMap(null)}),this.interactions.addEventListener("add",s=>{s.element.setMap(this)}),this.interactions.addEventListener("remove",s=>{s.element.setMap(null)}),this.overlays_.addEventListener("add",s=>{this.addOverlayInternal_(s.element)}),this.overlays_.addEventListener("remove",s=>{const r=s.element.getId();void 0!==r&&delete this.overlayIdIndex_[r.toString()],s.element.setMap(null)}),this.controls.forEach(s=>{s.setMap(this)}),this.interactions.forEach(s=>{s.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){mc(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_?.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,n){if(!this.frameState_||!this.renderer_)return;const s=this.getCoordinateFromPixelInternal(t);return this.renderer_.forEachFeatureAtCoordinate(s,this.frameState_,void 0!==(n=void 0!==n?n:{}).hitTolerance?n.hitTolerance:0,!1!==n.checkWrapped,e,null,void 0!==n.layerFilter?n.layerFilter:Kn,null)}getFeaturesAtPixel(t,e){const n=[];return this.forEachFeatureAtPixel(t,function(s){n.push(s)},e),n}getAllLayers(){const t=[];return function e(n){n.forEach(function(s){s instanceof os?e(s.getLayers()):t.push(s)})}(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const n=this.getCoordinateFromPixelInternal(t);return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,void 0!==(e=void 0!==e?e:{}).hitTolerance?e.hitTolerance:0,!1!==e.checkWrapped,void 0!==e.layerFilter?e.layerFilter:Kn,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const n=this.viewport_.getBoundingClientRect(),s=this.getSize(),l="changedTouches"in t?t.changedTouches[0]:t;return[(l.clientX-n.left)/(n.width/s[0]),(l.clientY-n.top)/(n.height/s[1])]}getTarget(){return this.get("target")}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return hr(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?Mt(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get("layergroup")}setLayers(t){const e=this.getLayerGroup();if(t instanceof Bt)return void e.setLayers(t);const n=e.getLayers();n.clear(),n.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,n=t.length;e<n;++e){const s=t[e];if(!s.visible)continue;const r=s.layer.getRenderer();if(r&&!r.ready)return!0;const o=s.layer.getSource();if(o&&o.loading)return!0}return!1}getPixelFromCoordinate(t){const e=pe(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){const e=this.frameState_;return e?Mt(e.coordinateToPixelTransform,t.slice(0,2)):null}getPixelRatio(){return this.pixelRatio_}setPixelRatio(t){this.pixelRatio_!==t&&(this.pixelRatio_=t,this.render())}getRenderer(){return this.renderer_}getSize(){return this.get("size")}getView(){return this.get("view")}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const t=this.getTargetElement();return t?t.ownerDocument:document}getTilePriority(t,e,n,s){return function vd(i,t,e,n,s){if(!i||!(e in i.wantedTiles)||!i.wantedTiles[e][t.getKey()])return Gi;const r=i.viewState.center,o=n[0]-r[0],l=n[1]-r[1];return 65536*Math.log(s)+Math.sqrt(o*o+l*l)/s}(this.frameState_,t,e,n,s)}handleBrowserEvent(t,e){const n=new Re(e=e||t.type,this,t);this.handleMapBrowserEvent(n)}handleMapBrowserEvent(t){if(!this.frameState_)return;const e=t.originalEvent,n=e.type;if("pointerdown"===n||"wheel"===n||"keydown"===n){const s=this.getOwnerDocument(),r=this.viewport_.getRootNode?this.viewport_.getRootNode():s,o=e.target,l=r instanceof ShadowRoot?r.host===o?r.host.ownerDocument:r:r===s?s.documentElement:r;if(this.overlayContainerStopEvent_.contains(o)||!l.contains(o))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t)){const s=this.getInteractions().getArray().slice();for(let r=s.length-1;r>=0;r--){const o=s[r];
1if(o.getMap()===this&&o.getActive()&&this.getTargetElement()&&(!o.handleEvent(t)||t.propagationStopped))break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let s=this.maxTilesLoading_,r=s;const o=t?t.viewHints:void 0,l=!!o&&(o[0]||o[1]);if(l){const c=Date.now()-t.time>8;s=c?0:8,r=c?0:2}e.getTilesLoading()<s&&(l&&e.reprioritize(),e.loadMoreTiles(s,r))}t&&this.renderer_&&!t.animate&&(this.renderComplete_?(this.hasListener("rendercomplete")&&this.renderer_.dispatchRenderEvent("rendercomplete",t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new Sn("loadend",this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new Sn("loadstart",this,t))));const n=this.postRenderFunctions_;if(t)for(let s=0,r=n.length;s<r;++s)n[s](this,t);n.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let n=0,s=this.targetChangeHandlerKeys_.length;n<s;++n)et(this.targetChangeHandlerKeys_[n]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener("contextmenu",this.boundHandleBrowserEvent_),this.viewport_.removeEventListener("wheel",this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_&&!ie(this.targetElement_)){this.resizeObserver_?.unobserve(this.targetElement_);const n=this.targetElement_.getRootNode();n instanceof ShadowRoot&&this.resizeObserver_.unobserve(n.host),this.setSize(void 0)}const t=this.getTarget(),e="string"==typeof t?document.getElementById(t):t;if(this.targetElement_=e,e){if(ie(e)||e.appendChild(this.viewport_),this.renderer_||(this.renderer_=new Wm(this)),!ie(e)){this.mapBrowserEventHandler_=new Cd(this,this.moveTolerance_);for(const s in it)this.mapBrowserEventHandler_.addEventListener(it[s],this.handleMapBrowserEvent.bind(this));let n;if(this.viewport_.addEventListener("contextmenu",this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener("wheel",this.boundHandleBrowserEvent_,!!ma&&{passive:!1}),this.keyboardEventTarget_)n=this.keyboardEventTarget_;else{const s=e.getRootNode();n=s instanceof ShadowRoot?s.host:e}if(this.targetChangeHandlerKeys_=[K(n,"keydown",this.handleBrowserEvent,this),K(n,"keypress",this.handleBrowserEvent,this)],!ie(e)){const s=e.getRootNode();s instanceof ShadowRoot&&this.resizeObserver_.observe(s.host),this.resizeObserver_?.observe(e)}}this.updateSize()}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0)}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(et(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(et(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const t=this.getView();t&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=K(t,"propertychange",this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=K(t,"change",this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(et),this.layerGroupPropertyListenerKeys_=null);const t=this.getLayerGroup();t&&(this.handleLayerAdd_(new Le("addlayer",t)),this.layerGroupPropertyListenerKeys_=[K(t,"propertychange",this.render,this),K(t,"change",this.render,this),K(t,"addlayer",this.handleLayerAdd_,this),K(t,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){if(!this.frameState_)return;const t=this.frameState_.layerStatesArray;for(let e=0,n=t.length;e<n;++e){const s=t[e].layer;s.hasRenderer()&&s.getRenderer().handleFontsChanged()}}render(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}
1removeControl(t){return this.getControls().remove(t)}removeInteraction(t){return this.getInteractions().remove(t)}removeLayer(t){return this.getLayerGroup().getLayers().remove(t)}handleLayerRemove_(t){gc(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){const e=this.getSize(),n=this.getView(),s=this.frameState_;let r=null;if(void 0!==e&&Al(e)&&n&&n.isDef()){const o=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),l=n.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:Zs(l.center,l.resolution,l.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:l,viewHints:o,wantedTiles:{},mapId:at(this),renderTargets:{}},l.nextCenter&&l.nextResolution){const c=isNaN(l.nextRotation)?l.rotation:l.nextRotation;r.nextExtent=Zs(l.nextCenter,l.nextResolution,c,e)}}this.frameState_=r,this.renderer_.renderFrame(r),r&&(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),s&&(!this.previousExtent_||!En(this.previousExtent_)&&!Ys(r.extent,this.previousExtent_))&&(this.dispatchEvent(new Sn("movestart",this,s)),this.previousExtent_=Ae(this.previousExtent_)),this.previousExtent_&&!r.viewHints[0]&&!r.viewHints[1]&&!Ys(r.extent,this.previousExtent_)&&(this.dispatchEvent(new Sn("moveend",this,r)),Ca(r.extent,this.previousExtent_))),this.dispatchEvent(new Sn("postrender",this,r)),this.renderComplete_=(this.hasListener("loadstart")||this.hasListener("loadend")||this.hasListener("rendercomplete"))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new Le("removelayer",e)),this.set("layergroup",t)}setSize(t){this.set("size",t)}setTarget(t){this.set("target",t)}setView(t){if(!t||t instanceof ne)return void this.set("view",t);this.set("view",new ne);const e=this;t.then(function(n){e.setView(new ne(n))})}updateSize(){const t=this.getTargetElement();let e;if(t){let s,r;if(ie(t)){const o=t.getContext("2d").getTransform();s=t.width/o.a,r=t.height/o.d}else{const o=getComputedStyle(t);s=t.offsetWidth-parseFloat(o.borderLeftWidth)-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight)-parseFloat(o.borderRightWidth),r=t.offsetHeight-parseFloat(o.borderTopWidth)-parseFloat(o.paddingTop)-parseFloat(o.paddingBottom)-parseFloat(o.borderBottomWidth)}!isNaN(s)&&!isNaN(r)&&(e=[Math.max(0,s),Math.max(0,r)],!Al(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&Ra("No map visible because the map container's width or height are 0."))}const n=this.getSize();e&&(!n||!Oe(e,n))&&(this.updateViewportSize_(e),this.setSize(e))}updateViewportSize_(t){const e=this.getView();e&&e.setViewportSize(t)}},Um=class Ym extends rs{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target}),this.extent=t.extent?t.extent:null,this.fitOptions=t.fitOptions||{};const e=void 0!==t.className?t.className:"ol-zoom-extent",n=void 0!==t.label?t.label:"E",s=void 0!==t.tipLabel?t.tipLabel:"Fit to extent",r=document.createElement("button");r.setAttribute("type","button"),r.title=s,r.appendChild("string"==typeof n?document.createTextNode(n):n),r.addEventListener("click",this.handleClick_.bind(this),!1);const l=this.element;l.className=e+" "+si+" "+ss,l.appendChild(r)}handleClick_(t){t.preventDefault(),this.handleZoomToExtent()}handleZoomToExtent(){const e=this.getMap().getView(),n=this.extent?On(this.extent,e.getProjection()):e.getProjection().getExtent();e.fitInternal(Or(n),this.fitOptions)}};function pc(i,t,e,n){const s=[];let r=[1/0,1/0,-1/0,-1/0];for(let o=0,l=e.length;o<l;++o){const c=e[o];r=Xs(i,t,c[0],n),s.push((r[0]+r[2])/2,(r[1]+r[3])/2),t=c[c.length-1]}return s}function Cs(i,t,e,n,s,r,o){let l,c;const h=(e-t)/n;
vendor: 16,384 bytes, line 1
1if(1===h)l=t;else if(2===h)l=t,c=s;else if(0!==h){let d=i[t],u=i[t+1],f=0;const g=[0];for(let _=t+n;_<e;_+=n){const y=i[_],b=i[_+1];f+=Math.sqrt((y-d)*(y-d)+(b-u)*(b-u)),g.push(f),d=y,u=b}const m=s*f,p=function id(i,t,e){let n,s;e=e||Ie;let r=0,o=i.length,l=!1;for(;r<o;)n=r+(o-r>>1),s=+e(i[n],t),s<0?r=n+1:(o=n,l=!s);return l?r:~r}(g,m);p<0?(c=(m-g[-p-2])/(g[-p-1]-g[-p-2]),l=t+(-p-2)*n):l=t+p*n}o=o>1?o:2,r=r||new Array(o);for(let d=0;d<o;++d)r[d]=void 0===l?NaN:void 0===c?i[l+d]:Nt(i[l+d],i[l+n+d],c);return r}function wo(i,t,e,n,s,r){if(e==t)return null;let o;if(s<i[t+n-1])return r?(o=i.slice(t,t+n),o[n-1]=s,o):null;if(i[e-1]<s)return r?(o=i.slice(e-n,e),o[n-1]=s,o):null;if(s==i[t+n-1])return i.slice(t,t+n);let l=t/n,c=e/n;for(;l<c;){const f=l+c>>1;s<i[(f+1)*n-1]?c=f:l=f+1}const h=i[l*n-1];if(s==h)return i.slice((l-1)*n,(l-1)*n+n);const u=(s-h)/(i[(l+1)*n-1]-h);o=[];for(let f=0;f<n-1;++f)o.push(Nt(i[(l-1)*n+f],i[l*n+f],u));return o.push(s),o}const _c=Wt();class Nn{constructor(t,e,n,s,r,o){this.id_=o,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=n||null,this.properties_=r,this.stride_=s}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_="Point"===this.type_?ba(this.flatCoordinates_):Xs(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=en(this.getExtent());this.flatInteriorPoints_=vr(this.flatCoordinates_,0,this.ends_,this.stride_,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=function sf(i,t){const e=[];let r,n=0,s=0;for(let o=0,l=t.length;o<l;++o){const c=t[o],h=xr(i,n,c,2);if(void 0===r&&(r=h),h===r)e.push(t.slice(s,o+1));else{if(0===e.length)continue;e[e.length-1].push(t[s])}s=o+1,n=c}return e}(this.flatCoordinates_,this.ends_),e=pc(this.flatCoordinates_,0,t,this.stride_);this.flatInteriorPoints_=dl(this.flatCoordinates_,0,t,this.stride_,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Cs(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const n=this.ends_;for(let s=0,r=n.length;s<r;++s){const o=n[s],l=Cs(t,e,o,this.stride_,.5);ee(this.flatMidpoints_,l),e=o}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(t){return this}simplifyTransformed(t,e){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(t){const e=(t=nt(t)).getExtent(),n=t.getWorldExtent();if(e&&n){const s=qt(n)/qt(e);_e(_c,n[0],n[3],s,-s,0,0,0),Te(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_,_c,this.flatCoordinates_)}}applyTransform(t){t(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new Nn(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=ha((t,e)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const n=this.simplifiedGeometry_.getFlatCoordinates();let s;switch(this.type_){case"LineString":n.length=ii(n,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,n,0),s=[n.length];break;case"MultiLineString":s=[],n.length=Sr(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,n,0,s);break;case"Polygon":s=[],n.length=Er(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),n,0,s)}return s&&(this.simplifiedGeometry_=new Nn(this.type_,n,s,this.stride_,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}Nn.prototype.getFlatCoordinates=Nn.prototype.getOrientedFlatCoordinates;const Be=Nn;class vo extends Zt{constructor(t){super(),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t&&("function"==typeof t.getSimplifiedGeometry?this.setGeometry(t):this.setProperties(t))}clone(){const t=new vo,e=this.geometryName_;t.setGeometryName(e);const n=this.getPropertiesInternal();if(n){const r=this.getGeometry();for(const o in n)o===e&&r?t.set(o,r.clone()):t.set(o,n[o],!0)}const s=this.getStyle();return s&&t.setStyle(s),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(et(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=K(t,"change",this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?function sp(i){if("function"==typeof i)return i;let t;return Array.isArray(i)?t=i:(st("function"==typeof i.getZIndex,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[i]),function(){return t}}(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){t!==this.geometryName_&&(this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_())}}const rp=vo;class bs extends nl{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(et),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const t=this.geometries_;for(let e=0,n=t.length;e<n;++e)this.changeEventsKeys_.push(K(t[e],"change",this.changed,this))}clone(){const t=new bs(xo(this.geometries_));return t.applyProperties(this),t}closestPointXY(t,e,n,s){if(s<Qe(this.getExtent(),t,e))return s;const r=this.geometries_;for(let o=0,l=r.length;o<l;++o)s=r[o].closestPointXY(t,e,n,s);return s}containsXY(t,e){const n=this.geometries_;for(let s=0,r=n.length;s<r;++s)if(n[s].containsXY(t,e))return!0;return!1}computeExtent(t){Ae(t);const e=this.geometries_;for(let n=0,s=e.length;n<s;++n)Od(t,e[n].getExtent());return t}getGeometries(){return xo(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[];const e=this.geometries_;for(let n=0,s=e.length;n<s;++n)e[n].getType()===this.getType()?t=t.concat(e[n].getGeometriesArrayRecursive()):t.push(e[n]);return t}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=[],n=this.geometries_;let s=!1;for(let r=0,o=n.length;r<o;++r){const l=n[r],c=l.getSimplifiedGeometry(t);e.push(c),c!==l&&(s=!0)}return s?new bs(e):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return"GeometryCollection"}intersectsExtent(t){const e=this.geometries_;for(let n=0,s=e.length;n<s;++n)if(e[n].intersectsExtent(t))return!0;return!1}isEmpty(){return 0===this.geometries_.length}rotate(t,e){const n=this.geometries_;for(let s=0,r=n.length;s<r;++s)n[s].rotate(t,e);this.changed()}scale(t,e,n){n||(n=en(this.getExtent()));const s=this.geometries_;for(let r=0,o=s.length;r<o;++r)s[r].scale(t,e,n);this.changed()}setGeometries(t){this.setGeometriesArray(xo(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){const e=this.geometries_;for(let n=0,s=e.length;n<s;++n)e[n].applyTransform(t);this.changed()}translate(t,e){const n=this.geometries_;for(let s=0,r=n.length;s<r;++s)n[s].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function xo(i){return i.map(t=>t.clone())}const op=bs;function Ss(i,t,e,n){let s=i[t],r=i[t+1],o=0;for(let l=t+n;l<e;l+=n){const c=i[l],h=i[l+1];o+=Math.sqrt((c-s)*(c-s)+(h-r)*(h-r)),s=c,r=h}return o}class Es extends on{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}appendCoordinate(t){ee(this.flatCoordinates,t),this.changed()}clone(){const t=new Es(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,s){return s<Qe(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(mr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),_r(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,n,s))}forEachSegment(t){return ll(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return"XYM"!=this.layout&&"XYZM"!=this.layout?null:wo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e=void 0!==e&&e)}getCoordinates(){return ke(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return Cs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return Ss(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=ii(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new Es(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return ni(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,this.getExtent())}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Zi(this.flatCoordinates,0,t,this.stride),this.changed()}}const Mo=Es;class ws extends on{constructor(t,e,n){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(void 0!==e&&n)this.setFlatCoordinates(e,t),this.ends_=n;else{const s=t,r=[],o=[];for(let c=0,h=s.length;c<h;++c)ee(r,s[c].getFlatCoordinates()),o.push(r.length);const l=0===s.length?this.getLayout():s[0].getLayout();this.setFlatCoordinates(l,r),this.ends_=o}}appendLineString(t){ee(this.flatCoordinates,t.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new ws(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,n,s){return s<Qe(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(pr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),yr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,n,s))}getCoordinateAtM(t,e,n){return"XYM"!=this.layout&&"XYZM"!=this.layout||0===this.flatCoordinates.length?null:function Hm(i,t,e,n,s,r,o){if(o)return wo(i,t,e[e.length-1],n,s,r);let l;if(s<i[n-1])return r?(l=i.slice(0,n),l[n-1]=s,l):null;if(i[i.length-1]<s)return r?(l=i.slice(i.length-n),l[n-1]=s,l):null;for(let c=0,h=e.length;c<h;++c){const d=e[c];if(t!=d){if(s<i[t+n-1])return null;if(s<=i[d-1])return wo(i,t,d,n,s,!1);t=d}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,e=void 0!==e&&e,n=void 0!==n&&n)}getCoordinates(){return ei(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new Mo(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){const t=this.flatCoordinates,e=this.ends_,n=this.layout,s=[];let r=0;for(let o=0,l=e.length;o<l;++o){const c=e[o],h=new Mo(t.slice(r,c),n);s.push(h),r=c}return s}getLength(){const t=this.ends_;let e=0,n=0;for(let s=0,r=t.length;s<r;++s)n+=Ss(this.flatCoordinates,e,t[s],this.stride),e=t[s];return n}getFlatMidpoints(){const t=[],e=this.flatCoordinates;let n=0;const s=this.ends_,r=this.stride;for(let o=0,l=s.length;o<l;++o){const c=s[o];ee(t,Cs(e,n,c,r,.5)),n=c}return t}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=Sr(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,n),new ws(e,"XY",n)}getType(){return"MultiLineString"}intersectsExtent(t){return function $u(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r){if(ni(i,t,e[r],n,s))return!0;t=e[r]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=ti(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()}}const ap=ws;class Io extends on{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){ee(this.flatCoordinates,t.getFlatCoordinates()),this.changed()}clone(){const t=new Io(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,s){if(s<Qe(this.getExtent(),t,e))return s;const r=this.flatCoordinates,o=this.stride;for(let l=0,c=r.length;l<c;l+=o){const h=qe(t,e,r[l],r[l+1]);if(h<s){s=h;for(let d=0;d<o;++d)n[d]=r[l+d];n.length=o}}return s}getCoordinates(){return ke(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){return t<0||this.flatCoordinates.length/this.stride<=t?null:new qi(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,e=this.layout,n=this.stride,s=[];for(let r=0,o=t.length;r<o;r+=n){const l=new qi(t.slice(r,r+n),e);s.push(l)}return s}getType(){return"MultiPoint"}intersectsExtent(t){const e=this.flatCoordinates,n=this.stride;for(let s=0,r=e.length;s<r;s+=n)if(zs(t,e[s],e[s+1]))return!0;return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Zi(this.flatCoordinates,0,t,this.stride),this.changed()}}const yc=Io;class vs extends on{constructor(t,e,n){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!n&&!Array.isArray(t[0])){const s=t,r=[],o=[];for(let l=0,c=s.length;l<c;++l){const h=s[l],d=r.length,u=h.getEnds();for(let f=0,g=u.length;f<g;++f)u[f]+=d;ee(r,h.getFlatCoordinates()),o.push(u)}e=0===s.length?this.getLayout():s[0].getLayout(),t=r,n=o}void 0!==e&&n?(this.setFlatCoordinates(e,t),this.endss_=n):this.setCoordinates(t,e)}appendPolygon(t){let e;if(this.flatCoordinates){const n=this.flatCoordinates.length;ee(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(let s=0,r=e.length;s<r;++s)e[s]+=n}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()}clone(){const t=this.endss_.length,e=new Array(t);for(let s=0;s<t;++s)e[s]=this.endss_[s].slice();const n=new vs(this.flatCoordinates.slice(),this.layout,e);return n.applyProperties(this),n}closestPointXY(t,e,n,s){return s<Qe(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function Ku(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r){const l=e[r];s=pr(i,t,l,n,s),t=l[l.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function Xu(i,t,e,n,s,r,o,l,c,h,d){d=d||[NaN,NaN];for(let u=0,f=e.length;u<f;++u){const g=e[u];h=yr(i,t,g,n,s,r,o,l,c,h,d),t=g[g.length-1]}return h}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,n,s))}containsXY(t,e){return function Hu(i,t,e,n,s,r){if(0===e.length)return!1;for(let o=0,l=e.length;o<l;+
1+o){const c=e[o];if(br(i,t,c,n,s,r))return!0;t=c[c.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return function zu(i,t,e,n){let s=0;for(let r=0,o=e.length;r<o;++r){const l=e[r];s+=rl(i,t,l,n),t=l[l.length-1]}return s}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),Ir(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,Cr(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=pc(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=dl(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new yc(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;ul(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ir(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=function ef(i,t,e,n,s,r,o,l){for(let c=0,h=e.length;c<h;++c){const d=e[c],u=[];o=Er(i,t,d,n,s,r,o,u),l.push(u),t=d[d.length-1]}return o}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,n),new vs(e,"XY",n)}getPolygon(t){if(t<0||this.endss_.length<=t)return null;let e;if(0===t)e=0;else{const r=this.endss_[t-1];e=r[r.length-1]}const n=this.endss_[t].slice(),s=n[n.length-1];if(0!==e)for(let r=0,o=n.length;r<o;++r)n[r]-=e;return new ts(this.flatCoordinates.slice(e,s),this.layout,n)}getPolygons(){const t=this.layout,e=this.flatCoordinates,n=this.endss_,s=[];let r=0;for(let o=0,l=n.length;o<l;++o){const c=n[o].slice(),h=c[c.length-1];if(0!==r)for(let u=0,f=c.length;u<f;++u)c[u]-=r;const d=new ts(e.slice(r,h),t,c);s.push(d),r=h}return s}getType(){return"MultiPolygon"}intersectsExtent(t){return function Ju(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r){const l=e[r];if(cl(i,t,l,n,s))return!0;t=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const n=al(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===n.length)this.flatCoordinates.length=0;else{const s=n[n.length-1];this.flatCoordinates.length=0===s.length?0:s[s.length-1]}this.changed()}}const lp=vs,up=class dp{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=rp,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let n=e.dataProjection?nt(e.dataProjection):this.readProjection(t);e.extent&&n&&"tile-pixels"===n.getUnits()&&(n=nt(n),n.setWorldExtent(e.extent)),e={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(e)}adaptOptions(t){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},t)}getType(){return L()}readFeature(t,e){return L()}readFeatures(t,e){return L()}readGeometry(t,e){return L()}readProjection(t){return L()}writeFeature(t,e){return L()}writeFeatures(t,e){return L()}writeGeometry(t,e){return L()}};function Oo(i,t,e){const n=e?nt(e.featureProjection):null,s=e?nt(e.dataProjection):null;let r=i;if(n&&s&&!function Ou(i,t){if(i===t)return!0;const e=i.getUnits()===t.getUnits();return(i.getCode()===t.getCode()||In(i,t)===or)&&e}(n,s)){t&&(r=i.clone());const o=t?n:s,l=t?s:n;"tile-pixels"===o.getUnits()?r.transform(o,l):r.applyTransform(qn(o,l))}if(t&&e&&void 0!==e.decimals){const o=Math.pow(10,e.decimals),l=function(c){for(let h=0,d=c.length;h<d;++h)c[h]=Math.round(c[h]*o)/o;return c};r===i&&(r=i.clone()),r.applyTransform(l)}return r}const fp={Point:qi,LineString:Mo,Polygon:ts,MultiPoint:yc,MultiLineString:ap,MultiPolygon:lp};function bc(i,t){const e=i.geometry;if(!e)return[];if(Array.isArray(e))return e.map(r=>bc({...i,geometry:r})).flat();const n="MultiPolygon"===e.type?"Polygon":e.type;if("GeometryCollection"===n||"Circle"===n)throw new Error("Unsupported geometry type: "+n);const s=e.layout.length;return Oo(new Be(n,"Polygon"===n?function gp(i,t,e){return Array.isArray(t[0])?(ul(i,
10,t,e)||Ir(i=i.slice(),0,t,e),i):(Mr(i,0,t,e)||Qi(i=i.slice(),0,t,e),i)}(e.flatCoordinates,e.ends,s):e.flatCoordinates,e.ends?.flat(),s,i.properties||{},i.id).enableSimplifyTransformed(),!1,t)}function Po(i,t){if(!i)return null;if(Array.isArray(i)){const n=i.map(s=>Po(s,t));return new op(n)}return Oo(new(0,fp[i.type])(i.flatCoordinates,i.layout||"XY",i.ends),!1,t)}function xs(i){return"string"==typeof i?JSON.parse(i)||null:null!==i?i:null}const pp=class mp extends up{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(xs(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(xs(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return L()}readFeaturesFromObject(t,e){return L()}readGeometry(t,e){return this.readGeometryFromObject(xs(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return L()}readProjection(t){return this.readProjectionFromObject(xs(t))}readProjectionFromObject(t){return L()}writeFeature(t,e){return JSON.stringify(this.writeFeatureObject(t,e))}writeFeatureObject(t,e){return L()}writeFeatures(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))}writeFeaturesObject(t,e){return L()}writeGeometry(t,e){return JSON.stringify(this.writeGeometryObject(t,e))}writeGeometryObject(t,e){return L()}};function Ro(i,t){if(!i)return null;let e;switch(i.type){case"Point":e=function bp(i){const t=i.coordinates;return{type:"Point",flatCoordinates:t,layout:rn(t.length)}}(i);break;case"LineString":e=function Sp(i){const t=i.coordinates,e=t.flat();return{type:"LineString",flatCoordinates:e,ends:[e.length],layout:rn(t[0]?.length||2)}}(i);break;case"Polygon":e=function xp(i){const t=i.coordinates,e=[],n=t[0]?.[0]?.length;return{type:"Polygon",flatCoordinates:e,ends:ti(e,0,t,n),layout:rn(n)}}(i);break;case"MultiPoint":e=function wp(i){const t=i.coordinates;return{type:"MultiPoint",flatCoordinates:t.flat(),layout:rn(t[0]?.length||2)}}(i);break;case"MultiLineString":e=function Ep(i){const t=i.coordinates,e=t[0]?.[0]?.length||2,n=[];return{type:"MultiLineString",flatCoordinates:n,ends:ti(n,0,t,e),layout:rn(e)}}(i);break;case"MultiPolygon":e=function vp(i){const t=i.coordinates,e=[],n=t[0]?.[0]?.[0].length||2;return{type:"MultiPolygon",flatCoordinates:e,ends:al(e,0,t,n),layout:rn(n)}}(i);break;case"GeometryCollection":e=function Cp(i){return i.geometries.map(function(n){return Ro(n)})}(i);break;default:throw new Error("Unsupported GeoJSON type: "+i.type)}return e}function Fo(i,t){const e=(i=Oo(i,!0,t)).getType();let n;switch(e){case"Point":n=function Fp(i){return{type:"Point",coordinates:i.getCoordinates()}}(i);break;case"LineString":n=function Ip(i){return{type:"LineString",coordinates:i.getCoordinates()}}(i);break;case"Polygon":n=function Ap(i,t){let e;return t&&(e=t.rightHanded),{type:"Polygon",coordinates:i.getCoordinates(e)}}(i,t);break;case"MultiPoint":n=function Pp(i){return{type:"MultiPoint",coordinates:i.getCoordinates()}}(i);break;case"MultiLineString":n=function Op(i){return{type:"MultiLineString",coordinates:i.getCoordinates()}}(i);break;case"MultiPolygon":n=function Rp(i,t){let e;return t&&(e=t.rightHanded),{type:"MultiPolygon",coordinates:i.getCoordinates(e)}}(i,t);break;case"GeometryCollection":n=function Mp(i,t){return delete(t=Object.assign({},t)).featureProjection,{type:"GeometryCollection",geometries:i.getGeometriesArray().map(function(n){return Fo(n,t)})}}(i,t);break;case"Circle":n={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+e)}return n}const Tp=class _p extends pp{constructor(t){t=t||{},super(),this.dataProjection=nt(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=nt(t.featureProjection)),t.featureClass&&(this.featureClass=t.featureClass),this.geometryName_=t.geometryName,this.extractGeometryName_=t.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(t,e){let n=null;n="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null};const s=Ro(n.geometry);if(this.featureClass===Be)return bc({geometry:s,id:n.id,properties:n.properties},e);const o=new(0,this.featureClass);return this.geometryName_?o.setGeometryName(this.geometryName_):this.extractGeometryName_&&n.geometry_name&&o.setGeometryName(n.geometry_name),o.setGeometry(Po(s,e)),"id"in n&&o.setId(n.id),n.properties&&o.setProperties(n.properties,!0),o}readFeaturesFromObject(t,e){let s=null;if("FeatureCollection"===t.type){s=[];const o=t.features;for(let l=0,c=o.length;l<c;++l){const h=this.readFeatureFromObject(o[l],e);h&&s.push(h)}}else s=[this.readFeatureFromObject(t,e)];return s.flat()}readGeometryFromObject(t,e){return function yp(i,t){return Po(Ro(i),t)}(t,e)}readProjectionFromObject(t){const e=t.crs;let n;if(e)if("name"==e.type)n=nt(e.properties.name);else{if("EPSG"!==e.type)throw new Error("Unknown SRS type");n=nt("EPSG:"+e.properties.code)}else n=this.dataProjection;return n}writeFeatureObject(t,e){e=this.adaptOptions(e);const n={type:"Feature",geometry:null,properties:null},s=t.getId();if(void 0!==s&&(n.id=s),!t.hasProperties())return n;const r=t.getProperties(),o=t.getGeometry();return o&&(n.geometry=Fo(o,e),delete r[t.getGeometryName()]),Ze(r)||(n.properties=r),n}writeFeaturesObject(t,e){e=this.adaptOptions(e);const n=[];for(let s=0,r=t.length;s<r;++s)n.push(this.writeFeatureObject(t[s],e));return{type:"FeatureCollection",features:n}}writeGeometryObject(t,e){return Fo(t,this.adaptOptions(e))}},Sc=class kp{drawCustom(t,e,n,s,r){}drawGeometry(t){}setStyle(t){}drawCircle(t,e,n){}drawFeature(t,e,n){}drawGeometryCollection(t,e,n){}drawLineString(t,e,n){}drawMultiLineString(t,e,n){}drawMultiPoint(t,e,n){}drawMultiPolygon(t,e,n){}drawPoint(t,e,n){}drawPolygon(t,e,n){}drawText(t,e,n){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}},Si={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Ms=[Si.FILL],Ve=[Si.STROKE],pn=[Si.BEGIN_PATH],Ec=[Si.CLOSE_PATH],T=Si,Ei=class Dp extends Sc{constructor(t,e,n,s){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=s,this.maxLineWidth=0,this.resolution=n,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return 1==e?t:t.map(function(n){return n*e})}appendFlatPointCoordinates(t,e){const n=this.getBufferedMaxExtent(),s=this.tmpCoordinate_,r=this.coordinates;let o=r.length;for(let l=0,c=t.length;l<c;l+=e)s[0]=t[l],s[1]=t[l+1],Ws(n,s)&&(r[o++]=s[0],r[o++]=s[1]);return o}appendFlatLineCoordinates(t,e,n,s,r,o){const l=this.coordinates;let c=l.length;const h=this.getBufferedMaxExtent();o&&(e+=s);let d=t[e],u=t[e+1];const f=this.tmpCoordinate_;let m,p,_,g=!0;for(m=e+s;m<n;m+=s)f[0]=t[m],f[1]=t[m+1],_=Ks(h,f),_!==p?(g&&(l[c++]=d,l[c++]=u,g=!1),l[c++]=f[0],l[c++]=f[1]):1===_?(l[c++]=f[0],l[c++]=f[1],g=!1):g=!0,d=f[0],u=f[1],p=_;return(r&&g||m===e+s)&&(l[c++]=d,l[c++]=u),c}drawCustomCoordinates_(t,e,n,s,r){for(let o=0,l=n.length;o<l;++o){const c=n[o],h=this.appendFlatLineCoordinates(t,e,c,s,!1,!1);r.push(h),e=c}return e}drawCustom(t,e,n,s,r){this.beginGeometry(t,e,r);const o=t.getType(),l=t.getStride(),c=this.coordinates.length;let h,d,u,f,g;switch(o){case"MultiPolygon":h=t.getOrientedFlatCoordinates(),f=[];const m=t.getEndss();g=0;for(let p=0,_=m.length;p<_;++p){const y=[];
1g=this.drawCustomCoordinates_(h,g,m[p],l,y),f.push(y)}this.instructions.push([T.CUSTOM,c,f,t,n,Cr,r]),this.hitDetectionInstructions.push([T.CUSTOM,c,f,t,s||n,Cr,r]);break;case"Polygon":case"MultiLineString":u=[],h="Polygon"==o?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),g=this.drawCustomCoordinates_(h,0,t.getEnds(),l,u),this.instructions.push([T.CUSTOM,c,u,t,n,ei,r]),this.hitDetectionInstructions.push([T.CUSTOM,c,u,t,s||n,ei,r]);break;case"LineString":case"Circle":h=t.getFlatCoordinates(),d=this.appendFlatLineCoordinates(h,0,h.length,l,!1,!1),this.instructions.push([T.CUSTOM,c,d,t,n,ke,r]),this.hitDetectionInstructions.push([T.CUSTOM,c,d,t,s||n,ke,r]);break;case"MultiPoint":h=t.getFlatCoordinates(),d=this.appendFlatPointCoordinates(h,l),d>c&&(this.instructions.push([T.CUSTOM,c,d,t,n,ke,r]),this.hitDetectionInstructions.push([T.CUSTOM,c,d,t,s||n,ke,r]));break;case"Point":h=t.getFlatCoordinates(),this.coordinates.push(h[0],h[1]),d=this.coordinates.length,this.instructions.push([T.CUSTOM,c,d,t,n,void 0,r]),this.hitDetectionInstructions.push([T.CUSTOM,c,d,t,s||n,void 0,r])}this.endGeometry(e)}beginGeometry(t,e,n){this.beginGeometryInstruction1_=[T.BEGIN_GEOMETRY,e,0,t,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[T.BEGIN_GEOMETRY,e,0,t,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;let e;t.reverse();const n=t.length;let s,r,o=-1;for(e=0;e<n;++e)s=t[e],r=s[0],r==T.END_GEOMETRY?o=e:r==T.BEGIN_GEOMETRY&&(s[2]=e,rd(this.hitDetectionInstructions,o,e),o=-1)}fillStyleToState(t,e={}){if(t){const n=t.getColor();e.fillPatternScale=n&&"object"==typeof n&&"src"in n?this.pixelRatio:1,e.fillStyle=re(n||"#000")??void 0}else e.fillStyle=void 0;return e}strokeStyleToState(t,e={}){if(t){const n=t.getColor();e.strokeStyle=re(n||"#000");const s=t.getLineCap();e.lineCap=void 0!==s?s:"round";const r=t.getLineDash();e.lineDash=r?r.slice():Se;const o=t.getLineDashOffset();e.lineDashOffset=o||0;const l=t.getLineJoin();e.lineJoin=void 0!==l?l:"round";const c=t.getWidth();e.lineWidth=void 0!==c?c:1;const h=t.getMiterLimit();e.miterLimit=void 0!==h?h:10;const d=t.getOffset();e.strokeOffset=d??0,e.lineWidth>this.maxLineWidth&&(this.maxLineWidth=e.lineWidth,this.bufferedMaxExtent_=null)}else e.strokeStyle=void 0,e.lineCap=void 0,e.lineDash=null,e.lineDashOffset=void 0,e.lineJoin=void 0,e.lineWidth=void 0,e.miterLimit=void 0,e.strokeOffset=void 0;return e}setFillStrokeStyle(t,e){const n=this.state;this.fillStyleToState(t,n),this.strokeStyleToState(e,n)}createFill(t){const e=t.fillStyle,n=[T.SET_FILL_STYLE,e];return"string"!=typeof e&&n.push(t.fillPatternScale),n}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[T.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,t.lineDash?this.applyPixelRatio(t.lineDash):null,t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const n=t.fillStyle;(void 0!==n&&"string"!=typeof n||t.currentFillStyle!=n)&&(this.instructions.push(e.call(this,t)),t.currentFillStyle=n)}updateStrokeStyle(t,e){const n=t.strokeStyle,s=t.lineCap,r=t.lineDash,o=t.lineDashOffset,l=t.lineJoin,c=t.lineWidth,h=t.miterLimit,d=t.strokeOffset;(t.currentStrokeStyle!=n||t.currentLineCap!=s||r!=t.currentLineDash&&!Oe(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=l||t.currentLineWidth!=c||t.currentMiterLimit!=h||t.currentStrokeOffset!=d)&&(e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=s,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=l,t.currentLineWidth=c,t.currentMiterLimit=h,t.currentStrokeOffset=d)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[T.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){return!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Ca(this.maxExtent),this.maxLineWidth>0)&&Vs(this.bufferedMaxExtent_,this.resolution*(this.maxLineWidth+1)/2,this.bufferedMaxExtent_),this.bufferedMaxExtent_}}
vendor: 4,468 bytes, line 1
1,wc=class Bp extends Ei{constructor(t,e,n,s){super(t,e,n,s)}drawFlatCoordinatess_(t,e,n,s,r){const o=this.state,l=void 0!==o.fillStyle,c=void 0!==o.strokeStyle,h=n.length;this.instructions.push(pn),this.hitDetectionInstructions.push(pn);for(let d=0;d<h;++d){const u=n[d],f=this.coordinates.length,g=this.appendFlatLineCoordinates(t,e,u,s,!0,!c);this.instructions.push([T.MOVE_TO_LINE_TO,f,g,r*this.pixelRatio,!0]),this.hitDetectionInstructions.push([T.MOVE_TO_LINE_TO,f,g,r,!0]),c&&(this.instructions.push(Ec),this.hitDetectionInstructions.push(Ec)),e=u}return l&&(this.instructions.push(Ms),this.hitDetectionInstructions.push(Ms)),c&&(this.instructions.push(Ve),this.hitDetectionInstructions.push(Ve)),e}drawCircle(t,e,n){const s=this.state,l=s.strokeOffset;if(void 0===s.fillStyle&&void 0===s.strokeStyle||this.handleStrokeOffset_(()=>this.drawCircle(t,e,n)))return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),void 0!==s.fillStyle&&this.hitDetectionInstructions.push([T.SET_FILL_STYLE,"#000"]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([T.SET_STROKE_STYLE,"#000",s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,Se,0]);const c=t.getFlatCoordinates(),h=t.getStride(),d=this.coordinates.length;this.appendFlatLineCoordinates(c,0,c.length,h,!1,!1);const u=[T.CIRCLE,d,l];this.instructions.push(pn,u),this.hitDetectionInstructions.push(pn,u),void 0!==s.fillStyle&&(this.instructions.push(Ms),this.hitDetectionInstructions.push(Ms)),void 0!==s.strokeStyle&&(this.instructions.push(Ve),this.hitDetectionInstructions.push(Ve)),this.endGeometry(e)}drawPolygon(t,e,n){const s=this.state,l=s.strokeOffset;if(void 0===s.fillStyle&&void 0===s.strokeStyle||this.handleStrokeOffset_(()=>this.drawPolygon(t,e,n)))return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),void 0!==s.fillStyle&&this.hitDetectionInstructions.push([T.SET_FILL_STYLE,"#000"]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([T.SET_STROKE_STYLE,"#000",s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,Se,0]);const c=t.getEnds(),h=t.getOrientedFlatCoordinates(),d=t.getStride();this.drawFlatCoordinatess_(h,0,c,d,l),this.endGeometry(e)}drawMultiPolygon(t,e,n){const s=this.state,l=s.strokeOffset;if(void 0===s.fillStyle&&void 0===s.strokeStyle||this.handleStrokeOffset_(()=>this.drawMultiPolygon(t,e,n)))return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),void 0!==s.fillStyle&&this.hitDetectionInstructions.push([T.SET_FILL_STYLE,"#000"]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([T.SET_STROKE_STYLE,"#000",s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,Se,0]);const c=t.getEndss(),h=t.getOrientedFlatCoordinates(),d=t.getStride();let u=0;for(let f=0,g=c.length;f<g;++f)u=this.drawFlatCoordinatess_(h,u,c[f],d,l);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(0!==t){const e=this.coordinates;for(let n=0,s=e.length;n<s;++n)e[n]=ln(e[n],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;this.updateFillStyle(t,this.createFill),this.updateStrokeStyle(t,this.applyStroke)}handleStrokeOffset_(t){const e=this.state,n=e.fillStyle,s=e.strokeStyle,r=e.strokeOffset;return Math.abs(r)>0&&void 0!==n&&void 0!==s&&(e.strokeStyle=void 0,e.strokeOffset=0,t(),e.fillStyle=void 0,e.strokeStyle=s,e.strokeOffset=r,t(),e.fillStyle=n,!0)}};let Ao=0,To=1;function Vp(i,t,e,n,s,r,o,l){const c=o-s,h=l-r;let d=0,u=1;if(0===c){if(s<i||s>e)return!1}else{let f=(i-s)/c,g=(e-s)/c;if(f>g){const m=f;f=g,g=m}if(f>d&&(d=f),g<u&&(u=g),d>u)return!1}if(0===h){if(r<t||r>n)return!1}else{let f=(t-r)/h,g=(n-r)/h;if(f>g){const m=f;f=g,g=m}if(f>d&&(d=f),g<u&&(u=g),d>u)return!1}return Ao=d,To=u,!0}function zp(i,t,e,n,s){const r=[];let o=e,l=0,c=t.slice(e,2);for(;l<i&&o+s<n;){const[h,d]=c.slice(-2),u=t[o+s],f=t[o+s+1],g=Math.sqrt((u-h)*(u-h)+(f-d)*(f-d));if(l+=g,l>=i){const m=(i-l+g)/g,p=Nt(h,u,m),_=Nt(d,f,m);c.push(p,_),r.push(c),c=[p,_],l==i&&(o+=s),l=0}else if(l<i)c.push(t[o+s],t[o+s+1]),o+=s;else{const m=g-l,p=Nt(h,u,m/g),_=Nt(d,f,m/g);c.push(p,_),r.push(c),c=[p,_],l=0,o+=s}}return l>0&&r.push(c),r}function Kp(i,t,e,n,s){let d,u,f,g,m,p,_,y,b,E,r=e,o=e,l=0,c=0,h=e;for(u=e;u<n;u+=s){const C=t[u],w=t[u+1];void 0!==m&&(b=C-m,E=w-p,g=Math.sqrt(b*b+E*E),void 0!==_&&(c+=f,d=Math.acos((_*b+y*E)/(f*g)),d>i&&(c>l&&(l=c,r=h,o=u),c=0,h=u-s)),f=g,_=b,y=E),m=C,p=w}return c+=g,c>l?[h,u]:[r,o]}const Is={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1}
1,Yp={Circle:wc,Default:Ei,Image:class Lp extends Ei{constructor(t,e,n,s){super(t,e,n,s),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e,n){if(!this.image_||this.maxExtent&&!Ws(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,n);const s=t.getFlatCoordinates(),r=t.getStride(),o=this.coordinates.length,l=this.appendFlatPointCoordinates(s,r);this.instructions.push([T.DRAW_IMAGE,o,l,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([T.DRAW_IMAGE,o,l,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,n){if(!this.image_)return;this.beginGeometry(t,e,n);const s=t.getFlatCoordinates(),r=[];for(let c=0,h=s.length;c<h;c+=t.getStride())(!this.maxExtent||Ws(this.maxExtent,s.slice(c,c+2)))&&r.push(s[c],s[c+1]);const o=this.coordinates.length,l=this.appendFlatPointCoordinates(r,2);this.instructions.push([T.DRAW_IMAGE,o,l,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([T.DRAW_IMAGE,o,l,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(t,e){const n=t.getAnchor(),s=t.getSize(),r=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=s[1],this.opacity_=t.getOpacity(),this.originX_=r[0],this.originY_=r[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=s[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}
1,LineString:class Gp extends Ei{constructor(t,e,n,s){super(t,e,n,s)}drawFlatCoordinates_(t,e,n,s,r){const o=this.coordinates.length,l=this.appendFlatLineCoordinates(t,e,n,s,!1,!1);return this.instructions.push([T.MOVE_TO_LINE_TO,o,l,r*this.pixelRatio]),this.hitDetectionInstructions.push([T.MOVE_TO_LINE_TO,o,l,r]),n}drawLineString(t,e,n){const s=this.state,l=s.strokeOffset;if(void 0===s.strokeStyle||void 0===s.lineWidth)return;this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,e,n),this.hitDetectionInstructions.push([T.SET_STROKE_STYLE,"#000",s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,Se,0],pn);const c=t.getFlatCoordinates(),h=t.getStride();this.drawFlatCoordinates_(c,0,c.length,h,l),this.hitDetectionInstructions.push(Ve),this.endGeometry(e)}drawMultiLineString(t,e,n){const s=this.state,l=s.strokeOffset;if(void 0===s.strokeStyle||void 0===s.lineWidth)return;this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,e,n),this.hitDetectionInstructions.push([T.SET_STROKE_STYLE,"#000",s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,Se,0],pn);const c=t.getEnds(),h=t.getFlatCoordinates(),d=t.getStride();let u=0;for(let f=0,g=c.length;f<g;++f)u=this.drawFlatCoordinates_(h,u,c[f],d,l);this.hitDetectionInstructions.push(Ve),this.endGeometry(e)}finish(){const t=this.state;return null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push(Ve),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(Ve),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(pn)}},Polygon:wc,Text:class Xp extends Ei{constructor(t,e,n,s){super(t,e,n,s),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textKeepUpright_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates["#000"]={fillStyle:"#000"},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,n){const o=this.textState_;if(""===this.text_||!o||!this.textFillState_&&!this.textStrokeState_)return;const l=this.coordinates;let c=l.length;const h=t.getType();let d=null,u=t.getStride();if("line"!==o.placement||"LineString"!=h&&"MultiLineString"!=h&&"Polygon"!=h&&"MultiPolygon"!=h){let f=o.overflow?null:[];switch(h){case"Point":case"MultiPoint":d=t.getFlatCoordinates();break;case"LineString":d=t.getFlatMidpoint();break;case"Circle":d=t.getCenter();break;case"MultiLineString":d=t.getFlatMidpoints(),u=2;break;case"Polygon":d=t.getFlatInteriorPoint(),o.overflow||f.push(d[2]/this.resolution),u=3;break;case"MultiPolygon":const C=t.getFlatInteriorPoints();d=[];for(let w=0,v=C.length;w<v;w+=3)o.overflow||f.push(C[w+2]/this.resolution),d.push(C[w],C[w+1]);if(0===d.length)return;u=2}const g=this.appendFlatPointCoordinates(d,u);if(g===c)return;if(f&&(g-c)/2!==d.length/u){let C=c/2;f=f.filter((w,v)=>{const F=l[2*(C+v)]===d[v*u]&&l[2*(C+v)+1]===d[v*u+1];return F||--C,F})}this.saveTextStates_();const m=o.backgroundFill?this.createFill(this.fillStyleToState(o.backgroundFill)):null,p=o.backgroundStroke?this.createStroke(this.strokeStyleToState(o.backgroundStroke)):null;this.beginGeometry(t,e,n);let _=o.padding;if(_!=mn&&(o.scale[0]<0||o.scale[1]<0)){let C=o.padding[0],w=o.padding[1],v=o.padding[2],F=o.padding[3];o.scale[0]<0&&(w=-w,F=-F),o.scale[1]<0&&(C=-C,v=-v),_=[C,w,v,F]}const y=this.pixelRatio;this.instructions.push([T.DRAW_IMAGE,c,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,_==mn?mn:_.map(function(C){return C*y}),m,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,f]);const b=1/y,E=m?m.slice(0):null;E&&(E[1]="#000"),this.hitDetectionInstructions.push([T.DRAW_IMAGE,c,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[b,b],NaN,this.declutterMode_,this.declutterImageWithText_,_,E,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?"#000":this.fillKey_,this.textOffsetX_,this.textOffsetY_,f]),this.endGeometry(e)}else{const f=t.getExtent();if(!Gt(this.maxExtent,f))return;let g;if(d=t.getFlatCoordinates(),"LineString"==h)g=[d.length];else if("MultiLineString"==h)g=t.getEnds();else if("Polygon"==h)g=t.getEnds().slice(0,1);else if("MultiPolygon"==h){const y=t.getEndss();g=[];for(let b=0,E=y.length;b<E;++b)g.push(y[b][0])}if(("LineString"==h||"MultiLineString"==h)&&!Fe(this.getBufferedMaxExtent(),f)){const y=function Wp(i,t,e,n){const s=n[0],r=n[1],o=n[2],l=n[3],c=[],h=[];let u,f,d=!1,g=0;for(let m=0,p=t.length;m<p;++m){const _=t[m];let y=i[g],b=i[g+1],E=!1;for(let C=g+e;C<_;C+=e){const w=i[C],v=i[C+1];
vendor: 4,998 bytes, line 1
1if(Vp(s,r,o,l,y,b,w,v)){const F=w-y,O=v-b,x=y+Ao*F,M=b+Ao*O,z=y+To*F,U=b+To*O;d&&E&&x===u&&M===f?c.push(z,U):(d&&h.push(c.length),c.push(x,M,z,U),d=!0),u=z,f=U,E=!0}y=w,b=v}g=_}return d&&h.push(c.length),{flatCoordinates:c,ends:h}}(d,g,u,this.getBufferedMaxExtent());if(d=y.flatCoordinates,g=y.ends,u=2,0===g.length)return}this.beginGeometry(t,e,n);const m=o.repeat,p=m?void 0:o.textAlign;let _=0;for(let y=0,b=g.length;y<b;++y){let E;E=m?zp(m*this.resolution,d,_,g[y],u):[d.slice(_,g[y])];for(let C=0,w=E.length;C<w;++C){const v=E[C];let F=0,O=v.length;if(null==p){const M=Kp(o.maxAngle,v,0,v.length,2);F=M[0],O=M[1]}for(let M=F;M<O;M+=u)l.push(v[M],v[M+1]);const x=l.length;_=g[y],this.drawChars_(c,x),c=x}}this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,s=this.strokeKey_;t&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||"center",justify:e.justify,textBaseline:e.textBaseline||"middle",scale:e.scale});const o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))}drawChars_(t,e){const n=this.textStrokeState_,s=this.textState_,r=this.strokeKey_,o=this.textKey_,l=this.fillKey_;this.saveTextStates_();const c=this.pixelRatio,h=Is[s.textBaseline],d=this.textOffsetX_*c,u=this.textOffsetY_*c,f=this.text_,g=n?n.lineWidth*Math.abs(s.scale[0])/2:0;this.instructions.push([T.DRAW_CHARS,t,e,h,s.overflow,l,s.maxAngle,c,u,r,g*c,f,o,1,this.declutterMode_,this.textKeepUpright_,d]),this.hitDetectionInstructions.push([T.DRAW_CHARS,t,e,h,s.overflow,l&&"#000",s.maxAngle,c,u,r,g*c,f,o,1/c,this.declutterMode_,this.textKeepUpright_,d])}setTextStyle(t,e){let n,s,r;if(t){const o=t.getFill();o?(s=this.textFillState_,s||(s={},this.textFillState_=s),s.fillStyle=re(o.getColor()||"#000")):(s=null,this.textFillState_=s);const l=t.getStroke();if(l){r=this.textStrokeState_,r||(r={},this.textStrokeState_=r);const p=l.getLineDash(),_=l.getLineDashOffset(),y=l.getWidth(),b=l.getMiterLimit();r.lineCap=l.getLineCap()||"round",r.lineDash=p?p.slice():Se,r.lineDashOffset=void 0===_?0:_,r.lineJoin=l.getLineJoin()||"round",r.lineWidth=void 0===y?1:y,r.miterLimit=void 0===b?10:b,r.strokeStyle=re(l.getColor()||"#000")}else r=null,this.textStrokeState_=r;n=this.textState_;const c=t.getFont()||cc;Tm(c);const h=t.getScaleArray();n.overflow=t.getOverflow(),n.font=c,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.repeat=t.getRepeat(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||"middle",n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||mn,n.scale=void 0===h?[1,1]:h;const d=t.getOffsetX(),u=t.getOffsetY(),f=t.getRotateWithView(),g=t.getKeepUpright(),m=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===u?0:u,this.textRotateWithView_=void 0!==f&&f,this.textKeepUpright_=void 0===g||g,this.textRotation_=void 0===m?0:m,this.strokeKey_=r?("string"==typeof r.strokeStyle?r.strokeStyle:at(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.repeat||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=s&&s.fillStyle?"string"==typeof s.fillStyle?s.fillStyle:"|"+at(s.fillStyle):""}else this.text_="";this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}},Hp=class Up{constructor(t,e,n,s){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=s,this.resolution_=n,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const n=this.buildersByZIndex_[e];for(const s in n){const r=n[s].finish();t[e][s]=r}}return t}getBuilder(t,e){const n=void 0!==t?t.toString():"0";let s=this.buildersByZIndex_[n];void 0===s&&(s={},this.buildersByZIndex_[n]=s);let r=s[e];return void 0===r&&(r=new(0,Yp[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),s[e]=r),r}};function vc(i,t,e,n,s,r,o,l){o=o??[],l=l??n;const c=i[t+n],h=i[t+n+1],d=i[e-2*n],u=i[e-2*n+1];let f,g,m,p,_,y,b,E,C=0;for(let w=t;w<e;w+=n){m=f,p=g,_=void 0,y=void 0,w+n<e&&(_=i[w+n],y=i[w+n+1]),r&&w===t&&(m=d,p=u),r&&w===e-n&&(_=c,y=h),f=i[w],g=i[w+1],[b,E]=$p(f,g,m,p,_,y,s),o[C++]=b,o[C++]=E;for(let v=2;v<l;v++)o[C++]=i[w+v]}return o.length!=C&&(o.length=C),o}function $p(i,t,e,n,s,r,o){let l,c;void 0!==e&&void 0!==n?(l=i-e,c=t-n):void 0!==s&&void 0!==r?(l=s-i,c=r-t):(l=1,c=0);const h=Math.hypot(l,c),d=l/h,u=c/h;if(l=-u,c=d,void 0===e||void 0===n)return[i+l*o,t+c*o];if(void 0===s||void 0===r)return[i+l*o,t+c*o];const f=function Yd(i,t,e){const n=Math.sqrt((t[0]-i[0])*(t[0]-i[0])+(t[1]-i[1])*(t[1]-i[1])),s=[(t[0]-i[0])/n,(t[1]-i[1])/n],r
1=[-s[1],s[0]],o=Math.sqrt((e[0]-i[0])*(e[0]-i[0])+(e[1]-i[1])*(e[1]-i[1])),l=[(e[0]-i[0])/o,(e[1]-i[1])/o];let c=0===n||0===o?0:Math.acos(lt(l[0]*s[0]+l[1]*s[1],-1,1));return c=Math.max(c,1e-5),l[0]*r[0]+l[1]*r[1]>0?c:2*Math.PI-c}([i,t],[e,n],[s,r]);if(Math.cos(f)>.998)return[i+d*o,t+u*o];const g=Math.cos(f/2),m=Math.sin(f/2);return[i+1/m*(m*l+g*c)*o,t+1/m*(-g*l+m*c)*o]}function xc(i,t,e=!1){for(let n=0,s=i.length-2;n<s;n+=t)for(let o=e&&0===n?i.length-3*t:i.length-2*t;o>n+t;o-=t){const l=i[n],c=i[n+1],h=i[n+t],d=i[n+t+1],u=i[o],f=i[o+1],g=i[o+t],m=i[o+t+1],p=(m-f)*(h-l)-(g-u)*(d-c);if(0===p)continue;const _=((g-u)*(c-f)-(m-f)*(l-u))/p,y=((h-l)*(c-f)-(d-c)*(l-u))/p;if(_>0&&_<1&&y>0&&y<1){const E=c+_*(d-c);i[n+t]=l+_*(h-l),i[n+t+1]=E,i.splice(n+2*t,o-n-t);break}}return i}let ko;function Jp(i,t,e,n,s,r,o,l,c,h,d,u,f=!0){let g=i[t],m=i[t+1],p=0,_=0,y=0,b=0;function E(){p=g,_=m,g=i[t+=n],m=i[t+1],b+=y,y=Math.sqrt((g-p)*(g-p)+(m-_)*(m-_))}do{E()}while(t<e-n&&b+y<r);let C=0===y?0:(r-b)/y;const w=Nt(p,g,C),v=Nt(_,m,C),F=t-n,O=b,x=r+l*c(h,s,d);for(;t<e-n&&b+y<x;)E();C=0===y?0:(x-b)/y;const M=Nt(p,g,C),z=Nt(_,m,C);let U=!1;if(f)if(u){const N=[w,v,M,z];tl(N,0,4,2,u,N,N),U=N[0]>N[2]}else U=w>M;const V=Math.PI,$=[],Tt=F+n===t;let A;if(y=0,b=O,g=i[t=F],m=i[t+1],Tt)return E(),A=Math.atan2(m-_,g-p),U&&(A+=A>0?-V:V),$[0]=[(M+w)/2,(z+v)/2,(x-r)/2,A,s],$;s=s.replace(/\n/g," ");const q=Array.from(function Zp(){return ko||(ko=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ko}().segment(s),N=>N.segment);for(let N=0,Q=q.length;N<Q;){E();let G=Math.atan2(m-_,g-p);if(U&&(G+=G>0?-V:V),void 0!==A){let oe=G-A;if(oe+=oe>V?-2*V:oe<-V?2*V:0,Math.abs(oe)>o)return null}A=G;const ht=N;let mt=0;for(;N<Q;++N){const Bn=l*c(h,q[U?Q-N-1:N],d);if(t+n<e&&b+y<r+mt+Bn/2)break;mt+=Bn}if(N===ht)continue;const Xe=(U?q.slice(Q-N,Q-ht):q.slice(ht,N)).join("");C=0===y?0:(r+mt/2-b)/y;const I=Nt(p,g,C),zc=Nt(_,m,C);$.push([I,zc,mt/2,G,Xe]),r+=mt}return $}const Mc=class qp{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(Gr(),{get:(t,e)=>{if("function"==typeof t[e])return this.pendingMethod_=e,this.pushMethodArgs_},set:(t,e,n)=>(this.push_(e,n),!0)})}push_(...t){const e=this.instructions_,n=this.zIndex+this.offset_;e[n]||(e[n]=[]),e[n].push(...t)}pushMethodArgs_=(...t)=>{this.push_(this.pendingMethod_,t)};pushFunction(t){this.push_(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let n=0,s=e.length;n<s;++n){const r=e[n];if("function"==typeof r){r(t);continue}const o=e[++n];"function"==typeof t[r]?t[r](...o):t[r]="function"==typeof o?o(t):o}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}},Gn=[1/0,1/0,-1/0,-1/0],We=[],Ee=[],we=[],ze=[];function Ic(i){return i[3].declutterBox}const Oc=new RegExp("[\u0591-\u08ff\ufb1d-\ufdff\ufe70-\ufefc\u0800-\u0fff\ue800-\uefff]");function Do(i,t){return"start"===t?t=Oc.test(i)?"right":"left":"end"===t&&(t=Oc.test(i)?"left":"right"),Is[t]}function Qp(i,t,e){return e>0&&i.push("\n",""),i.push(t,""),i}function t_(i,t,e){return e%2==0&&(i+=t),i}const n_=class e_{constructor(t,e,n,s,r){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.instructions=s.instructions,this.coordinates=s.coordinates,this.coordinateCache_={},this.renderedTransform_=Wt(),this.hitDetectionInstructions=s.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=s.fillStates||{},this.strokeStates=s.strokeStates||{},this.textStates=s.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=r?new Mc:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,n,s){const r=t+e+n+s;if(this.labels_[r])return this.labels_[r];const o=s?this.strokeStates[s]:null,l=n?this.fillStates[n]:null,c=this.textStates[e],h=this.pixelRatio,d=[c.scale[0]*h,c.scale[1]*h],u=c.justify?Is[c.justify]:Do(Array.isArray(t)?t[0]:t,c.textAlign||"center"),f=s&&o.lineWidth?o.lineWidth:0,g=Array.isArray(t)?t:String(t).split("\n").reduce(Qp,[]),{width:m,height:p,widths:_,heights:y,lineWidths:b}=function Dm(i,t){const e=[],n=[],s=[];let r=0,o=0,l=0,c=0;for(let h=0,d=t.length;h<=d;h+=2){const u=t[h];if("\n"===u||h===d){r=Math.max(r,o),s.push(o),o=0,l+=c,c=0;continue}const f=t[h+1]||i.font,g=uc(f,u);e.push(g),o+=g;const m=km(f);n.push(m),c=Math.max(c,m)}return{width:r,height:l,widths:e,heights:n,lineWidths:s}}(c,g),E=m+f,C=[],w=(E+2)*d[0],v=(p+f)*d[1],F={width:w<0?Math.floor(w):Math.ceil(w),height:v<0?Math.floor(v):Math.ceil(v),contextInstructions:C};(1!=d[0]||1!=d[1])&&C.push("scale",d),s&&(C.push("strokeStyle",o.strokeStyle),C.push("lineWidth",f),C.push("lineCap",o.lineCap),C.push("lineJoin",o.lineJoin),C.push("miterLimit",o.miterLimit),C.push("set
1LineDash",[o.lineDash]),C.push("lineDashOffset",o.lineDashOffset)),n&&C.push("fillStyle",l.fillStyle),C.push("textBaseline","middle"),C.push("textAlign","center");const O=.5-u;let x=u*E+O*f;const M=[],z=[];let A,U=0,V=0,$=0,Tt=0;for(let q=0,N=g.length;q<N;q+=2){const Q=g[q];if("\n"===Q){V+=U,U=0,x=u*E+O*f,++Tt;continue}const G=g[q+1]||c.font;G!==A&&(s&&M.push("font",G),n&&z.push("font",G),A=G),U=Math.max(U,y[$]);const ht=[Q,x+O*_[$]+u*(_[$]-b[Tt]),.5*(f+U)+V];x+=_[$],s&&M.push("strokeText",ht),n&&z.push("fillText",ht),++$}return Array.prototype.push.apply(C,M),Array.prototype.push.apply(C,z),this.labels_[r]=F,F}replayTextBackground_(t,e,n,s,r,o,l){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,s),t.lineTo.apply(t,r),t.lineTo.apply(t,e),o&&(this.alignAndScaleFill_=o[2],t.fillStyle=o[1],this.fill_(t)),l&&(this.setStrokeStyle_(t,l),t.stroke())}calculateImageOrLabelDimensions_(t,e,n,s,r,o,l,c,h,d,u,f,g,m,p,_){let y=n-(l*=f[0]),b=s-(c*=f[1]);const E=r+h>t?t-h:r,C=o+d>e?e-d:o,w=m[3]+E*f[0]+m[1],v=m[0]+C*f[1]+m[2],F=y-m[3],O=b-m[0];let x;return(p||0!==u)&&(We[0]=F,ze[0]=F,We[1]=O,Ee[1]=O,Ee[0]=F+w,we[0]=Ee[0],we[1]=O+v,ze[1]=we[1]),0!==u?(x=_e(Wt(),n,s,1,1,u,-n,-s),Mt(x,We),Mt(x,Ee),Mt(x,we),Mt(x,ze),tn(Math.min(We[0],Ee[0],we[0],ze[0]),Math.min(We[1],Ee[1],we[1],ze[1]),Math.max(We[0],Ee[0],we[0],ze[0]),Math.max(We[1],Ee[1],we[1],ze[1]),Gn)):tn(Math.min(F,F+w),Math.min(O,O+v),Math.max(F,F+w),Math.max(O,O+v),Gn),g&&(y=Math.round(y),b=Math.round(b)),{drawImageX:y,drawImageY:b,drawImageW:E,drawImageH:C,originX:h,originY:d,declutterBox:{minX:Gn[0],minY:Gn[1],maxX:Gn[2],maxY:Gn[3],value:_},canvasTransform:x,scale:f}}replayImageOrLabel_(t,e,n,s,r,o,l){const h=s.declutterBox,d=l?l[2]*s.scale[0]/2:0;return h.minX-d<=e[0]&&h.maxX+d>=0&&h.minY-d<=e[1]&&h.maxY+d>=0&&(!(!o&&!l)&&this.replayTextBackground_(t,We,Ee,we,ze,o,l),function Lm(i,t,e,n,s,r,o,l,c,h,d){i.save(),1!==e&&(void 0===i.globalAlpha?i.globalAlpha=u=>u.globalAlpha*=e:i.globalAlpha*=e),t&&i.transform.apply(i,t),n.contextInstructions?(i.translate(c,h),i.scale(d[0],d[1]),function Nm(i,t){const e=i.contextInstructions;for(let n=0,s=e.length;n<s;n+=2)Array.isArray(e[n+1])?t[e[n]].apply(t,e[n+1]):t[e[n]]=e[n+1]}(n,i)):d[0]<0||d[1]<0?(i.translate(c,h),i.scale(d[0],d[1]),i.drawImage(n,s,r,o,l,0,0,o,l)):i.drawImage(n,s,r,o,l,c,h,o*d[0],l*d[1]),i.restore()}(t,s.canvasTransform,r,n,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const n=Mt(this.renderedTransform_,[0,0]),s=512*this.pixelRatio;t.save(),t.translate(n[0]%s,n[1]%s),1!==e&&t.scale(e,e)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],e[1]&&(t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6]))}drawLabelWithPointPlacement_(t,e,n,s){const r=this.textStates[e],o=this.createLabel(t,e,s,n),l=this.strokeStates[n],c=this.pixelRatio,h=Do(Array.isArray(t)?t[0]:t,r.textAlign||"center"),d=Is[r.textBaseline||"middle"],u=l&&l.lineWidth?l.lineWidth:0;return{label:o,anchorX:h*(o.width/c-2*r.scale[0])+2*(.5-h)*u,anchorY:d*o.height/c+2*(.5-d)*u}}execute_(t,e,n,s,r,o,l,c){const h=this.zIndexContext_;let d;this.pixelCoordinates_&&Oe(n,this.renderedTransform_)?d=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),d=Te(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),function Tu(i,t){i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5]}(this.renderedTransform_,n));let u=0;const f=s.length;let m,g=0;const p=[];let _,y,b,E,C,w,v,F,O,x,M,z,U,V=0,$=0;const Tt=this.coordinateCache_,A=this.viewRotation_,q=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,N={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:A},Q=this.instructions!=s||this.overlaps?0:200;let G,ht,mt,Xe;for(;u<f;){const I=s[u];switch(I[0]){case T.BEGIN_GEOMETRY:G=I[1],Xe=I[3],G.getGeometry()?void 0===l||Gt(l,Xe.getExtent())?++u:u=I[2]+1:u=I[2],h&&(h.zIndex=I[4]);break;case T.BEGIN_PATH:V>Q&&(this.fill_(t),V=0),$>Q&&(t.stroke(),$=0),!V&&!$&&(t.beginPath(),C=NaN,w=NaN),++u;break;case T.CIRCLE:g=I[1],b=I[2]??0;const oe=d[g],Bn=d[g+1],Kc=d[g+2]-b-oe,Xc=d[g+3]-b-Bn,Yc=Math.sqrt(Kc*Kc+Xc*Xc);t.moveTo(oe+Yc,Bn),t.arc(oe,Bn,Yc,0,2*Math.PI,!0),++u;break;case T.CLOSE_PATH:t.closePath(),++u;break;case T.CUSTOM:g=I[1],m=I[2];const vy=I[4],Uc=I[5];N.geometry=I[3],N.feature=G,u in Tt||(Tt[u]=[]);const vi=Tt[u];Uc?Uc(d,g,m,2,vi):(vi[0]=d[g],vi[1]=d[g+1],vi.length=2),h&&(h.zIndex=I[6]),vy(vi,N),++u;break;case T.DRAW_IMAGE:g=I[1],m=I[2],O=I[3],_=I[4],y=I[5];let No=I[6];const xy=I[7],My=I[8],Iy=I[9],Hc=I[10];let Go=I[11];const Oy=I[12];let Os=I[13];E=I[14]||"declutter";const xi=I[15];if(!O&&I.length>=20){x=I[19],M=I[20],z=I[21],U=I[22];
1const ft=this.drawLabelWithPointPlacement_(x,M,z,U);O=ft.label,I[3]=O,_=(ft.anchorX-I[23])*this.pixelRatio,I[4]=_,y=(ft.anchorY-I[24])*this.pixelRatio,I[5]=y,No=O.height,I[6]=No,Os=O.width,I[13]=Os}let jo,Bo,Ps,Rs;I.length>25&&(jo=I[25]),I.length>17?(Bo=I[16],Ps=I[17],Rs=I[18]):(Bo=mn,Ps=null,Rs=null),Hc&&q?Go+=A:!Hc&&!q&&(Go-=A);let Py=0;for(;g<m;g+=2){if(jo&&jo[Py++]<Os/this.pixelRatio)continue;const ft=this.calculateImageOrLabelDimensions_(O.width,O.height,d[g],d[g+1],Os,No,_,y,My,Iy,Go,Oy,r,Bo,!!Ps||!!Rs,G),ae=[t,e,O,ft,xy,Ps,Rs];if(c){let Yt,le,Ut,ve,xe;if(xi){const rt=m-g;if(!xi[rt]){xi[rt]={args:ae,declutterMode:E};continue}const Pt=xi[rt];Yt=Pt.args,le=Pt.declutterMode,delete xi[rt],Ut=Ic(Yt)}if(Yt&&("declutter"!==le||!c.collides(Ut))&&(ve=!0),("declutter"!==E||!c.collides(ft.declutterBox))&&(xe=!0),"declutter"===le&&"declutter"===E){const rt=ve&&xe;ve=rt,xe=rt}ve&&("none"!==le&&c.insert(Ut),this.replayImageOrLabel_.apply(this,Yt)),xe&&("none"!==E&&c.insert(ft.declutterBox),this.replayImageOrLabel_.apply(this,ae))}else this.replayImageOrLabel_.apply(this,ae)}++u;break;case T.DRAW_CHARS:const $c=I[1],Zc=I[2],Vo=I[3],Ry=I[4];U=I[5];const Fy=I[6],Jc=I[7],qc=I[8];z=I[9];const Wo=I[10];x=I[11],Array.isArray(x)&&(x=x.reduce(t_,"")),M=I[12];const Qc=[I[13],I[13]];E=I[14]||"declutter";const Ay=I[15],th=I[16],zo=this.textStates[M],Mi=zo.font,Ii=[zo.scale[0]*Jc,zo.scale[1]*Jc];let Oi;Mi in this.widths_?Oi=this.widths_[Mi]:(Oi={},this.widths_[Mi]=Oi);const eh=Ss(d,$c,Zc,2),nh=Math.abs(Ii[0])*fc(Mi,x,Oi);if(Ry||nh<=eh){const Yt=Jp(d,$c,Zc,2,x,(eh-nh)*Do(x,this.textStates[M].textAlign),Fy,Math.abs(Ii[0]),fc,Mi,Oi,q?0:this.viewRotation_,Ay);t:if(Yt){const le=[];let Ut,ve,xe,rt,Pt;if(z)for(Ut=0,ve=Yt.length;Ut<ve;++Ut){Pt=Yt[Ut],xe=Pt[4],rt=this.createLabel(xe,M,"",z),_=Pt[2]+(Ii[0]<0?-Wo:Wo)-th,y=Vo*rt.height+2*(.5-Vo)*Wo*Ii[1]/Ii[0]-qc;const Me=this.calculateImageOrLabelDimensions_(rt.width,rt.height,Pt[0],Pt[1],rt.width,rt.height,_,y,0,0,Pt[3],Qc,!1,mn,!1,G);if(c&&"declutter"===E&&c.collides(Me.declutterBox))break t;le.push([t,e,rt,Me,1,null,null])}if(U)for(Ut=0,ve=Yt.length;Ut<ve;++Ut){Pt=Yt[Ut],xe=Pt[4],rt=this.createLabel(xe,M,U,""),_=Pt[2]-th,y=Vo*rt.height-qc;const Me=this.calculateImageOrLabelDimensions_(rt.width,rt.height,Pt[0],Pt[1],rt.width,rt.height,_,y,0,0,Pt[3],Qc,!1,mn,!1,G);if(c&&"declutter"===E&&c.collides(Me.declutterBox))break t;le.push([t,e,rt,Me,1,null,null])}c&&"none"!==E&&c.load(le.map(Ic));for(let Me=0,Ty=le.length;Me<Ty;++Me)this.replayImageOrLabel_.apply(this,le[Me])}}++u;break;case T.END_GEOMETRY:if(void 0!==o){G=I[1];const ft=o(G,Xe,E);if(ft)return ft}++u;break;case T.FILL:Q?V++:this.fill_(t),++u;break;case T.MOVE_TO_LINE_TO:let yn,Pi,Fs;if(g=I[1],m=I[2],b=I[3],b){const ae=(I[4]??!1)||Math.abs(d[g]-d[m-2])<1e-6&&Math.abs(d[g+1]-d[m-1])<1e-6;vc(d,g,m,2,b,ae,p),xc(p,2,ae),yn=p,Pi=0,Fs=yn.length}else yn=d,Pi=g,Fs=m;ht=yn[Pi],mt=yn[Pi+1],t.moveTo(ht,mt),C=ht+.5|0,w=mt+.5|0;for(let ft=Pi+2;ft<Fs;ft+=2)ht=yn[ft],mt=yn[ft+1],v=ht+.5|0,F=mt+.5|0,(ft==Fs-2||v!==C||F!==w)&&(t.lineTo(ht,mt),C=v,w=F);++u;break;case T.SET_FILL_STYLE:this.alignAndScaleFill_=I[2],V?(this.fill_(t),V=0,$&&(t.stroke(),$=0)):$&&I[1]&&(t.stroke(),$=0),t.fillStyle=I[1],++u;break;case T.SET_STROKE_STYLE:V&&I[1]&&(this.fill_(t),V=0),$&&(t.stroke(),$=0),this.setStrokeStyle_(t,I),++u;break;case T.STROKE:Q?$++:t.stroke(),++u;break;default:++u}}V&&this.fill_(t),$&&t.stroke()}execute(t,e,n,s,r,o){this.viewRotation_=s,this.execute_(t,e,n,this.instructions,r,void 0,void 0,o)}executeHitDetection(t,e,n,s,r){return this.viewRotation_=n,this.execute_(t,[t.canvas.width,t.canvas.height],e,this.hitDetectionInstructions,!0,s,r)}},_n=["Polygon","Circle","LineString","Image","Text","Default"],Pc=["Image","Text"],i_=_n.filter(i=>!Pc.includes(i));let Rc=!1,Fc=!1;const Lo={},a_=class r_{constructor(t,e,n,s,r,o,l){this.maxExtent_=t,this.overlaps_=s,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Wt(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,l)}clip(t,e){const n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()}createExecutors_(t,e){for(const n in t){let s=this.executorsByZIndex_[n];void 0===s&&(s={},this.executorsByZIndex_[n]=s);const r=t[n];for(const o in r)s[o]=new n_(this.resolution_,this.pixelRatio_,this.overlaps_,r[o],e)}}hasExecutors(t){for(const e in this.executorsByZIndex_){const n=this.executorsByZIndex_[e];for(let s=0,r=t.length;s<r;++s)if(t[s]in n)return!0}return!1}forEachFeatureAtCoordinate(t,e,n,s,r,o){!1===Fc&&function s_(){let i=0;const t=n=>{const s=St(1,1,null,{willReadFrequently:n}
vendor: 12,349 bytes, line 1
1);let r=0;const o=performance.now();for(;performance.now()-o<50;++r)s.fillStyle=`rgba(255,0,${r%256},1)`,s.fillRect(0,0,1,1),s.getImageData(0,0,1,1);return i=r>i?r:i,r};Rc={[t(!0)]:!0,[t(!1)]:!1,[t(void 0)]:void 0}[i],Fc=!0}();const l=2*(s=Math.round(s))+1,c=_e(this.hitDetectionTransform_,s+.5,s+.5,1/e,-1/e,-n,-t[0],-t[1]),h=!this.hitDetectionContext_;h&&(this.hitDetectionContext_=St(l,l,null,{willReadFrequently:Rc}));const d=this.hitDetectionContext_;let u;d.canvas.width!==l||d.canvas.height!==l?(d.canvas.width=l,d.canvas.height=l):h||d.clearRect(0,0,l,l),void 0!==this.renderBuffer_&&(u=[1/0,1/0,-1/0,-1/0],function Us(i,t){t[0]<i[0]&&(i[0]=t[0]),t[0]>i[2]&&(i[2]=t[0]),t[1]<i[1]&&(i[1]=t[1]),t[1]>i[3]&&(i[3]=t[1])}(u,t),Vs(u,e*(this.renderBuffer_+s),u));const f=function o_(i){if(void 0!==Lo[i])return Lo[i];const t=2*i+1,e=i*i,n=new Array(e+1);for(let r=0;r<=i;++r)for(let o=0;o<=i;++o){const l=r*r+o*o;if(l>e)break;let c=n[l];c||(c=[],n[l]=c),c.push(4*((i+r)*t+(i+o))+3),r>0&&c.push(4*((i-r)*t+(i+o))+3),o>0&&(c.push(4*((i+r)*t+(i-o))+3),r>0&&c.push(4*((i-r)*t+(i-o))+3))}const s=[];for(let r=0,o=n.length;r<o;++r)n[r]&&s.push(...n[r]);return Lo[i]=s,s}(s);let g;function m(w,v,F){const O=d.getImageData(0,0,l,l).data;for(let x=0,M=f.length;x<M;x++)if(O[f[x]]>0){if(!o||"none"===F||"Image"!==g&&"Text"!==g||o.includes(w)){const z=(f[x]-3)/4,U=s-z%l,V=s-(z/l|0),$=r(w,v,U*U+V*V);if($)return $}d.clearRect(0,0,l,l);break}}const p=Object.keys(this.executorsByZIndex_).map(Number);let _,y,b,E,C;for(p.sort(Ie),_=p.length-1;_>=0;--_){const w=p[_].toString();for(b=this.executorsByZIndex_[w],y=_n.length-1;y>=0;--y)if(g=_n[y],E=b[g],void 0!==E&&(C=E.executeHitDetection(d,c,n,m,u),C))return C}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const n=e[0],s=e[1],r=e[2],o=e[3],l=[n,s,n,o,r,o,r,s];return Te(l,0,8,2,t,l),l}isEmpty(){return Ze(this.executorsByZIndex_)}execute(t,e,n,s,r,o,l){const c=Object.keys(this.executorsByZIndex_).map(Number);c.sort(l?sd:Ie),o=o||_n;const h=_n.length;for(let d=0,u=c.length;d<u;++d){const f=c[d].toString(),g=this.executorsByZIndex_[f];for(let m=0,p=o.length;m<p;++m){const _=o[m],y=g[_];if(void 0!==y){const b=null===l?void 0:y.getZIndexContext(),E=b?b.getContext():t,C=this.maxExtent_&&"Image"!==_&&"Text"!==_;if(C&&(E.save(),this.clip(E,n)),b&&"Text"!==_&&"Image"!==_?b.pushFunction(w=>y.execute(w,e,n,s,r,l)):y.execute(E,e,n,s,r,l),C&&E.restore(),b){b.offset();const w=c[d]*h+_n.indexOf(_);this.deferredZIndexContexts_[w]||(this.deferredZIndexContexts_[w]=[]),this.deferredZIndexContexts_[w].push(b)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(Ie);for(let n=0,s=e.length;n<s;++n)t[e[n]].forEach(r=>{r.draw(this.renderedContext_),r.clear()}),t[e[n]].length=0}},c_=class l_ extends Sc{constructor(t,e,n,s,r,o,l){super(),this.context_=t,this.pixelRatio_=e,this.extent_=n,this.transform_=s,this.transformRotation_=s?Hn(Math.atan2(s[1],s[0]),10):0,this.viewRotation_=r,this.squaredTolerance_=o,this.userTransform_=l,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=Wt()}drawImages_(t,e,n,s){if(!this.image_)return;const r=Te(t,e,n,s,this.transform_,this.pixelCoordinates_),o=this.context_,l=this.tmpLocalTransform_,c=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=c*this.imageOpacity_);let h=this.imageRotation_;0===this.transformRotation_&&(h-=this.viewRotation_),this.imageRotateWithView_&&(h+=this.viewRotation_);for(let d=0,u=r.length;d<u;d+=2){const f=r[d]-this.imageAnchorX_,g=r[d+1]-this.imageAnchorY_;if(0!==h||1!=this.imageScale_[0]||1!=this.imageScale_[1]){const m=f+this.imageAnchorX_,p=g+this.imageAnchorY_;_e(l,m,p,1,1,h,-m,-p),o.save(),o.transform.apply(o,l),o.translate(m,p),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.restore()}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,f,g,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=c)}drawText_(t,e,n,s){if(!this.textState_||""===this.text_)return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const r=Te(t,e,n,s,this.transform_,this.pixelCoordinates_),o=this.context_;let l=this.textRotation_;for(0===this.transformRotation_&&(l-=this.viewRotation_),this.textRotateWithView_&&(l+=this.viewRotation_);e<n;e+=s){const c=r[e]+this.textOffsetX_,h=r[e+1]+this.textOffsetY_;0!==l||1!=this.textScale_[0]||1!=this.textScale_[1]?(o.save(),o.translate(c-this.textOffsetX_,h-this.textOffsetY_),o.rotate(l),o.translate(this.textOffsetX_,this.textOffsetY_),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.restore()):(this.textStrokeState_&&o.strokeText(this.text_,c,h),this.textFillState_&&o.fillText(this.text_,c,h))}}moveToLineTo_(t,e,n,s,r,o){const l=this.context_;let c=Te(t,e,n,s,this.transform_,this.pixelCoordinates_);if(Math.abs(o)>0){const d=c.length,u=r||Math.abs(c[0]-c[d-2])<1e-6&&Math.abs(c[1]-c[d-1])<1e-6;c=vc(c,0,d,2,o,u,c),xc(c,2,u)}l.moveTo(c[0],c[1]);let h=c.length;r&&(h-=2);for(let d=2;d<h;d+=2)l.lineTo(c[d],c[d+1]);return r&&l.closePath(),n}drawRings_(t,e,n,s,r){for(let o=0,l=n.length;o<l;++o)e=this.moveToLineTo_(t,e,n[o],s,!0,r);return e}drawCircle(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Gt(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=function Wu(i,t,e){const n=i.getFlatCoordinates();if(!n)return null;const s=i.getStride();return Te(n,0,n.length,s,t,e)}(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],s=e[3]-e[1],r=Math.sqrt(n*n+s*s),o=this.context_;o.beginPath(),o.arc(e[0],e[1],r,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}}setStyle(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())}setTransform(t){this.transform_=t}drawGeometry(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t)}}drawFeature(t,e){const n=e.getGeometryFunction()(t);n&&(this.setStyle(e),this.drawGeometry(n))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let n=0,s=e.length;n<s;++n)this.drawGeometry(e[n])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Gt(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1,this.strokeState_.strokeOffset),e.stroke()}if(""!==this.text_){const e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getExtent();if(Gt(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const n=this.context_,s=t.getFlatCoordinates();let r=0;const o=t.getEnds(),l=t.getStride();n.beginPath();for(let c=0,h=o.length;c<h;++c)r=this.moveToLineTo_(s,r,o[c],l,!1,this.strokeState_.strokeOffset);n.stroke()}if(""!==this.text_){const n=t.getFlatMidpoints();this.drawText_(n,0,n.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Gt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride(),this.strokeState_?.strokeOffset),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){const e=t.getFlatInteriorPoint();this.drawText_(e,0,2,2)}}}drawMultiPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Gt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_,n=t.getOrientedFlatCoordinates();let s=0;const r=t.getEndss(),o=t.getStride();e.beginPath();for(let l=0,c=r.length;l<c;++l)s=this.drawRings_(n,s,r[l],o,this.strokeState_?.strokeOffset);this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){const e=t.getFlatInteriorPoints();this.drawText_(e,0,e.length,2)}}}setContextFillState_(t){const e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const e=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),Oe(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset,e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})}setContextTextState_(t){const e=this.context_,n=this.contextTextState_,s=t.textAlign?t.textAlign:"center";n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=s&&(n.textAlign=s,e.textAlign=s),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=s,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:s,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(t){const n=t.getColor();this.fillState_={fillStyle:re(n||"#000")}}else this.fillState_=null;if(e){const n=e.getColor(),s=e.getLineCap(),r=e.getLineDash(),o=e.getLineDashOffset(),l=e.getLineJoin(),c=e.getWidth(),h=e.getMiterLimit(),d=r||Se,u=e.getOffset();
1this.strokeState_={lineCap:void 0!==s?s:"round",lineDash:1===this.pixelRatio_?d:d.map(f=>f*this.pixelRatio_),lineDashOffset:(o||0)*this.pixelRatio_,lineJoin:void 0!==l?l:"round",lineWidth:(void 0!==c?c:1)*this.pixelRatio_,miterLimit:void 0!==h?h:10,strokeStyle:re(n||"#000"),strokeOffset:(u??0)*this.pixelRatio_}}else this.strokeState_=null}setImageStyle(t){let e;if(!t||!(e=t.getSize()))return void(this.image_=null);const n=t.getPixelRatio(this.pixelRatio_),s=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=s[0]*n,this.imageAnchorY_=s[1]*n,this.imageHeight_=e[1]*n,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const o=t.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/n,o[1]*this.pixelRatio_/n],this.imageWidth_=e[0]*n}setTextStyle(t){if(t){const e=t.getFill();if(e){const g=e.getColor();this.textFillState_={fillStyle:re(g||"#000")}}else this.textFillState_=null;const n=t.getStroke();if(n){const g=n.getColor(),m=n.getLineCap(),p=n.getLineDash(),_=n.getLineDashOffset(),y=n.getLineJoin(),b=n.getWidth(),E=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==m?m:"round",lineDash:p||Se,lineDashOffset:_||0,lineJoin:void 0!==y?y:"round",lineWidth:void 0!==b?b:1,miterLimit:void 0!==E?E:10,strokeStyle:re(g||"#000")}}else this.textStrokeState_=null;const s=t.getFont(),r=t.getOffsetX(),o=t.getOffsetY(),l=t.getRotateWithView(),c=t.getRotation(),h=t.getScaleArray(),d=t.getText(),u=t.getTextAlign(),f=t.getTextBaseline();this.textState_={font:void 0!==s?s:cc,textAlign:void 0!==u?u:"center",textBaseline:void 0!==f?f:"middle"},this.text_=void 0!==d?Array.isArray(d)?d.reduce((g,m,p)=>g+(p%2?" ":m),""):d:"",this.textOffsetX_=void 0!==r?this.pixelRatio_*r:0,this.textOffsetY_=void 0!==o?this.pixelRatio_*o:0,this.textRotateWithView_=void 0!==l&&l,this.textRotation_=void 0!==c?c:0,this.textScale_=[this.pixelRatio_*h[0],this.pixelRatio_*h[1]]}else this.text_=""}},Ac={Point:function b_(i,t,e,n,s,r){const o=e.getImage(),l=e.getText(),c=l&&l.getText(),h=r&&o&&c?{}:void 0;if(o){if(2!=o.getImageState())return;const d=i.getBuilder(e.getZIndex(),"Image");d.setImageStyle(o,h),d.drawPoint(t,n,s)}if(c){const d=i.getBuilder(e.getZIndex(),"Text");d.setTextStyle(l,h),d.drawText(t,n,s)}},LineString:function __(i,t,e,n,s){const r=e.getStroke();if(r){const l=i.getBuilder(e.getZIndex(),"LineString");l.setFillStrokeStyle(null,r),l.drawLineString(t,n,s)}const o=e.getText();if(o&&o.getText()){const l=i.getBuilder(e.getZIndex(),"Text");l.setTextStyle(o),l.drawText(t,n,s)}},Polygon:function E_(i,t,e,n,s){const r=e.getFill(),o=e.getStroke();if(r||o){const c=i.getBuilder(e.getZIndex(),"Polygon");c.setFillStrokeStyle(r,o),c.drawPolygon(t,n,s)}const l=e.getText();if(l&&l.getText()){const c=i.getBuilder(e.getZIndex(),"Text");c.setTextStyle(l),c.drawText(t,n,s)}},MultiPoint:function S_(i,t,e,n,s,r){const o=e.getImage(),l=o&&0!==o.getOpacity(),c=e.getText(),h=c&&c.getText(),d=r&&l&&h?{}:void 0;if(l){if(2!=o.getImageState())return;const u=i.getBuilder(e.getZIndex(),"Image");u.setImageStyle(o,d),u.drawMultiPoint(t,n,s)}if(h){const u=i.getBuilder(e.getZIndex(),"Text");u.setTextStyle(c,d),u.drawText(t,n,s)}},MultiLineString:function y_(i,t,e,n,s){const r=e.getStroke();if(r){const l=i.getBuilder(e.getZIndex(),"LineString");l.setFillStrokeStyle(null,r),l.drawMultiLineString(t,n,s)}const o=e.getText();if(o&&o.getText()){const l=i.getBuilder(e.getZIndex(),"Text");l.setTextStyle(o),l.drawText(t,n,s)}},MultiPolygon:function C_(i,t,e,n,s){const r=e.getFill(),o=e.getStroke();if(o||r){const c=i.getBuilder(e.getZIndex(),"Polygon");c.setFillStrokeStyle(r,o),c.drawMultiPolygon(t,n,s)}const l=e.getText();if(l&&l.getText()){const c=i.getBuilder(e.getZIndex(),"Text");c.setTextStyle(l),c.drawText(t,n,s)}},GeometryCollection:function p_(i,t,e,n,s,r){const o=t.getGeometriesArray();let l,c;for(l=0,c=o.length;l<c;++l)(0,Ac[o[l].getType()])(i,o[l],e,n,s,r)},Circle:function g_(i,t,e,n,s){const r=e.getFill(),o=e.getStroke();if(r||o){const c=i.getBuilder(e.getZIndex(),"Circle");c.setFillStrokeStyle(r,o),c.drawCircle(t,n,s)}const l=e.getText();if(l&&l.getText()){const c=i.getBuilder(e.getZIndex(),"Text");c.setTextStyle(l),c.drawText(t,n,s)}}};function f_(i,t){return parseInt(at(i),10)-parseInt(at(t),10)}function Tc(i,t){const e=kc(i,t);return e*e}function kc(i,t){return.5*i/t}function Dc(i,t,e,n,s,r,o,l){const c=[],h=e.getImage();if(h){let f=!0;const g=h.getImageState();2==g||3==g?f=!1:0==g&&h.load(),f&&c.push(h.ready())}
1const d=e.getFill();d&&d.loading()&&c.push(d.ready());const u=c.length>0;return u&&Promise.all(c).then(()=>s(null)),function m_(i,t,e,n,s,r,o){const l=e.getGeometryFunction()(t);if(!l)return;const c=l.simplifyTransformed(n,s);e.getRenderer()?Lc(i,c,e,t,o):(0,Ac[c.getType()])(i,c,e,t,o,r)}(i,t,e,n,r,o,l),u}function Lc(i,t,e,n,s){if("GeometryCollection"==t.getType()){const o=t.getGeometries();for(let l=0,c=o.length;l<c;++l)Lc(i,o[l],e,n,s);return}i.getBuilder(e.getZIndex(),"Default").drawCustom(t,n,e.getRenderer(),e.getHitDetectionRenderer(),s)}const x_=class v_ extends ua{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=new Array,this.maxStaleKeys=5}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}updateStaleKeys(t){this.renderedSourceKey_?this.renderedSourceKey_!==t&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=t):this.renderedSourceKey_=t}getFeatures(t){return L()}getData(t){return null}prepareFrame(t){return L()}renderFrame(t,e){return L()}forEachFeatureAtCoordinate(t,e,n,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(2===e.getState()||3===e.getState())&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return 2!=e&&3!=e&&t.addEventListener("change",this.boundHandleImageChange_),0==e&&(t.load(),e=t.getState()),2==e}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}},Nc=[];let jn=null;const O_=class I_ extends x_{constructor(t){super(t),this.container=null,this.tempTransform=Wt(),this.pixelTransform=Wt(),this.inversePixelTransform=Wt(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(t,e,n){let s;jn||function M_(){jn=St(1,1,void 0,{willReadFrequently:!0})}(),jn.clearRect(0,0,1,1);try{jn.drawImage(t,e,n,1,1,0,0,1,1),s=jn.getImageData(0,0,1,1).data}catch{return jn=null,null}return s}getBackground(t){let n=this.getLayer().getBackground();return"function"==typeof n&&(n=n(t.viewState.resolution)),n||void 0}useContainer(t,e,n,s,r){if(ie(t)&&0===this.pixelTransform[1]&&0===this.pixelTransform[2]&&0===this.pixelTransform[4]&&0===this.pixelTransform[5]&&t.width===s&&t.height===r){const h=t,d=h.getContext("2d");if(d)return this.container=t,this.context=d,this.containerReused=!0,void(n&&(d.fillStyle=n,d.fillRect(0,0,h.width,h.height)))}const o=this.getLayer().getClassName();let l,c;if(t&&t.className===o&&(!n||t&&t.style.backgroundColor&&Oe(dn(t.style.backgroundColor),dn(n)))){const h=t.firstElementChild;ie(h)&&(c=h.getContext("2d"))}if(c&&function Lu(i,t){const e=gr(i),n=gr(t);for(let s=0;s<6;++s)if(0!==Math.round((e[s]-n[s])*Du[s]))return!1;return!0}(c.canvas.style.transform,e)?(this.container=t,this.context=c,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){l=fe?Cl():document.createElement("div"),l.className=o;let h=l.style;h.position="absolute",h.width="100%",h.height="100%",c=St();const d=c.canvas;l.appendChild(d),h=d.style,h.position="absolute",h.left="0",h.transformOrigin="top left",this.container=l,this.context=c}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(t,e,n){const s=Js(n),r=qs(n),o=$s(n),l=Hs(n);Mt(e.coordinateToPixelTransform,s),Mt(e.coordinateToPixelTransform,r),Mt(e.coordinateToPixelTransform,o),Mt(e.coordinateToPixelTransform,l);const c=this.inversePixelTransform;Mt(c,s),Mt(c,r),Mt(c,o),Mt(c,l),t.save(),t.beginPath(),t.moveTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])
1),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(l[0]),Math.round(l[1])),t.clip()}prepareContainer(t,e){const n=t.extent,s=t.viewState.resolution,r=t.viewState.rotation,o=t.pixelRatio,l=Math.round(pt(n)/s*o),c=Math.round(qt(n)/s*o);_e(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/o,1/o,r,-l/2,-c/2),fr(this.inversePixelTransform,this.pixelTransform);const h=function Qa(i){return"matrix("+i.join(", ")+")"}(this.pixelTransform),d=this.getBackground(t);if(this.useContainer(e,h,d,l,c),!this.containerReused){const u=this.context.canvas;u.width!=l||u.height!=c?(u.width=l,u.height=c):this.context.clearRect(0,0,l,c),h!==u.style.transform&&(u.style.transform=h)}}dispatchRenderEvent_(t,e,n){const s=this.getLayer();if(s.hasListener(t)){const r=new lc(t,this.inversePixelTransform,n,e);s.dispatchEvent(r)}}preRender(t,e){this.frameState=e,!e.declutter&&this.dispatchRenderEvent_("prerender",t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_("postrender",t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new Mc),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_("prerender",this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_("postrender",this.context,t))}getRenderTransform(t,e,n,s,r,o,l){const d=s/e;return _e(this.tempTransform,r/2,o/2,d,-d,-n,-t[0]+l,-t[1])}disposeInternal(){delete this.frameState,super.disposeInternal()}},R_=class P_ extends O_{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.hitDetectionImageData_=null,this.clipExtent_=null,this.extendX_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=[1/0,1/0,-1/0,-1/0],this.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=null,this.opacity_=1}renderWorlds(t,e,n){const s=e.extent,r=e.viewState,o=r.center,l=r.resolution,c=r.projection,h=r.rotation,d=c.getExtent(),u=this.getLayer().getSource(),f=this.getLayer().getDeclutter(),g=e.pixelRatio,m=e.viewHints,p=!(m[0]||m[1]),_=this.context,y=Math.round(pt(s)/l*g),b=Math.round(qt(s)/l*g),E=u.getWrapX()&&c.canWrapX(),C=E?pt(d):null,w=E?Math.ceil((s[2]-d[2])/C)+(this.extendX_?2:1):1;let v=E?Math.floor((s[0]-d[0])/C)-(this.extendX_?1:0):0;do{let F=this.getRenderTransform(o,l,0,g,y,b,v*C);e.declutter&&(F=F.slice(0)),t.execute(_,[_.canvas.width,_.canvas.height],F,h,p,void 0===n?_n:n?Pc:i_,n?f&&e.declutter[f]:void 0)}while(++v<w)}setDrawContext_(){1!==this.opacity_&&(this.targetContext_=this.context,this.context=St(this.context.canvas.width,this.context.canvas.height,Nc))}resetDrawContext_(){if(1!==this.opacity_&&this.targetContext_){const t=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=t,function Ef(i){const t=i.canvas;t.width=1,t.height=1,i.clearRect(0,0,1,1)}(this.context),Nc.push(this.context.canvas),this.context=this.targetContext_,this.targetContext_=null}}renderDeclutter(t){!this.replayGroup_||!this.getLayer().getDeclutter()||this.renderWorlds(this.replayGroup_,t,!0)}renderDeferredInternal(t){this.replayGroup_&&(this.clipExtent_&&this.clipUnrotated(this.context,t,this.clipExtent_),this.replayGroup_.renderDeferred(),this.clipExtent_&&(this.context.restore(),this.clipExtent_=null),this.resetDrawContext_())}renderFrame(t,e){const n=t.layerStatesArray[t.layerIndex];this.opacity_=n.opacity;const s=t.viewState;this.prepareContainer(t,e);const r=this.context,o=this.replayGroup_;let l=o&&!o.isEmpty();if(!l&&!this.getLayer().hasListener("prerender")&&!this.getLayer().hasListener("postrender"))return this.container;this.setDrawContext_(),this.preRender(r,t);this.clipExtent_=null;let h=!1;if(l&&n.extent&&this.clipping){const d=On(n.extent);l=Gt(d,t.extent),l&&!Fe(d,t.extent)&&(t.declutter?this.clipExtent_=d:(this.clipUnrotated(r,t,d),h=!0))}return l&&this.renderWorlds(o,t,!this.getLayer().getDeclutter()&&void 0),h&&r.restore(
1),this.postRender(r,t),this.renderedRotation_!==s.rotation&&(this.renderedRotation_=s.rotation,this.hitDetectionImageData_=null),t.declutter||this.resetDrawContext_(),this.container}getFeatures(t){return new Promise(e=>{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const n=this.frameState.size.slice(),s=this.renderedCenter_,r=this.renderedResolution_,o=this.renderedRotation_,l=this.renderedProjection_,c=this.wrappedRenderedExtent_,h=this.getLayer(),d=[],u=.5*n[0],f=.5*n[1];d.push(this.getRenderTransform(s,r,o,.5,u,f,0).slice());const g=h.getSource(),m=l.getExtent();if(g.getWrapX()&&l.canWrapX()&&!Fe(m,c)){let _=c[0];const y=pt(m);let E,b=0;for(;_<m[0];)--b,E=y*b,d.push(this.getRenderTransform(s,r,o,.5,u,f,E).slice()),_+=y;for(b=0,_=c[2];_>m[2];)++b,E=y*b,d.push(this.getRenderTransform(s,r,o,.5,u,f,E).slice()),_-=y}const p=Hi();this.hitDetectionImageData_=function h_(i,t,e,n,s,r,o,l,c){const h=c?$i(s):s,f=St(.5*i[0],.5*i[1]);f.imageSmoothingEnabled=!1;const g=f.canvas,m=new c_(f,.5,s,null,o,l,c?In(Hi(),c):null),p=e.length,_=Math.floor(16777215/p),y={};for(let E=1;E<=p;++E){const C=e[E-1],w=C.getStyleFunction()||n;if(!w)continue;let v=w(C,r);if(!v)continue;Array.isArray(v)||(v=[v]);const O=(E*_).toString(16).padStart(7,"#00000");for(let x=0,M=v.length;x<M;++x){const z=v[x],U=z.getGeometryFunction()(C);if(!U||!Gt(h,U.getExtent()))continue;const V=z.clone(),$=V.getFill();$&&$.setColor(O);const Tt=V.getStroke();Tt&&(Tt.setColor(O),Tt.setLineDash(null)),V.setText(void 0);const A=z.getImage();if(A){const G=A.getImageSize();if(!G)continue;const ht=St(G[0],G[1],void 0,{alpha:!1}),mt=ht.canvas;ht.fillStyle=O,ht.fillRect(0,0,mt.width,mt.height),V.setImage(new Hl({img:mt,anchor:A.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:A.getOrigin(),opacity:1,size:A.getSize(),scale:A.getScale(),rotation:A.getRotation(),rotateWithView:A.getRotateWithView()}))}const q=V.getZIndex()||0;let N=y[q];N||(N={},y[q]=N,N.Polygon=[],N.Circle=[],N.LineString=[],N.Point=[]);const Q=U.getType();if("GeometryCollection"===Q){const G=U.getGeometriesArrayRecursive();for(let ht=0,mt=G.length;ht<mt;++ht){const Xe=G[ht];N[Xe.getType().replace("Multi","")].push(Xe,V)}}else N[Q.replace("Multi","")].push(U,V)}}const b=Object.keys(y).map(Number).sort(Ie);for(let E=0,C=b.length;E<C;++E){const w=y[b[E]];for(const v in w){const F=w[v];for(let O=0,x=F.length;O<x;O+=2){m.setStyle(F[O+1]);for(let M=0,z=t.length;M<z;++M)m.setTransform(t[M]),m.drawGeometry(F[O])}}}return f.getImageData(0,0,g.width,g.height)}(n,d,this.renderedFeatures_,h.getStyleFunction(),c,r,o,Tc(r,this.renderedPixelRatio_),p?l:null)}e(function d_(i,t,e){const n=[];if(e){const s=Math.floor(.5*Math.round(i[0])),r=Math.floor(.5*Math.round(i[1])),o=4*(lt(s,0,e.width-1)+lt(r,0,e.height-1)*e.width),d=e.data[o+2]+256*(e.data[o+1]+256*e.data[o]),u=Math.floor(16777215/t.length);d&&d%u===0&&n.push(t[d/u-1])}return n}(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,n,s,r){if(!this.replayGroup_)return;const o=e.viewState.resolution,l=e.viewState.rotation,c=this.getLayer(),h={},u=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(t,o,l,n,function(f,g,m){const p=at(f),_=h[p];if(_){if(!0!==_&&m<_.distanceSq){if(0===m)return h[p]=!0,r.splice(r.lastIndexOf(_),1),s(f,c,g);_.geometry=g,_.distanceSq=m}}else{if(0===m)return h[p]=!0,s(f,c,g);r.push(h[p]={feature:f,layer:c,geometry:g,distanceSq:m,callback:s})}},u?e.declutter?.[u]?.all().map(f=>f.value):null)}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),n=e.getSource();if(!n)return!1;const s=t.viewHints[0],r=t.viewHints[1],o=e.getUpdateWhileAnimating(),l=e.getUpdateWhileInteracting();if(this.ready&&!o&&s||!l&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const c=t.extent,h=t.viewState,d=h.projection,u=h.resolution,f=t.pixelRatio,g=e.getRevision(),m=e.getRenderBuffer();let p=e.getRenderOrder();void 0===p&&(p=f_);const _=h.center.slice(),y=Vs(c,m*u),b=y.slice(),E=[y.slice()],C=d.getExtent(),w=n.getWrapX()&&d.canWrapX();if(this.extendX_=!1,w){const A=n.getExtent();A&&!En(A)&&(this.extendX_=A[0]<C[0]||A[2]>C[2])}
vendor: 4,617 bytes, line 1
1if(w&&(!Fe(C,t.extent)||this.extendX_)){const A=pt(C),q=Math.max(pt(y)/2,A);let N=C[0],Q=C[2];this.extendX_&&(N-=A,Q+=A),y[0]=N-q,y[2]=Q+q,Pa(_,d);const G=xa(E[0],d);G[0]<C[0]&&G[2]<C[2]?E.push([G[0]+A,G[1],G[2]+A,G[3]]):G[0]>C[0]&&G[2]>C[2]&&E.push([G[0]-A,G[1],G[2]-A,G[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedPixelRatio_===f&&this.renderedRevision_==g&&this.renderedRenderOrder_==p&&this.renderedFrameDeclutter_===!!t.declutter&&Fe(this.wrappedRenderedExtent_,y))return Oe(this.renderedExtent_,b)||(this.hitDetectionImageData_=null,this.renderedExtent_=b),this.renderedCenter_=_,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const v=new Hp(kc(u,f),y,u,f),F=Hi();let O;if(F){for(let A=0,q=E.length;A<q;++A){const Q=$i(E[A]);n.loadFeatures(Q,Ru(u),F)}O=In(F,d)}else for(let A=0,q=E.length;A<q;++A)n.loadFeatures(E[A],u,d);const x=Tc(u,f);let M=!0;const z=(A,q)=>{let N;const Q=A.getStyleFunction()||e.getStyleFunction();if(Q&&(N=Q(A,u)),N){const G=this.renderFeature(A,x,N,v,O,this.getLayer().getDeclutter(),q);M=M&&!G}},U=$i(y),V=n.getFeaturesInExtent(U);p&&V.sort(p);for(let A=0,q=V.length;A<q;++A)z(V[A],A);this.renderedFeatures_=V,this.ready=M;const $=v.finish(),Tt=new a_(y,u,f,n.getOverlaps(),$,e.getRenderBuffer(),!!t.declutter);return this.renderedResolution_=u,this.renderedRevision_=g,this.renderedRenderOrder_=p,this.renderedFrameDeclutter_=!!t.declutter,this.renderedExtent_=b,this.wrappedRenderedExtent_=y,this.renderedCenter_=_,this.renderedProjection_=d,this.renderedPixelRatio_=f,this.replayGroup_=Tt,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,n,s,r,o,l){if(!n)return!1;let c=!1;if(Array.isArray(n))for(let h=0,d=n.length;h<d;++h)c=Dc(s,t,n[h],e,this.boundHandleStyleImageChange_,r,o,l)||c;else c=Dc(s,t,n,e,this.boundHandleStyleImageChange_,r,o,l);return c}},A_=class F_ extends ac{constructor(t){super(t)}createRenderer(){return new R_(this)}},k_=class T_ extends Zt{constructor(t){super(),this.options=t,this.id=t.id,this.insertFirst=void 0===t.insertFirst||t.insertFirst,this.stopEvent=void 0===t.stopEvent||t.stopEvent,this.element=document.createElement("div"),this.element.className=void 0!==t.className?t.className:"ol-overlay-container ol-selectable",this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=!0===t.autoPan?{}:t.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener("element",this.handleElementChanged),this.addChangeListener("map",this.handleMapChanged),this.addChangeListener("offset",this.handleOffsetChanged),this.addChangeListener("position",this.handlePositionChanged),this.addChangeListener("positioning",this.handlePositioningChanged),void 0!==t.element&&this.setElement(t.element),this.setOffset(void 0!==t.offset?t.offset:[0,0]),this.setPositioning(t.positioning||"top-left"),void 0!==t.position&&this.setPosition(t.position)}getElement(){return this.get("element")}getId(){return this.id}getMap(){return this.get("map")||null}getOffset(){return this.get("offset")}getPosition(){return this.get("position")}getPositioning(){return this.get("positioning")}handleElementChanged(){yl(this.element);const t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(this.element?.remove(),et(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const t=this.getMap();if(t){this.mapPostrenderListenerKey=K(t,"postrender",this.render,this),this.updatePixelPosition();const e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(t){this.set("element",t)}setMap(t){this.set("map",t)}setOffset(t){this.set("offset",t)}setPosition(t){this.set("position",t)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(t){const e=this.getMap();if(!e||!e.getTargetElement()||!this.get("position"))return;const n=this.getRect(e.getTargetElement(),e.getSize()),s=this.getElement(),r=this.getRect(s,[wf(s),vf(s)]),o=void 0===(t=t||{}).margin?20:t.margin;if(!Fe(n,r)){const l=r[0]-n[0],c=n[2]-r[2],h=r[1]-n[1],d=n[3]-r[3],u=[0,0];if(l<0?u[0]=l-o:c<0&&(u[0]=Math.abs(c)+o),h<0?u[1]=h-o:d<0&&(u[1]=Math.abs(d)+o),0!==u[0]||0!==u[1]){const f=e.getView().getCenterInternal(),g=e.getPixelFromCo
1ordinateInternal(f);if(!g)return;const m=[g[0]+u[0],g[1]+u[1]],p=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(m),duration:p.duration,easing:p.easing})}}}getRect(t,e){const n=t.getBoundingClientRect(),s=n.left+window.pageXOffset,r=n.top+window.pageYOffset;return[s,r,s+e[0],r+e[1]]}setPositioning(t){this.set("positioning",t)}setVisible(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)}updatePixelPosition(){const t=this.getMap(),e=this.getPosition();if(!t||!t.isRendered()||!e)return void this.setVisible(!1);const n=t.getPixelFromCoordinate(e),s=t.getSize();this.updateRenderedPosition(n,s)}updateRenderedPosition(t,e){const n=this.element.style,s=this.getOffset(),r=this.getPositioning();this.setVisible(!0);let c="0%",h="0%";"bottom-right"==r||"center-right"==r||"top-right"==r?c="-100%":("bottom-center"==r||"center-center"==r||"top-center"==r)&&(c="-50%"),"bottom-left"==r||"bottom-center"==r||"bottom-right"==r?h="-100%":("center-left"==r||"center-center"==r||"center-right"==r)&&(h="-50%");const d=`translate(${c}, ${h}) translate(${t[0]+s[0]}px, ${t[1]+s[1]}px)`;this.rendered.transform_!=d&&(this.rendered.transform_=d,n.transform=d)}getOptions(){return this.options}};function jc(i,t){return function(e,n,s,r,o){!function D_(i,t,e,n,s,r,o){const l=new XMLHttpRequest;l.open("GET","function"==typeof i?i(e,n,s):i,!0),"arraybuffer"==t.getType()&&(l.responseType="arraybuffer"),l.withCredentials=false,l.onload=function(c){if(!l.status||l.status>=200&&l.status<300){const h=t.getType();try{let d;"text"==h||"json"==h?d=l.responseText:"xml"==h?d=l.responseXML||l.responseText:"arraybuffer"==h&&(d=l.response),d?r(t.readFeatures(d,{extent:e,featureProjection:s}),t.readProjection(d)):o()}catch{o()}}else o()},l.onerror=o,l.send()}(i,t,e,n,s,(l,c)=>{this.addFeatures(l),void 0!==r&&r(l)},()=>{this.changed(),void 0!==o&&o()})}}function j_(i,t){return[[-1/0,-1/0,1/0,1/0]]}const Bc=class B_{constructor(t){this.rbush_=new Ol(t),this.items_={}}insert(t,e){const n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[at(e)]=n}load(t,e){const n=new Array(e.length);for(let s=0,r=e.length;s<r;s++){const o=t[s],l=e[s],c={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:l};n[s]=c,this.items_[at(l)]=c}this.rbush_.load(n)}remove(t){const e=at(t),n=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(n)}update(t,e){const n=this.items_[at(e)];Ys([n.minX,n.minY,n.maxX,n.maxY],t)||(this.remove(e),this.insert(t,e))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(t){return this.rbush_.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}).map(function(s){return s.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let n;for(let s=0,r=t.length;s<r;s++)if(n=e(t[s]),n)return n;return n}isEmpty(){return Ze(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return tn(e.minX,e.minY,e.maxX,e.maxY,t)}concat(t){this.rbush_.load(t.rbush_.all());for(const e in t.items_)this.items_[e]=t.items_[e]}};function Vc(i){return i?"function"==typeof i?i:(Array.isArray(i)||(i=[i]),t=>i):null}const W_=class V_ extends Zt{constructor(t){super(),this.projection=nt(t.projection),this.attributions_=Vc(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,this.loading=!1,this.state_=void 0!==t.state?t.state:"ready",this.wrapX_=void 0!==t.wrapX&&t.wrapX,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(n,s){e.viewResolver=n,e.viewRejector=s})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}ready(){const t=this.getState();return"ready"===t?Promise.resolve():"error"===t?Promise.reject(new Error("Source failed to load")):new Promise((e,n)=>{const s=()=>{const r=this.getState();"ready"===r?(this.un("change",s),e()):"error"===r&&(this.un("change",s),n(new Error("Source failed to load")))};this.on("change",s)})}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=Vc(t),this.changed()}setState(t){this.state_=t,this.changed()}};class Ke extends Pe{constructor(t,e,n){super(t),this.feature=e,this.features=n}}const K_=class z_ extends W_{constructor(t){super({attributions:(t=t||{}).attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===t.wrapX||t.wrapX}),this.loader_=Xn,this.format_=t.format||null,this.overlaps_=void 0===t.overlaps||t.overlaps,this.url_=t.url,void 0!==t.loader?this.loader_=t.loader:void 0!==this.url_&&(st(this.format_,"`format` must be set when `url` is set"),this.loader_=jc(this.url_,this.format_)),this.strategy_=void 0!==t.strategy?t.strategy:j_;const e=void 0===t.useSpatialIndex||t.useSpatialIndex;let n,s;this.featuresRtree_=e?new Bc:null,this.loadedExtentsRtree_=new Bc,this.nullGeometryFeatures_={}
vendor: 6,903 bytes, line 1
1,this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,Array.isArray(t.features)?s=t.features:t.features&&(n=t.features,s=n.getArray()),!e&&void 0===n&&(n=new Bt(s)),void 0!==s&&this.addFeaturesInternal(s),void 0!==n&&this.bindFeaturesCollection_(n)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=at(t);if(!this.addToIndex_(e,t))return void(this.featuresCollection_&&this.featuresCollection_.remove(t));this.setupChangeEvents_(e,t);const n=t.getGeometry();if(n){const s=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(s,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Ke("addfeature",t))}setupChangeEvents_(t,e){e instanceof Be||(this.featureChangeKeys_[t]=[K(e,"change",this.handleFeatureChange_,this),K(e,"propertychange",this.handleFeatureChange_,this)])}addToIndex_(t,e){let n=!0;if(void 0!==e.getId()){const s=String(e.getId());if(s in this.idIndex_)if(e instanceof Be){const r=this.idIndex_[s];r instanceof Be?Array.isArray(r)?r.push(e):this.idIndex_[s]=[r,e]:n=!1}else n=!1;else this.idIndex_[s]=e}return n&&(st(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),n}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],n=[],s=[];for(let r=0,o=t.length;r<o;r++){const l=t[r],c=at(l);this.addToIndex_(c,l)&&n.push(l)}for(let r=0,o=n.length;r<o;r++){const l=n[r],c=at(l);this.setupChangeEvents_(c,l);const h=l.getGeometry();if(h){const d=h.getExtent();e.push(d),s.push(l)}else this.nullGeometryFeatures_[c]=l}if(this.featuresRtree_&&this.featuresRtree_.load(e,s),this.hasListener("addfeature"))for(let r=0,o=n.length;r<o;r++)this.dispatchEvent(new Ke("addfeature",n[r]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener("addfeature",function(n){e||(e=!0,t.push(n.feature),e=!1)}),this.addEventListener("removefeature",function(n){e||(e=!0,t.remove(n.feature),e=!1)}),t.addEventListener("add",n=>{e||(e=!0,this.addFeature(n.element),e=!1)}),t.addEventListener("remove",n=>{e||(e=!0,this.removeFeature(n.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const n in this.featureChangeKeys_)this.featureChangeKeys_[n].forEach(et);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(n=>{this.removeFeatureInternal(n)});for(const n in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new Ke("clear");this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){return this.forEachFeatureInExtent([t[0],t[1],t[0],t[1]],function(s){const r=s.getGeometry();if(r instanceof Be||r.intersectsCoordinate(t))return e(s)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(n){const s=n.getGeometry();if(s instanceof Be||s.intersectsExtent(t)){const r=e(n);if(r)return r}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Ze(this.nullGeometryFeatures_)||ee(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(n){e.push(n)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const s=function Nd(i,t,e){if(t.canWrapX()){const n=t.getExtent();if(!isFinite(i[0])||!isFinite(i[2]))return[[n[0],i[1],n[2],i[3]]];xa(i,t);const s=pt(n);if(pt(i)>s&&!e)return[[n[0],i[1],n[2],i[3]]];if(i[0]<n[0])return[[i[0]+s,i[1],n[2],i[3]],[n[0],i[1],i[2],i[3]]];if(i[2]>n[2])return[[i[0],i[1],n[2],i[3]],[n[0],i[1],i[2]-s,i[3]]]}return[i]}(t,e);return[].concat(...s.map(r=>this.featuresRtree_.getInExtent(r)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const n=t[0],s=t[1];let r=null;const o=[NaN,NaN];let l=1/0;const c=[-1/0,-1/0,1/0,1/0];return e=e||Kn,this.featuresRtree_.forEachInExtent(c,function(h){if(e(h)){const d=h.getGeometry(),u=l;if(l=d instanceof Be?0:d.closestPointXY(n,s,o,l),l<u){r=h;const f=Math.sqrt(l);c[0]=n-f,c[1]=s-f,c[2]=n+f,c[3]=s+f}}}),r}getExtent(t){return this.featuresRtree_?.getExtent(t)??null}getFeatureById(t){const e=this.idIndex_[t.toString()];return void 0!==e?e:null}getFeatureByUid(t){const e=this.uidIndex_[t];return void 0!==e?e:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(t){const e=t.target,n=at(e),s=e.getGeometry();if(s){const o=s.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}else n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);const r=e.getId();if(void 0!==r){const o=r.toString();this.idIndex_[o]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[o]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new Ke("changefeature",e))}hasFeature(t){const e=t.getId();if(void 0!==e){const n=this.idIndex_[String(e)];return Array.isArray(n)?n.includes(t):n===t}return at(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&Ze(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()}loadFeatures(t,e,n){const s=this.loadedExtentsRtree_,r=this.strategy_(t,e,n);for(let o=0,l=r.length;o<l;++o){const c=r[o];if(!s.forEachInExtent(c,function(d){return Fe(d.extent,c)})){this.loading=Number(this.loading)+1,this.dispatchEvent(new Ke("featuresloadstart"));const d=m=>{this.loading=Number(this.loading)-1,this.dispatchEvent(new Ke("featuresloadend",void 0,m))},u=()=>{this.changed(),this.loading=Number(this.loading)-1,this.dispatchEvent(new Ke("featuresloaderror"))};let f=!1;const g=this.loader_.call(this,c,e,n,m=>f||d(m),()=>f||u());g instanceof Promise?(f=!0,g.then(m=>{this.addFeatures(m),d(m)}).catch(u)):this.loader_.length<4&&(this.loading=!1),s.insert(c,{extent:c.slice()})}}}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_,n=[];e.forEachInExtent(t,function(s){n.push(s)}
1),n.forEach(s=>{e.remove(s);const r=function va(i,t){if(!Gt(i,t))return[i.slice()];if(Fe(t,i))return[];const[e,n,s,r]=i,o=Math.max(e,t[0]),l=Math.max(n,t[1]),c=Math.min(s,t[2]),h=Math.min(r,t[3]),d=[];return o>e&&d.push([e,n,o,r]),c<s&&d.push([c,n,s,r]),l>n&&d.push([o,n,c,l]),h<r&&d.push([o,h,c,r]),d}(s.extent,t);for(const o of r)e.insert(o,{extent:o})})}removeFeatures(t){let e=!1;for(let n=0,s=t.length;n<s;++n)e=this.removeFeatureInternal(t[n])||e;e&&this.changed()}removeFeature(t){t&&this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=at(t);if(!(e in this.uidIndex_))return!1;e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.featureChangeKeys_[e]?.forEach(et),delete this.featureChangeKeys_[e];const s=t.getId();if(void 0!==s){const r=s.toString(),o=this.idIndex_[r];o===t?delete this.idIndex_[r]:Array.isArray(o)&&(o.splice(o.indexOf(t),1),1===o.length&&(this.idIndex_[r]=o[0]))}return delete this.uidIndex_[e],this.hasListener("removefeature")&&this.dispatchEvent(new Ke("removefeature",t)),!0}removeFromIdIndex_(t){for(const e in this.idIndex_)if(this.idIndex_[e]===t){delete this.idIndex_[e];break}}setLoader(t){this.loader_=t}setUrl(t){st(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(jc(t,this.format_))}setOverlaps(t){this.overlaps_=t,this.changed()}};function Y_(i){return Ht.A(i)||Number.isNaN(i)||i>10?[211,211,211,1]:i<=2.5?[206,24,31,1]:i<=5?[244,119,33,1]:i<=7.5?[255,199,9,1]:[214,224,64,1]}var U_=R(84205),H_=R(52575);let $_=(()=>{class i{constructor(){this.resize=new U_.B,this.resize$=this.resize.pipe((0,H_.B)(300)),window.addEventListener("resize",()=>{this.resize.next()})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=P.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Z_=(()=>{class i{constructor(e){this.http=e}get features$(){return this.features||this.preloadFeatures(),this.features}preloadFeatures(){return this.features=this.http.get("assets/ne_50m_admin_0_countries.json").pipe((0,de.t)(1)),this.features}static{this.\u0275fac=function(n){return new(n||i)(P.KVO(kt.Qq))}}static{this.\u0275prov=P.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();const J_=["popup"],q_=["popupContent"],Q_=["popupCloser"],ty=["exportImage"],ey=["logo"],ny=["legend"],iy=["map"];function sy(i,t){1&i&&(a.j41(0,"div",7),a.nrm(1,"div",14,6),a.k0s())}function ry(i,t){1&i&&a.nrm(0,"div",8,6)}let Wc=(()=>{class i{constructor(e,n,s){this.mapFeaturesService=n,this.elementRef=s,this.hostClass=!0,this.fullScreen=!1,this.selectionChanged=new P.bkB,this.logoSrc="assets/img/vm-logo-tm.svg",this.legendSrc="assets/img/legend.png",this.popupShowDelay=500,this.popupFeatureState={feature:void 0,hoverStartTime:0,callBackSet:!1},this.mapExtent=[-180,-90,180,90],this.resizeSubscription=e.resize$.subscribe(()=>{this.fullScreen||this.map&&this.map.getView().fit(this.mapExtent)})}ngOnDestroy(){this.resizeSubscription?.unsubscribe(),this.mapDivSub?.unsubscribe()}ngAfterViewInit(){this.mapTarget=this.mapDiv?.first.nativeElement,this.mapDivSub=this.mapDiv?.changes.subscribe(e=>{this.mapTarget=e.first.nativeElement,this.map?.setTarget(this.mapTarget)}),this.overlay=new k_({element:this.container?.nativeElement,autoPan:{animation:{duration:250}}}),(0,vt.z)([this.mapFeaturesService.features$,this.countryData]).subscribe(([e,n])=>{this.vectorLayer||(this.vectorLayer=this.createVectorLayer(e)),this.mapData?(this.mapData=n,this.vectorLayer.changed()):(this.mapData=n,this.loadMap())})}setStyle(e){const n=this.mapData?.[e.getProperties().ISO_A2];if(!n)return new gn;const s=n&&!Ht.A(n.score)?n.score:null;let r="LightGray";return n.entitled&&n.dataAvailable?r=function X_(i,t="LightGray"){return Ht.A(i)||Number.isNaN(i)||i>10?t:i<=2.5?"#ce181f":i<=5?"#f47721":i<=7.5?"#ffc709":"#d6e040"}(s,"#8c9cb0"):n.entitled&&(r="Gray"),new gn({fill:new kn({color:r}),stroke:new gs({color:"#585858",width:1})})}selectStyle(e){const n=this.mapData?.[e.values_.ISO_A2],s=n&&!Ht.A(n.score)?n.score:null;
1return new gn({fill:new kn({color:Y_(s)}),stroke:new gs({color:"Black",width:2}),zIndex:1})}createVectorLayer(e){return new A_({source:new K_({features:(new Tp).readFeatures(e),wrapX:!1}),style:this.setStyle.bind(this)})}loadMap(){this.map=new Xm({controls:bl().extend([new Um]),target:this.mapTarget,layers:[this.vectorLayer],overlays:[this.overlay],view:new ne({projection:"EPSG:4326",center:[0,0],extent:this.mapExtent})}),this.map.on("pointermove",e=>{this.lastPointerPosition={pixel:e.pixel,coords:e.coordinate},this.updatePopup.call(this,e)}),this.map.once("postrender",()=>{this.map?.getView().fit(this.mapExtent)}),this.map.on("singleclick",e=>{if(function(i){const t=i.originalEvent;return!t.altKey&&(Gs?t.metaKey:t.ctrlKey)&&!t.shiftKey}(e))this.map?.forEachFeatureAtPixel(e.pixel,n=>{const s=n.getProperties().ISO_A2;Object.values(this.mapData).some(o=>o.entitled&&!o.selected)?this.selectionChanged.emit(this.mapData[s].selected?new ed([s]):new td([s])):this.selectionChanged.emit(new oa(s))});else{let n=0;this.map?.forEachFeatureAtPixel(e.pixel,s=>{n++;const r=s.getProperties().ISO_A2;if(!r||!this.mapData[r].entitled)return void this.selectionChanged.emit(new Ls);const o=Object.values(this.mapData).filter(l=>l.selected).length>1;this.selectionChanged.emit(this.mapData[r].selected&&o||!this.mapData[r].selected?new oa(r):new Ls)}),0===n&&this.selectionChanged.emit(new Ls)}setTimeout(()=>{this.updatePopup(e)},100)})}updatePopup(e){const n=[];if(this.map.forEachFeatureAtPixel(this.lastPointerPosition.pixel,s=>{n.push(s)}),n.length){const s=n[0];if(this.popupFeatureState.feature!==s)return this.popupFeatureState={feature:s,hoverStartTime:Date.now(),callBackSet:!1},void this.overlay.setPosition(void 0);if(Date.now()-this.popupFeatureState.hoverStartTime<this.popupShowDelay)return this.overlay.setPosition(void 0),void(this.popupFeatureState.callBackSet||(this.popupFeatureState.callBackSet=!0,setTimeout(()=>{this.updatePopup(e)},this.popupShowDelay)));const r=this.mapData[s.values_.ISO_A2];let o="<div>Not available</div>";r.entitled&&r.selected&&r.dataAvailable?o=`<div>${r.score?.toFixed(2)}</div>`:r.entitled&&r.dataAvailable?o="<div>Not selected</div>":r.entitled&&(o="<div>No commodities for current filter selection</div>");const l=s.getProperties().NAME;this.content.nativeElement.innerHTML=`\n        <strong>${l}</strong>\n        ${o}\n        `;const c=this.lastPointerPosition.coords[0],h=this.lastPointerPosition.coords[1],d=this.map.getView().calculateExtent(this.map.getSize()),f=(d[1]+d[3])/2;c<(d[0]+d[2])/2?h<f?(this.overlay?.setOffset([0,0,0,0]),this.overlay?.setPositioning("bottom-left")):(this.overlay?.setOffset([10,0,0,0]),this.overlay?.setPositioning("top-left")):h<f?(this.overlay?.setOffset([0,0,0,0]),this.overlay?.setPositioning("bottom-right")):(this.overlay?.setOffset([0,0,0,0]),this.overlay?.setPositioning("top-right")),this.overlay?.setPosition(this.lastPointerPosition.coords)}else this.popupFeatureState={feature:void 0,hoverStartTime:0,callBackSet:!1},this.overlay?.setPosition(void 0)}mapExport(){const e=document.createElement("canvas"),n=this.elementRef.nativeElement.querySelector(".ol-layer canvas"),s=[n.offsetWidth,n.offsetHeight];e.width=s[0]>423?s[0]:423,e.height=s[1]+59;const r=e.getContext("2d");if(r){r.fillStyle="white",r.fillRect(0,0,e.width,e.height);const o=this.logoElementRef.nativeElement,l=this.legendElementRef.nativeElement;if(n.width>0){const c=n.parentNode.style.opacity;r.globalAlpha=""===c?1:Number(c);const h=s[0]<e.width?Math.ceil((e.width-s[0])/2):0;r.drawImage(n,h,0);const d=Math.ceil((e.width-422)/2);r.drawImage(l,d,e.height-58,423,21),r.drawImage(o,5,e.height-30,98,28),r.strokeStyle="grey",r.beginPath(),r.lineWidth=.5,r.moveTo(0,e.height-33.5),r.lineTo(e.width,e.height-33.5),r.stroke(),r.fillStyle="black",r.font="12px sans-serif";const u=(new Date).getFullYear();r.fillText("\xa9 Verisk Maplecroft "+u,e.width-140,e.height-10)}}navigator.msSaveBlob?navigator.msSaveBlob(e.msToBlob(),"map.png"):(this.exportImageElementRef.nativeElement.href=e.toDataURL(),this.exportImageElementRef.nativeElement.click())}static{this.\u0275fac=function(n){return new(n||i)(a.rXU($_),a.rXU(Z_),a.rXU(a.aKT))}}static{this.\u0275cmp=a.VBU({type:i,selectors:[["grid-ui-commodity-world-map"]],viewQuery:function(n,s){if(1&n&&a.GBs(J_,7)(q_,7)(Q_,7)(ty,7)(ey,7)(ny,7)(iy,5),2&n){let r;a.mGM(r=a.lsd())&&(s.container=r.first),a.mGM(r=a.lsd())&&(s.content=r.first),a.mGM(r=a.lsd())&&(s.closer=r.first),a.mGM(r=a.lsd())&&(s.exportImageElementRef=r.first),a.mGM(r=a.lsd())&&(s.logoElementRef=r.first),a.mGM(r=a.lsd())&&(s.legendElementRef=r.first),a.mGM(r=a.lsd())&&(s.mapDiv=r)}},hostVars:2,hostBindings:function(n,s){2&n&&a.AVh("commodity-world-map",s.hostClass)},inputs:{fullScreen:"fullScreen",countryData:"countryData"},outputs:{selectionChanged:"selectionChanged"},standalone:!1,decls:14,vars:5,consts:[["exportImage",""],["popup",""],["popupCloser",""],["popupContent",""],["logo",""],["legend",""],["map",""],[1,"aspect-ratio-box"],["id","map",1,"fullscreen-map"],["download","map.png",3,"href"],[1,"ol-popup"],["href","#",1,"ol-popup-closer"],[1,"ol-popup-content"],[2,"display","none",3,"src"],["id","map",1,"map-passive-popups","aspect-ratio-box-inside"]],template:function(n,s){1&n&&(a.nVh(0,sy,3,0,"div",7),a.nVh(1,ry,2,0,"div",8),a.nrm(2,"a",9,0),a.j41(4,"div",10,1),a.nrm(6,"a",11,2)(8,"div",12,3),a.k0s(),a.nrm(10,"img",13,4)(12,"img",13,5)),2&n&&(a.vxM(s.fullScreen?-1:0),a.R7$(),a.vxM(s.fullScreen?1:-1),a.R7$(),a.Y8G("href",s.imageData,a.B4B),a.R7$(8),a.Y8G("src",s.logoSrc,a.B4B),a.R7$(2),a.Y8G("src",s.legendSrc,a.B4B))},styles:[".ol-popup[_ngcontent-%COMP%]{width:100px;padding:8px;font-size:11px;background-color:#fff;border-radius:4px;border:1px grey solid}.aspect-ratio-box[_ngcontent-%COMP%]{height:0;overflow:hidden;padding-top:50%;flex:1;background:#fff}.aspect-ratio-box-inside[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.fullscreen-map[_ngcontent-%COMP%]{height:100%;width:100%}"],changeDetection:1})}}return i})();function oy(i,t){1&i&&a.nrm(0,"app-loading")}let ay=(()=>{class i{constructor(){this.hostClass=!0,this.issueSelectionChanged=new P.bkB,this.modules=[yt.JKr,yt.Q90,H.AkP,yt.n76,H.Oee,H.rcg],this.columnDefs=[{headerName:"Issue",field:"issue",width:120,cellClass:"cell-center-vertical"}
1,{headerName:"Score",field:"score",flex:1,cellClass:na,cellRenderer:"scoreBarRendererComponent"}],this.defaultColDef={sortable:!0,resizable:!0,wrapText:!0,autoHeight:!0,suppressHeaderMenuButton:!0,suppressMovable:!0},this.components={scoreBarRendererComponent:sa},this.gridOptions={defaultColDef:this.defaultColDef,columnDefs:this.columnDefs,headerHeight:20,rowHeight:35,components:this.components,rowSelection:{mode:"multiRow",checkboxes:!1,headerCheckbox:!1,enableClickSelection:!0},onCellClicked:this.cellClicked.bind(this),onRowDataUpdated:()=>{this._selectedIssues&&this.updateRowSelections(this._selectedIssues)},getContextMenuItems:()=>[{name:"Excel Export",action:()=>{this.gridApi?.exportDataAsExcel({skipRowGroups:!0,appendContent:Vn.DISCLAIMER_NARROW_EXCEL,fileName:"Risk Issues",sheetName:"data"})}}],excelStyles:Wn.E},this._showAll=!0}get showAll(){return this._showAll}set showAll(e){this._showAll=e}set selectedIssues(e){this._selectedIssues=e,this.gridApi?this.updateRowSelections(e):this.savedSelectedIssues=e}onSelectionChanged(e){const n=e.api.getSelectedRows();this.previousSelection=n,0===n.length?e.api.selectAll():["api","apiSelectAll","rowDataUpdated","rowDataChanged"].includes(e.source)||this.issueSelectionChanged.emit(n.map(s=>s.issue))}onGridReady(e){if(this.gridApi=e.api,this.savedSelectedIssues){const n=this.savedSelectedIssues;this.savedSelectedIssues=void 0,this.updateRowSelections(n)}}updateRowSelections(e){if(!this.gridApi)return;this.previousSelection=[];const n=[],s=[];this.gridApi.forEachNode(r=>{e.includes(r.data.issue.toLowerCase())?(n.push(r),this.previousSelection?.push(r.data)):s.push(r)}),this.gridApi.setNodesSelected({nodes:n,newValue:!0}),this.gridApi.setNodesSelected({nodes:s,newValue:!1})}cellClicked(e){const n=e.event;if((n.metaKey||n.ctrlKey)&&(!this.previousSelection&&this._showAll||this.previousSelection?.length===this.allData?.length))return this.gridApi?.forEachNode(r=>{r.setSelected(r===e.node,!1)}),void(this.previousSelection=[e.node.data]);!this.previousSelection||1!==this.previousSelection.length||e.data.issue===this.previousSelection[0].issue&&e.api.selectAll()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=a.VBU({type:i,selectors:[["grid-ui-commodity-issue-risk-table"]],hostVars:2,hostBindings:function(n,s){2&n&&a.AVh("commodity-issue-risk-table",s.hostClass)},inputs:{allData:"allData",filteredData:"filteredData",showAll:"showAll",selectedIssues:"selectedIssues"},outputs:{issueSelectionChanged:"issueSelectionChanged"},standalone:!1,decls:3,vars:4,consts:[[1,"table-container"],[1,"ag-theme-custom-angular","row-selection-basic",3,"selectionChanged","gridReady","rowData","gridOptions","modules"]],template:function(n,s){1&n&&(a.nVh(0,oy,1,0,"app-loading"),a.j41(1,"div",0)(2,"ag-grid-angular",1),a.bIt("selectionChanged",function(o){return s.onSelectionChanged(o)})("gridReady",function(o){return s.onGridReady(o)}),a.k0s()()),2&n&&(a.vxM(s.allData?-1:0),a.R7$(2),a.Y8G("rowData",s.showAll?s.allData:s.filteredData)("gridOptions",s.gridOptions)("modules",s.modules))},dependencies:[Rt.xs],styles:[".table-container[_ngcontent-%COMP%]{height:100%}
1ag-grid-angular[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:1})}}return i})(),ly=(()=>{class i{constructor(){this.showAll=!0,this.commodityCountrySelectionChanged=new P.bkB,this.modules=[yt.Q90,yt.JKr,H.mZZ,H.eKf,H.yHM,H.vl5,H.l1$,H.AkP,yt.n76,H.Oee,H.rcg],this.columnDefs=[],this.defaultColDef={flex:1,minWidth:75,sortable:!0,filter:!1,resizable:!0,suppressHeaderMenuButton:!0,suppressMovable:!0},this.autoGroupColumnDef={cellRendererParams:{suppressCount:!0},pinned:"left",width:85,filterValueGetter:e=>{const n=e.colDef.colId;if(n&&e.node)return e.getValue(n)}},this.gridOptions={defaultColDef:this.defaultColDef,autoGroupColumnDef:this.autoGroupColumnDef,groupDefaultExpanded:2,groupHideOpenParents:!0,headerHeight:65,rowSelection:{mode:"multiRow",checkboxes:!1,headerCheckbox:!1,enableClickSelection:!0},onCellClicked:this.cellClicked.bind(this),onRowDataUpdated:()=>{this._selectedCommoditiesCountries&&this.updateRowSelections(this._selectedCommoditiesCountries)},suppressCsvExport:!0,getContextMenuItems:()=>[{name:"Excel Export",action:()=>{this.gridApi?.exportDataAsExcel({appendContent:Vn.DISCLAIMER_NARROW_EXCEL,fileName:"Country Risk",sheetName:"data"})}}],excelStyles:Wn.E}}set visiblePillars(e){this.gridApi?this.updatePillarVisibility(e):this.savedSelectedPillars=e}set selectedCommoditiesCountries(e){this._selectedCommoditiesCountries=e,this.gridApi?this.updateRowSelections(e):this.savedSelectedCommoditiesCountries=e}set hideWeights(e){this.updateColumnDefs(e)}onSelectionChanged(e){const n=e.api.getSelectedRows();this.previousSelection=n,0===n.length?e.api.selectAll():["api","apiSelectAll","rowDataUpdated","rowDataChanged"].includes(e.source)||this.commodityCountrySelectionChanged.emit({countries:n.map(s=>s.ctry),commodities:n.map(s=>s.comm)})}onGridReady(e){if(this.gridApi=e.api,this.savedSelectedCommoditiesCountries){const n=this.savedSelectedCommoditiesCountries;this.savedSelectedCommoditiesCountries=void 0,this.updateRowSelections(n)}this.savedSelectedPillars&&(this.updatePillarVisibility(this.savedSelectedPillars),this.savedSelectedPillars=void 0)}updateColumnDefs(e){this.columnDefs=[{headerName:"Commodity",field:"comm",rowGroup:!0,hide:!0},{headerName:"Country",field:"countryName"},{headerName:"Production Volume Weighting",field:"vol",sortable:!1,hide:e,cell
1Class:"text-center",valueFormatter:n=>void 0===n.value?"":`${n.value}%`},{headerName:"Overall Risk",field:"scr",colId:"overall risk",cellClass:X,valueFormatter:$e},{headerName:"Cross-cutting supply chain risks",field:"Cross-cutting supply chain risks",colId:"cross-cutting supply chain risks",cellClass:X,valueFormatter:$e},{headerName:"Environmental",field:"Environmental",colId:"environmental",cellClass:X,valueFormatter:$e},{headerName:"Political",colId:"political",field:"Political",cellClass:X,valueFormatter:$e},{headerName:"Social",colId:"social",field:"Social",cellClass:X,valueFormatter:$e}]}updateRowSelections(e){if(!this.gridApi)return;this.previousSelection=[];const n=[],s=[];this.gridApi.forEachNode(r=>{r.allLeafChildren&&r.allLeafChildren.forEach(o=>{e.countries.includes(o.data.ctry)&&e.commodities.includes(o.data.comm.toLowerCase())?(this.previousSelection?.push(o.data),n.push(o)):s.push(o)})}),this.gridApi.setNodesSelected({nodes:n,newValue:!0}),this.gridApi.setNodesSelected({nodes:s,newValue:!1})}updatePillarVisibility(e){const n=["cross-cutting supply chain risks","environmental","political","social"].map(s=>({colId:s,hide:!e.includes(s)}));n.push({colId:"overall risk",hide:0===e.length}),this.gridApi?.applyColumnState({state:n})}cellClicked(e){const n=e.event;if((n.metaKey||n.ctrlKey)&&(!this.previousSelection&&this.showAll||this.previousSelection?.length===this.allData?.length))return this.gridApi?.forEachNode(r=>{r.allLeafChildren&&r.allLeafChildren.forEach(o=>{o.setSelected(o===e.node,!1)})}),void(this.previousSelection=[e.node.data]);!this.previousSelection||1!==this.previousSelection.length||e.data.comm===this.previousSelection[0].comm&&e.data.ctry===this.previousSelection[0].ctry&&e.api.selectAll()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=a.VBU({type:i,selectors:[["grid-ui-commodity-country-table"]],inputs:{allData:"allData",filteredData:"filteredData",showAll:"showAll",visiblePillars:"visiblePillars",selectedCommoditiesCountries:"selectedCommoditiesCountries",hideWeights:"hideWeights"},outputs:{commodityCountrySelectionChanged:"commodityCountrySelectionChanged"},standalone:!1,decls:2,vars:4,consts:[[1,"table-container"],[1,"ag-theme-custom-angular","row-selection-basic",3,"selectionChanged","gridReady","rowData","columnDefs","gridOptions","modules"]],template:function(n,s){1&n&&(a.j41(0,"div",0)(1,"ag-grid-angular",1),a.bIt("selectionChanged",function(o){return s.onSelectionChanged(o)})("gridReady",function(o){return s.onGridReady(o)}),a.k0s()()),2&n&&(a.R7$(),a.Y8G("rowData",s.showAll?s.allData:s.filteredData)("columnDefs",s.columnDefs)("gridOptions",s.gridOptions)("modules",s.modules))},dependencies:[Rt.xs],styles:["[_nghost-%COMP%]{height:100%}.table-container[_ngcontent-%COMP%]{height:100%;overflow-y:hidden}
1ag-grid-angular[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:1})}}return i})(),cy=(()=>{class i{constructor(e,n){this.appStateService=e,this.mapSelectionHandler=n,this.ignoreWeights$=this.appStateService.ignoreWeights$,this.countryTableShowAll=e.riskViewState.countryTableShowAll,this.issueTableShowAll=e.riskViewState.issueTableShowAll,this.commodityTableShowAll=e.riskViewState.commodityTableShowAll,this.overallcommodityScores$=this.appStateService.overallcommodityScores$,this.pillarsImplicitlySelectedByIssues$=this.appStateService.pillarsImplicitlySelectedByIssues$,this.filteredPillarData$=this.appStateService.getFilteredRiskDriverTableData().pipe((0,dt.T)(s=>Ai.A(ks.A("comm"),s))),this.allPillarData$=(0,vt.z)([this.appStateService.overallPillarData$,this.appStateService.getFilteredRiskDriverTableData()]).pipe((0,dt.T)(([s,r])=>{const l=he.A(s).map(c=>{if(!r.some(h=>h.comm===c.comm&&h.ctry===c.ctry)){const{comm:h,ctry:d,countryName:u,vol:f,type:g}=c;Object.keys(c).forEach(m=>c[m]=""),c=Object.assign({},c,{comm:h,ctry:d,countryName:u,vol:f,type:g})}return c});return Ai.A(ks.A("comm"),l)})),this.filteredOverallcommodityScores$=this.appStateService.getFilteredOverallCommodityScores(),this.mapData$=this.appStateService.getFilteredMapData(),this.indicatorData$=this.appStateService.getIndicatorData(),this.filteredOverallIssueScores$=this.appStateService.getFilteredOverallIssueScoresTableData(),this.overallIssueScoresAllIssues$=this.appStateService.overallIssueScoresAllIssues$,this.selectedCommodities$=this.appStateService.selectedCommodities$,this.selectedIssues$=this.appStateService.selectedIssues$,this.selectedPillars$=this.appStateService.selectedPillars$,this.visiblePillars$=(0,vt.z)([this.appStateService.selectedPillars$,this.appStateService.pillarsImplicitlySelectedByIssues$,this.appStateService.allPillars$]).pipe((0,dt.T)(([s,r,o])=>r.length&&r.length<o.length?he.A(r).map(l=>l.toLowerCase()):s.length&&s.length<o.length?he.A(s).map(l=>l.toLowerCase()):he.A(o).map(l=>l.toLowerCase()))),this.selectedCommoditiesCountries$=(0,vt.z)([this.appStateService.selectedCountries$,this.appStateService.selectedCommodities$]).pipe((0,dt.T)(([s,r])=>({countries:s,commodities:r})))}commoditySelectionChanged(e){this.appStateService.updateFilter("commodity",e)}issueSelectionChanged(e){this.appStateService.updateFilter("issue",e)}commodityCountrySelectionChanged(e){this.appStateService.updateFilter("commodity",e.commodities),this.appStateService.updateCountryFilter(e.countries)}toggleCommodityTableShowAll(){this.appStateService.riskViewState.commodityTableShowAll=!this.appStateService.riskViewState.commodityTableShowAll,this.commodityTableShowAll=this.appStateService.riskViewState.commodityTableShowAll}toggleIssueTableShowAll(){this.appStateService.riskViewState.issueTableShowAll=!this.appStateService.riskViewState.issueTableShowAll,this.issueTableShowAll=this.appStateService.riskViewState.issueTableShowAll}toggleCountryTableShowAll(){this.appStateService.riskViewState.countryTableShowAll=!this.appStateService.riskViewState.countryTableShowAll,this.countryTableShowAll=this.appStateService.riskViewState.countryTableShowAll}static{this.\u0275fac=function(n){return new(n||i)(a.rXU(Ue),a.rXU(aa))}}static{this.\u0275cmp=a.VBU({type:i,selectors:[["grid-ui-commodity-risk-analysis"]],standalone:!1,decls:56,vars:50,consts:[[1,"commodity-top-area"],[1,"panel"],[1,"panel-header"],[3,"tableData$"],[1,"middle-area"],["data-testid","btn-toggle-overall-commodity",1,"panel-header-controls",3,"click"],[1,"weak"],[3,"commoditySelectionChanged","allData","filteredData","selectedCommodities","showAll"],[1,"panel","issue-table-panel"],["data-testid","btn-toggle-risk-issue",1,"panel-header-controls",3,"click"],[3,"issueSelectionChanged","allData","filteredData","selectedIssues","showAll"],[1,"stack-panels"],[1,"panel","map-panel","panel-border"],[1,"panel-body"],[3,"selectionChanged","countryData"],[1,"panel","country-table-panel"],["data-testid","btn-toggle-commodity-risk",1,"panel-header-controls",3,"click"],[3,"commodityCountrySelectionChanged","allData","filteredData","visiblePillars","hideWeights","selectedCommoditiesCountries","showAll"]],template:function(n,s){1&n&&(a.j41(0,"div",0)(1,"div",1)(2,"div",2),a.EFF(3,"Evidence"),a.k0s(),a.nrm(4,"grid-ui-commodity-indicator-table",3),a.k0s()(),a.j41(5,"div",4)(6,"div",1)(7,"div",2),a.EFF(8," Overall Commodity Risk "),a.j41(9,"span",5),a.bIt("click",function(){return s.toggleCommodityTableShowAll()}),a.EFF(10),a.j41(11,"span",6),a.EFF(12),a.k0s(),a.EFF(13),a.j41(14,"span",6),a.EFF(1
15),a.k0s()()(),a.j41(16,"grid-ui-commodity-score-table",7),a.nI1(17,"async"),a.nI1(18,"async"),a.nI1(19,"async"),a.bIt("commoditySelectionChanged",function(o){return s.commoditySelectionChanged(o)}),a.k0s()(),a.j41(20,"div",8)(21,"div",2),a.EFF(22," Risk Issue"),a.j41(23,"span",9),a.bIt("click",function(){return s.toggleIssueTableShowAll()}),a.EFF(24),a.j41(25,"span",6),a.EFF(26),a.k0s(),a.EFF(27),a.j41(28,"span",6),a.EFF(29),a.k0s()()(),a.j41(30,"grid-ui-commodity-issue-risk-table",10),a.nI1(31,"async"),a.nI1(32,"async"),a.nI1(33,"async"),a.bIt("issueSelectionChanged",function(o){return s.issueSelectionChanged(o)}),a.k0s()(),a.j41(34,"div",11)(35,"div",12)(36,"div",2),a.EFF(37,"Global Risk Outlook"),a.k0s(),a.j41(38,"div",13)(39,"grid-ui-commodity-world-map",14),a.bIt("selectionChanged",function(o){return s.mapSelectionHandler.mapSelections(o)}),a.k0s()()(),a.j41(40,"div",15)(41,"div",2),a.EFF(42," Commodity Risk By Country "),a.j41(43,"span",16),a.bIt("click",function(){return s.toggleCountryTableShowAll()}),a.EFF(44),a.j41(45,"span",6),a.EFF(46),a.k0s(),a.EFF(47),a.j41(48,"span",6),a.EFF(49),a.k0s()()(),a.j41(50,"grid-ui-commodity-country-table",17),a.nI1(51,"async"),a.nI1(52,"async"),a.nI1(53,"async"),a.nI1(54,"async"),a.nI1(55,"async"),a.bIt("commodityCountrySelectionChanged",function(o){return s.commodityCountrySelectionChanged(o)}),a.k0s()()()()),2&n&&(a.R7$(4),a.Y8G("tableData$",s.indicatorData$),a.R7$(6),a.SpI(" ",s.commodityTableShowAll?"":"selected"," "),a.R7$(2),a.JRh(s.commodityTableShowAll?"selected":""),a.R7$(),a.SpI(" / ",s.commodityTableShowAll?"all":""," "),a.R7$(2),a.JRh(s.commodityTableShowAll?"":"all"),a.R7$(),a.Y8G("allData",a.bMT(17,28,s.overallcommodityScores$))("filteredData",a.bMT(18,30,s.filteredOverallcommodityScores$))("selectedCommodities",a.bMT(19,32,s.selectedCommodities$))("showAll",s.commodityTableShowAll),a.R7$(8),a.SpI(" ",s.issueTableShowAll?"":"selected"," "),a.R7$(2),a.JRh(s.issueTableShowAll?"selected":""),a.R7$(),a.SpI(" / ",s.issueTableShowAll?"all":""," "),a.R7$(2),a.JRh(s.issueTableShowAll?"":"all"),a.R7$(),a.Y8G("allData",a.bMT(31,34,s.overallIssueScoresAllIssues$))("filteredData",a.bMT(32,36,s.filteredOverallIssueScores$))("selectedIssues",a.bMT(33,38,s.selectedIssues$))("showAll",s.issueTableShowAll),a.R7$(9),a.Y8G("countryData",s.mapData$),a.R7$(5),a.SpI(" ",s.countryTableShowAll?"":"selected"," "),a.R7$(2),a.JRh(s.countryTableShowAll?"selected":""),a.R7$(),a.SpI(" / ",s.countryTableShowAll?"all":""," "),a.R7$(2),a.JRh(s.countryTableShowAll?"":"all"),a.R7$(),a.Y8G("allData",a.bMT(51,40,s.allPillarData$))("filteredData",a.bMT(52,42,s.filteredPillarData$))("visiblePillars",a.bMT(53,44,s.visiblePillars$))("hideWeights",a.bMT(54,46,s.ignoreWeights$))("selectedCommoditiesCountries",a.bMT(55,48,s.selectedCommoditiesCountries$))("showAll",s.countryTableShowAll))},dependencies:[Wc,ra,ia,ay,ly,wt.Jj],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%}.country-table-panel[_ngcontent-%COMP%]{z-index:2}.commodity-issue-risk-table[_ngcontent-%COMP%], .commodity-indicator-table[_ngcontent-%COMP%], .commodity-score-table[_ngcontent-%COMP%]{height:calc(100% - 22px)}.map-panel[_ngcontent-%COMP%]{flex-grow:2;height:unset}.map-panel[_ngcontent-%COMP%]   .panel-body[_ngcontent-%COMP%]{background-color:#eee}.commodity-world-map[_ngcontent-%COMP%]{margin:auto;display:block;position:relative;max-height:100%}.commodity-top-area[_ngcontent-%COMP%]{width:100%;min-height:200px;flex:1 0 1px;padding-right:.3rem}.middle-area[_ngcontent-%COMP%]{display:flex;width:100%;flex:2 0 1px;padding-right:.3rem;padding-top:.3rem}.stack-panels[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-grow:1;width:0}.issue-table-panel[_ngcontent-%COMP%]{min-width:225px;max-width:350px}.weak[_ngcontent-%COMP%]{color:#999}@media only screen and (height<=600px){.top-area[_ngcontent-%COMP%]{display:none}}@media only screen and (height<=750px){.top-area[_ngcontent-%COMP%]{min-height:150px}app-world-map[_ngcontent-%COMP%]{max-width:calc(100vh - 175px)}}@media only screen and (height<=500px){.map-panel[_ngcontent-%COMP%]{display:none}}@media only screen and (width<=750px){.map-panel[_ngcontent-%COMP%]{display:none}}@media(aspect-ratio>=8/5){.stack-panels[_ngcontent-%COMP%]{flex-direction:row}.stack-panels[_ngcontent-%COMP%]   .country-table-panel[_ngcontent-%COMP%]{max-width:800px;min-width:620px;flex-grow:1}.stack-panels[_ngcontent-%COMP%]   .map-panel[_ngcontent-%COMP%]{flex-grow:2}.stack-panels[_ngcontent-%COMP%]   .map-panel[_ngcontent-%COMP%]   .panel-body[_ngcontent-%COMP%]{height:100%}.stack-panels[_ngcontent-%COMP%]   .map-panel[_ngcontent-%COMP%]   app-world-map[_ngcontent-%COMP%]{max-width:unset;margin:0}.stack-panels[_ngcontent-%COMP%]   .aspect-ratio-box[_ngcontent-%COMP%]{height:100%;width:100%;padding-top:unset}}@media only screen and (aspect-ratio>=8/5)and (width<=1300px){.map-panel[_ngcontent-%COMP%]{display:none}}"],changeDetection:1})}}return i})();yt.syG.registerModules([H.yHM,H.l1$,H.mZZ,H.eKf,H.vl5]);let hy=(()=>{class i{constructor(e,n){this.appStateService=e,this.pillarService=n,this.modules=[yt.JKr,yt.Q90,H.AkP,yt.n76,H.Oee,H.rcg],this.columnDefs=[],this.defaultColDef={flex:1,minWidth:75,sortable:!0,filter:!1,resizable:!0,suppressHeaderMenuButton:!0,suppressMovable:!0},this.autoGroupColumnDef={cellRendererParams:{suppressCount:!0},pinned:"left",width:85,filterValueGetter:s=>{const r=s.colDef.colId;if(r&&s.node)return s.getValue(r)}},this.gridOptions={defaultColDef:this.defaultColDef,autoGroupColumnDef:this.autoGroupColumnDef,groupDefaultExpanded:2,groupHideOpenParents:!0,headerHeight:45,getContextMenuItems:()=>[{name:"Excel Export",action:()=>{this.gridApi?.exportDataAsExcel({appendContent:Vn.DISCLAIMER_NARROW_EXCEL,fileName:"Risk Drivers",sheetName:"data"})}}],excelStyles:Wn.E}}set hideWeights(e){this.updateColumnDefs(e)}ngOnDestroy(){this.colUpdateSubscription?.unsubscribe()}onGridReady(e){this.gridApi=e.api,this.updateColumnVisibility()}updateColumnVisibility(){this.colUpdateSubscription=(0,vt.z)([this.appStateService.allIssues$,this.appStateService.selectedIssues$,this.appStateService.allPillars$,this.appStateService.selectedPillars$]).subscribe(([e,n,s,r])=>{let o=he.A(n);const l=[];
1s.forEach(s.length!==r.length?h=>{r.includes(h.toLowerCase())?l.push({colId:h.toLowerCase(),hide:this.shouldPillarBeHidden(h,o)}):(l.push({colId:h.toLowerCase(),hide:!0}),o=o.filter(d=>!this.pillarService.structure[h].some(u=>u.toLowerCase()===d.toLowerCase())))}:h=>{l.push({colId:h.toLowerCase(),hide:this.shouldPillarBeHidden(h,o)})});const c=[...l,...e.map(h=>({colId:h.toLowerCase(),hide:!o.includes(h.toLowerCase())}))];this.gridApi?.applyColumnState({state:c})})}shouldPillarBeHidden(e,n){return!this.pillarService.getIssueKeysForPillarByKey(this.pillarService.getPillarKeyByName(e)).some(s=>n.includes(s))}updateColumnDefs(e){this.columnDefs=[{headerName:"",children:[{headerName:"Commodity Type",field:"type",rowGroup:!0,hide:!0},{headerName:"Commodity",field:"comm",rowGroup:!0,hide:!0},{headerName:"Country",field:"countryName"},{headerName:"Production Volume Weighting",field:"vol",sortable:!1,hide:e,cellClass:"text-center",valueFormatter:n=>void 0===n.value?"":`${n.value}%`},{headerName:"Overall Risk By Country",field:"scr",cellClass:X}]},{headerName:"Cross-cutting supply chain risks",children:[{headerName:"Pillar Average",field:"Cross-cutting supply chain risks",colId:"cross-cutting supply chain risks",cellClass:X},{field:"Certified Sustainable Production",colId:"certified sustainable production",cellClass:X},{field:"Wider Value Chain Risks",colId:"wider value chain risks",cellClass:X}]},{headerName:"Environmental",marryChildren:!0,children:[{headerName:"Pillar Average",field:"Environmental",colId:"environmental",cellClass:X},{field:"Climate Hazard and Vulnerability 2050 SSP585",colId:"climate hazard and vulnerability 2050 ssp585",cellClass:X},{field:"Deforestation Rates",colId:"deforestation rates",cellClass:X},{field:"Greenhouse Gas Emissions",colId:"greenhouse gas emissions",cellClass:X},{field:"Natural Hazards",colId:"natural hazards",cellClass:X},{field:"Water Pollution",colId:"water pollution",cellClass:X},{field:"Water Stress",colId:"water stress",cellClass:X}]},{headerName:"Political",marryChildren:!0,children:[{headerName:"Pillar Average",field:"Political",colId:"political",cellClass:X},{field:"Corruption",colId:"corruption",cellClass:X},{field:"Land Grabs",colId:"land grabs",cellClass:X},{field:"Political Instability",colId:"political instability",cellClass:X}]},{headerName:"Social",marryChildren:!0,children:[{headerName:"Pillar Average",field:"Social",colId:"social",cellClass:X},{field:"Child Labour",colId:"child labour",cellClass:X},{field:"Freedom of Association and Collective Bargaining",colId:"freedom of association and collective bargaining",cellClass:X},{field:"Discrimination in the Workplace",colId:"discrimination in the workplace",cellClass:X},{field:"Forced labour",colId:"forced labour",cellClass:X},{field:"Trafficking in Persons",colId:"trafficking in persons",cellClass:X},{field:"Migrant Workers",colId:"migrant workers",cellClass:X},{field:"Occupational Health and Safety",colId:"occupational health and safety",cellClass:X},{field:"Decent Wages",colId:"decent wages",cellClass:X},{field:"Decent Working Time",colId:"decent working time",cellClass:X}]}]}static{this.\u0275fac=function(n){return new(n||i)(a.rXU(Ue),a.rXU(qo))}}static{this.\u0275cmp=a.VBU({type:i,selectors:[["grid-ui-commodity-risk-driver-table"]],inputs:{tableData:"tableData",hideWeights:"hideWeights"},standalone:!1,decls:2,vars:4,consts:[[1,"table-container"],[1,"ag-theme-custom-angular",3,"gridReady","rowData","columnDefs","gridOptions","modules"]],template:function(n,s){1&n&&(a.j41(0,"div",0)(1,"ag-grid-angular",1),a.bIt("gridReady",function(o){return s.onGridReady(o)}),a.k0s()()),2&n&&(a.R7$(),a.Y8G("rowData",s.tableData)("columnDefs",s.columnDefs)("gridOptions",s.gridOptions)("modules",s.modules))},dependencies:[Rt.xs],styles:["[_nghost-%COMP%]{height:100%}.table-container[_ngcontent-%COMP%]{height:100%;overflow-y:hidden}
1ag-grid-angular[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:1})}}return i})(),dy=(()=>{class i{constructor(e){this.appStateService=e,this.ignoreWeights$=this.appStateService.ignoreWeights$,this.tableData$=this.appStateService.getFilteredRiskDriverTableData()}static{this.\u0275fac=function(n){return new(n||i)(a.rXU(Ue))}}static{this.\u0275cmp=a.VBU({type:i,selectors:[["grid-ui-commodity-risk-driver-table-container"]],standalone:!1,decls:3,vars:6,consts:[[3,"tableData","hideWeights"]],template:function(n,s){1&n&&(a.nrm(0,"grid-ui-commodity-risk-driver-table",0),a.nI1(1,"async"),a.nI1(2,"async")),2&n&&a.Y8G("tableData",a.bMT(1,2,s.tableData$))("hideWeights",a.bMT(2,4,s.ignoreWeights$))},dependencies:[hy,wt.Jj],styles:["[_nghost-%COMP%]{height:100%}"],changeDetection:1})}}return i})();var uy=R(13332);function fy(i,t){1&i&&a.nrm(0,"grid-ui-icon",3)}function gy(i,t){1&i&&a.nrm(0,"grid-ui-icon",4)}function my(i,t){if(1&i){const e=a.RV6();a.j41(0,"grid-ui-commodity-world-map",8),a.bIt("selectionChanged",function(s){P.eBV(e);const r=a.XpG();return P.Njj(r.selectionHandler.mapSelections(s))}),a.k0s()}if(2&i){const e=a.XpG();a.Y8G("fullScreen",!1)("countryData",e.mapData$)}}function py(i,t){if(1&i){const e=a.RV6();a.j41(0,"grid-ui-commodity-world-map",9),a.bIt("selectionChanged",function(s){P.eBV(e);const r=a.XpG();return P.Njj(r.selectionHandler.mapSelections(s))}),a.k0s()}if(2&i){const e=a.XpG();a.Y8G("fullScreen",!0)("countryData",e.mapData$)}}const _y=[{path:"",data:{breadcrumb:""},component:Hh,children:[{path:"",redirectTo:"risk-analysis",pathMatch:"full"},{path:"risk-analysis",component:cy},{path:"risk-drivers",component:dy},{path:"indicator",component:ra},{path:"map",component:(()=>{class i{constructor(e,n){this.appStateService=e,this.selectionHandler=n,this.enforceAspectRatio=!1,this.mapData$=this.appStateService.getFilteredMapData()}toggleAspectRatio(){this.enforceAspectRatio=!this.enforceAspectRatio}static{this.\u0275fac=function(n){return new(n||i)(a.rXU(Ue),a.rXU(aa))}}static{this.\u0275cmp=a.VBU({type:i,selectors:[["grid-ui-commodity-world-map-container"]],standalone:!1,decls:9,vars:6,consts:[[1,"panel","map-panel"],[1,"panel-header"],[1,"panel-header-controls",3,"click"],["name","expand",1,"world-map-container__expand-icon"],["name","minimize",1,"world-map-container__minimize-icon"],[1,"panel-body","panel-border"],[1,"enforce-aspect-ratio",3,"fullScreen","countryData"],[3,"fullScreen","countryData"],[1,"enforce-aspect-ratio",3,"selectionChanged","fullScreen","countryData"],[3,"selectionChanged","fullScreen","countryData"]],template:function(n,s){1&n&&(a.j41(0,"div",0)(1,"div",1),a.EFF(2," Global Risk Outlook "),a.j41(3,"span",2),a.bIt("click",function(){return s.toggleAspectRatio()}),a.nVh(4,fy,1,0,"grid-ui-icon",3),a.nVh(5,gy,1,0,"grid-ui-icon",4),a.k0s()(),a.j41(6,"div",5),a.nVh(7,my,1,2,"grid-ui-commodity-world-map",6),a.nVh(8,py,1,2,"grid-ui-commodity-world-map",7),a.k0s()()),2&n&&(a.AVh("enforce-aspect-ratio",s.enforceAspectRatio),a.R7$(4),a.vxM(s.enforceAspectRatio?4:-1),a.R7$(),a.vxM(s.enforceAspectRatio?-1:5),a.R7$(2),a.vxM(s.enforceAspectRatio?7:-1),a.R7$(),a.vxM(s.enforceAspectRatio?-1:8))},dependencies:[uy.R,Wc],styles:["@keyframes _ngcontent-%COMP%_rotate{to{transform:rotate(1turn)}}.world-map-container__expand-icon[_ngcontent-%COMP%], .world-map-container__minimize-icon[_ngcontent-%COMP%]{height:1.6rem;width:1.6rem;min-width:1.6rem}.world-map-container__expand-icon[_ngcontent-%COMP%], .world-map-container__minimize-icon[_ngcontent-%COMP%]{--%NS%color-icon-fill-primary: #fff}.world-map-container__expand-icon[_ngcontent-%COMP%], .world-map-container__minimize-icon[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%]{height:100%;width:100%}grid-ui-commodity-world-map[_ngcontent-%COMP%]{height:100%;width:100%}grid-ui-commodity-world-map.enforce-aspect-ratio[_ngcontent-%COMP%]{max-width:100vh;margin:auto;display:block;position:relative;max-height:100%}.map-panel[_ngcontent-%COMP%]{flex-grow:2;height:calc(100% - .6rem);margin:.3rem}.map-panel[_ngcontent-%COMP%]   .panel-body[_ngcontent-%COMP%]{flex:1 0}.map-panel.enforce-aspect-ratio[_ngcontent-%COMP%]{height:unset}.map-panel.enforce-aspect-ratio[_ngcontent-%COMP%]   .panel-body[_ngcontent-%COMP%]{background-color:#eee}
1.map-panel[_ngcontent-%COMP%]   .panel-header-controls[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{height:12px;width:12px;fill:#fff}"],changeDetection:1})}}return i})()},{path:"commodity-score",component:ia},{path:"about",component:As}]}];let yy=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=a.$C({type:i})}static{this.\u0275inj=P.G2t({imports:[Ft.iI.forChild(_y),Ft.iI]})}}return i})(),Cy=(()=>{class i{static forRoot(){return{ngModule:i}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=a.$C({type:i})}static{this.\u0275inj=P.G2t({providers:[Ds],imports:[wt.MD,Y.YN,ot.SharedPipesModule]})}}return i})(),by=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=a.$C({type:i})}static{this.\u0275inj=P.G2t({providers:[(0,kt.$R)((0,kt.Sx)())],imports:[wt.MD,Y.YN,Rt.$V,tt.UN,Cy.forRoot(),ot.IconModule,ot.LoadingModule,yy,ot.SharedPipesModule]})}}return i})()},58375(Ri,ce,R){R.d(ce,{A:()=>kt});var Rt=R(78434);function kt(Y,ot,tt){return function(){if(0===arguments.length)return tt();var Ft=arguments[arguments.length-1];if(!(0,Rt.A)(Ft)){for(var a=0;a<Y.length;){if("function"==typeof Ft[Y[a]])return Ft[Y[a]].apply(Ft,Array.prototype.slice.call(arguments,0,-1));a+=1}if(function wt(Y){return null!=Y&&"function"==typeof Y["@@transducer/step"]}(Ft))return ot.apply(null,Array.prototype.slice.call(arguments,0,-1))(Ft)}return tt.apply(this,arguments)}}},97233(Ri,ce,R){function Rt(wt,kt){for(var Y=0,ot=kt.length,tt=[];Y<ot;)wt(kt[Y])&&(tt[tt.length]=kt[Y]),Y+=1;return tt}R.d(ce,{A:()=>Rt})},57077(Ri,ce,R){R.d(ce,{A:()=>kt});var Rt=R(38434);function kt(Y,ot){return function wt(Y,ot,tt){var Ft,a;if("function"==typeof Y.indexOf)switch(typeof ot){case"number":if(0===ot){for(Ft=1/ot;tt<Y.length;){if(0===(a=Y[tt])&&1/a===Ft)return tt;tt+=1}return-1}if(ot!=ot){for(;tt<Y.length;){if("number"==typeof(a=Y[tt])&&a!=a)return tt;tt+=1}return-1}return Y.indexOf(ot,tt);case"string":case"boolean":case"function":case"undefined":return Y.indexOf(ot,tt);case"object":if(null===ot)return Y.indexOf(ot,tt)}for(;tt<Y.length;){if((0,Rt.A)(Y[tt],ot))return tt;tt+=1}return-1}(ot,Y,0)>=0}},79616(Ri,ce,R){R.d(ce,["A",0,{init:function(){return this.xf["@@transducer/init"]()},result:function(wt){return this.xf["@@transducer/result"](wt)}}])}}]);
2//# sourceMappingURL=970.5b8305dcd9a23e79.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.