@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
1 lines • 1.2 MB
JavaScript
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2189,4383,9187],{5247:(t,e,s)=>{s.d(e,{O:()=>h});var n=s(76061),i=s(55537),r=s(88885),o=r.D;class a extends n.G{constructor(t,e,s,n,i,r){super(),this.m_densificator=new o(e,s,n,r,!1,i),this.m_index=-1,this.m_inputGeoms=t}tock(){return!0}getRank(){return 1}next(){let t=null;for(;t=this.m_inputGeoms.next();)return(0,i.c)(t),this.m_index=this.m_inputGeoms.getGeometryID(),this.densify(t);return null}getGeometryID(){return this.m_index}densify(t){return this.m_densificator.densify(t)}}class h{getOperatorType(){return 10202}accelerateGeometry(t,e,s){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!0}executeMany(t,e,s,n,i,r=12e3){return new a(t,e,s,n,r,i)}execute(t,e,s,n,i,o=12e3){return(0,r.d)(t,e,s,n,i,o)}}},12189:(t,e,s)=>{s.r(e),s.d(e,{$:()=>bn,A:()=>Ro,B:()=>Mo,C:()=>xs,D:()=>xr,E:()=>S,F:()=>Ji,G:()=>D,H:()=>Bi,I:()=>C,J:()=>ki,K:()=>Yi,L:()=>rs,M:()=>Ho,N:()=>vn,O:()=>hn,P:()=>Ao,Q:()=>Sn,R:()=>no,S:()=>x,T:()=>ks,U:()=>dr,V:()=>Wn,W:()=>Mi,X:()=>No,Y:()=>On,Z:()=>Dn,_:()=>wn,a:()=>to,a0:()=>In,a1:()=>jn,a2:()=>X,a3:()=>A,a4:()=>G,a5:()=>dn,a6:()=>Y,a7:()=>N,a8:()=>zi,a9:()=>qo,aA:()=>ao,aB:()=>oo,aC:()=>si,aD:()=>xo,aE:()=>so,aF:()=>d,aG:()=>ea,aH:()=>sa,aI:()=>na,aJ:()=>ia,aK:()=>ra,aa:()=>vr,ab:()=>Er,ac:()=>Pr,ad:()=>Ei,ae:()=>ar,af:()=>Ht,ag:()=>kt,ah:()=>ci,ai:()=>gi,aj:()=>cs,ak:()=>Ys,al:()=>qs,am:()=>Qr,an:()=>Xt,ao:()=>io,ap:()=>Cs,aq:()=>ys,ar:()=>fs,as:()=>Os,at:()=>J,au:()=>tt,av:()=>H,aw:()=>uo,ax:()=>Go,ay:()=>Li,az:()=>F,b:()=>di,c:()=>Jr,d:()=>yi,e:()=>ui,f:()=>_i,g:()=>cn,h:()=>is,i:()=>Zr,j:()=>fi,k:()=>Ws,l:()=>ps,m:()=>_s,n:()=>us,o:()=>Gs,p:()=>Fs,q:()=>gs,r:()=>ne,s:()=>Qs,t:()=>qt,u:()=>as,v:()=>jr,w:()=>Fi,x:()=>Ni,y:()=>Ui,z:()=>En});var n=s(79187),i=s(55537),r=s(88885),o=s(95213),a=s(83661),h=s(90237),m=s(11878),l=s(31139),u=s(5247),c=s(76061),g=s(24383);class d{constructor(t){if(this.m_geom=this.m_sr=null,t){if(t.move)return this.m_geom=t.move.m_geom,t.move.m_geom=null,this.m_sr=t.move.m_sr,void(t.move.m_sr=null);if(t.copy)return this.m_geom=t.copy.m_geom?t.copy.m_geom.clone():null,void(this.m_sr=t.copy.m_sr);t.geom&&(this.m_geom=t.geom),t.sr&&(this.m_sr=t.sr)}}getGeometry(){return this.m_geom}getSpatialReference(){return this.m_sr}setGeometry(t){this.m_geom=t}setSpatialReference(t){this.m_sr=t}equals(t,e){const s=t;return!(!this.m_sr&&s.m_sr||this.m_sr&&!s.m_sr||!this.m_geom&&s.m_geom||this.m_geom&&!s.m_geom||this.m_sr&&s.m_sr&&!this.m_sr.equals(s.m_sr)||this.m_geom&&s.m_geom&&!this.m_geom.equals(s.m_geom,e))}clone(){let t=null;return this.m_geom&&(t=this.m_geom.clone()),new d({geom:t,sr:this.m_sr})}hasGeom(){return!!this.m_geom}}class _{constructor(t){this.m_factor=1,this.m_wkid=0,this.m_peUnit=null,t&&(this.m_peUnit=t,this.m_factor=t.getUnitFactor(),this.m_wkid=t.getCode(),this.m_wkid<0&&(this.m_wkid=0))}getName(){return this.m_peUnit?this.m_peUnit.getName():""}getID(){return this.m_wkid}getConversionFactor(t){return this.getUnitType()!==t.getUnitType()&&(0,i.a)("unit type mismatch"),this.getUnitToBaseFactor()/t.getUnitToBaseFactor()}getUnitToBaseFactor(){return this.m_factor}getHashCode(){return(0,a.at)((0,a.au)(this.getUnitType()),(0,a.au)(this.getUnitToBaseFactor()))}equals(t){return!!t&&this.getUnitType()===t.getUnitType()&&this.getUnitToBaseFactor()===t.getUnitToBaseFactor()&&this.getID()===t.getID()&&this.getName()===t.getName()}static isValidWkid(t){return!1}}const p={330:104878,500:104879,1300:104899,1450:104986,2230:104988,3800:104978,5e3:104919,6200:104906,8200:104909,9500:104927,9600:104977,1e4:[104911,104936],11e3:104941,11080:104872,11100:104907,12e3:104920,12400:104995,13e3:104948,14e3:[104923,104989],15e3:[104913,104954],15100:104976,16e3:[104926,104931],18e3:[104922,104982],21e3:104947,21500:104877,27e3:[104950,104957],29e3:104964,3e4:104921,31e3:104949,33e3:104946,4e4:[104914,104967],40600:104897,41900:104937,42e3:104951,43100:104993,49300:104924,50100:104939,54e3:104955,58200:104981,59500:104930,74e3:104961,77e3:104956,79e3:104962,83500:104910,85e3:104917,88800:104934,89200:104985,96e3:104997,104e3:104963,106500:104898,11e4:104938,133e3:104932,135e3:104983,17e4:104965,198200:104987,198630:104935,208e3:104966,235800:104952,249400:104929,252100:104980,255e3:104973,47e4:104972,529800:104942,531e3:104996,56e4:104928,561400:104979,578900:104945,584700:104959,593e3:104970,606e3:104999,718e3:104933,745700:104984,761400:104953,763500:104994,764e3:104940,788900:104958,1188300:104998,1195e3:104969,1352600:104968,1560800:104874,1562090:104915,1737400:104903,1821460:104918,1821490:104876,2409300:104912,2410300:104873,2439400:104974,2439700:104900,2575e3:104943,2631200:104875,2632345:104916,3393400:104904,3396190:[104905,104971],6051e3:104901,6051800:104902,637e4:104128,6370997:[4052,37008],6371e3:4035,6371007:4047,6371228:[4053,10346],6376045:[8042,8043],6376523:[4027,4901,4902],6376896:37007,6378135:[4122,4322,4324,4720,4985,4987],6378136:[4740,4923,7678,7680,9474,9475,104017,104018],6378137:[3823,3824,3888,3889,4017,4019,4023,4031,4040,4046,4055,4074,4075,4080,4081,4121,4126,4130,4133,4140,4141,4148,4151,4152,4163,4166,4167,4170,4171,4172,4173,4176,4180,4189,4190,4258,4269,4283,4318,4319,4326,4463,4466,4469,4470,4480,4482,4483,4490,4557,4558,4612,4617,4619,4624,4627,4659,4661,4667,4669,4670,4674,4686,4687,4693,4694,4702,4737,4742,4747,4749,4750,4755,4756,4757,4758,4759,4761,4762,4763,4764,4765,4883,4885,4887,4889,4893,4895,4898,4907,4909,4921,4925,4927,4929,4931,4933,4935,4937,4939,4941,4943,4945,4947,4949,4951,4953,4955,4957,4959,4961,4963,4965,4967,4971,4975,4977,4979,4981,4983,4989,4997,4999,5012,5013,5245,5246,5251,5252,5263,5264,5323,5324,5340,5342,5353,5354,5359,5360,5364,5365,5370,5371,5372,5373,5380,5381,5392,5393,5488,5489,5545,5546,5592,5593,5885,5886,6134,6135,6310,6311,6318,6319,6321,6322,6324,6325,6364,6365,6667,6668,6705,6706,6782,6783,6980,6982,6983,6987,6989,6990,7034,7035,7036,7037,7038,7039,7040,7041,7042,7072,7073,7084,7085,7086,7087,7133,7135,7136,7138,7139,7372,7373,7657,7659,7661,7663,7665,7685,7686,7797,7798,7816,7843,7844,7880,7881,7885,7886,7900,7901,7902,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7915,7917,7919,7921,7923,7925,7927,7929,7931,8085,8086,8231,8232,8235,8237,8239,8240,8244,8246,8248,8249,8251,8252,8254,8255,8399,8403,8426,8427,8449,8542,8544,8545,8684,8685,8698,8699,8817,8818,8860,8888,8899,8900,8901,8902,8906,8907,8916,8918,8920,8922,8924,8926,8928,8930,8932,8934,8936,8938,8940,8942,8944,8946,8948,8949,8972,8973,8974,8975,8976,8977,8978,8979,8980,8981,8982,8983,8984,8985,8986,8987,8988,8989,8990,8991,8992,8993,8994,8995,8996,8997,8998,8999,9e3,9002,9003,9005,9006,9008,9009,9011,9012,9013,9014,9016,9017,9018,9019,9053,9054,9055,9056,9057,9059,9060,9061,9062,9063,9064,9065,9066,9067,9068,9069,9071,9072,9074,9075,9139,9140,9147,9148,9152,9153,9183,9184,9293,9294,9299,9308,9309,9332,9333,9364,9372,9379,9380,9384,9453,9469,9470,9546,9547,9695,9696,9701,9702,9739,9754,9755,9758,9763,9776,9777,9778,9779,9781,9782,9783,9784,9866,9871,9939,9964,9969,9974,9989,9990,10175,10177,10178,10185,10191,10196,10204,10209,10214,10219,10224,10229,10237,10272,10277,10283,10284,10298,10299,10300,10304,10305,10307,10309,10310,10311,10312,10327,10328,10413,10414,10468,10474,10475,10570,10571,10605,10606,10623,10628,10638,10639,10670,10671,10672,10673,10689,10690,10724,10725,10738,10739,10761,10762,10780,10781,10784,10785,10799,10800,20033,20040,20041,20045,20046,104009,104010,104011,104012,104013,104014,104015,104016,104019,104020,104021,104022,104024,104027,104028,104050,104100,104107,104108,104110,104111,104114,104115,104116,104117,104118,104119,104120,104121,104122,104123,104124,104129,104133,104134,104137,104141,104142,104143,104144,104145,104179,104180,104181,104182,104183,104184,104185,104186,104199,104223,104257,104258,104259,104260,104286,104287,104602,104613,104644,104645,104646,104647,104653,104804,104896,104991],6378140:4610,6378145:[4025,4276,4760,4891,37001],6378150:37003,6378155:[37004,37207],6378160:[3821,4003,4021,4036,4202,4203,4237,4238,4291,4618,4708,5527,37231,104023,104136],6378166:37002,6378200:[4020,4229,4286,4303,4706],6378245:[4024,4147,4164,4178,4179,4191,4200,4205,4214,4284,4317,4555,4676,4677,4678,4991,4993,5560,5561,37257,104135],6378270:[4732,37005,37229],6378273:[4054,10345],6378300:[4029,4168,4174],6378388:[4022,4123,4153,4154,4158,4159,4160,4161,4165,4181,4182,4183,4184,4185,4192,4194,4195,4196,4199,4204,4207,4208,4215,4218,4221,4224,4225,4230,4231,4233,4235,4236,4247,4248,4249,4254,4255,4259,4264,4265,4271,4272,4274,4285,4287,4288,4292,4297,4309,4311,4313,4316,4472,4475,4611,4614,4615,4616,4621,4622,4623,4625,4626,4628,4629,4630,4631,4632,4633,4636,4637,4639,4641,4642,4643,4644,4645,4646,4658,4660,4662,4663,4664,4665,4668,4672,4673,4684,4688,4689,4690,4691,4692,4698,4704,4705,4707,4709,4710,4711,4712,4714,4715,4716,4718,4719,4721,4722,4724,4725,4727,4728,4729,4730,4733,4734,4735,4739,4741,4753,4754,4802,4803,4806,4809,4810,4823,4824,4900,5524,6883,8428,8430,8431,9248,9251,9253,9403,9893,10158,10249,10252,10635,10636,10735,10736,10758,37201,37204,37205,37212,37213,37214,37215,37216,37217,37218,37219,37221,37222,37224,37226,37227,37230,37232,37233,37234,37235,37237,37238,37241,37242,37245,37246,37247,37249,37250,37251,37253,37259,104104,104106,104125,104126,104127,104130,104138,104248],6378523:104786,24764e3:104960,25559e3:104944,60268e3:104925,71492e3:104908,6957e5:104975,6377397.155:[3819,3906,4004,4120,4124,4125,4149,4150,4156,4162,4211,4219,4257,4262,4280,4289,4294,4295,4301,4306,4308,4312,4314,4613,4666,4745,4746,4801,4804,4805,4808,4813,4814,4815,4818,4820,4904,5132,5228,5229,5681,5830,8351,9267,10268,37255,104101,104102,104105,104131,104648,104696,104697,104990,104992],6377563.396:[4001,4188,4277,4278,4279],6377340.189:[4002,4299,4300],6377492.018:[4005,4273,4817],6377483.865280418:[4006,4293],6378293.645208759:[4007,4157,4302,4738,5464],6378206.4:[4008,4127,4128,4129,4135,4136,4137,4138,4139,4169,4216,4242,4253,4267,4608,4609,4638,4675,4683,4695,4717,4723,4726,4995,5451,5467,37220,37239,37243,37252,37260,104e3,104109,104112,104113,104132],6378450.047:[4009,4268],6378300.789:[4010,4281],6378249.2:[4011,4014,4155,4193,4206,4213,4223,4226,4227,4228,4252,4261,4266,4275,4282,4296,4304,4310,4315,4671,4807,4811,4816,4821,37223,37225,104139,104140,104261,104304],6378249.145:[4012,4013,4132,4134,4142,4143,4175,4197,4198,4201,4209,4210,4212,4220,4222,4232,4234,4246,4250,4251,4256,4260,4263,4270,4305,4307,4600,4601,4602,4603,4604,4605,4606,4607,4620,4679,4680,4696,4697,4699,4700,4701,4703,4713,4731,4736,4743,4744,4812,4819,6881,6882,6892,6894,8694,37206,37208,37211,37228,37240,37254,104025,104026,104103,104305],6377276.345:[4015,4131,4144,4239,4240,4244,4682,5233,6207,37202,104256,104664,104693],6377298.556:[4016,4298],6377304.063:[4018,4245],6378298.3:[4028,4903],6378136.2:4032,6378136.3:4033,6378249.144808011:[4034,4241],20922931.8:[4042,4243],6377301.243:[4044,4145,37203],6377299.151:[4045,4146],6377019.27:[4657,10256,10260,10265],6378306.3696:[4748,4752],6377295.664:[4751,37006],6378136.5:[7682,7683],6371008.7714:104047,6378418.941:[104700,104726,104760],6378586.581:[104701,104743],6378505.809:104702,6378544.823:104703,6378490.569:104704,6378470.757:[104705,104776],6378403.701:[104706,104750],6378434.181:[104707,104724,104739,104764],6378454.907:104708,6378400.653:104709,6378567.378:104710,6378546.957:[104711,104717,104780],6378476.853:[104712,104736],6378411.321:[104713,104728],6378647.541:[104714,104715],6378514.953:[104716,104782],6378421.989:[104718,104770],6378481.425:[104719,104753,104774,104781],6378518.001:[104720,104725],6378521.049:[104721,104723,104731,104745,104748],6378464.661:104722,6378436.619:104727,6378574.389:[104729,104730],6378472.281:[104732,104756],6378498.189:[104733,104746],6378449.421:[104734,104766],6378525.621:[104735,104754],6378466.185:104737,6378496.665:104738,6378643.579:104740,6378559.758:104741,6378414.369:[104742,104763,104772],6378441.801:104744,6378502.761:[104747,104759,104773,104775],6378617.061:104749,6378624.681:[104751,104765],6378468.623:104752,6378445.763:[104755,104758,104761],6378670.401:104757,6378438.753:104762,6378543.909:104767,6378605.783:104768,6378540.861:104769,6378443.325:[104771,104784],6378548.481:104777,6378463.746:104778,6378426.561:104779,6378453.688:104783,6378530.193:104785,6378376.271:[104800,104828],6378471.92:104801,6378472.931:104802,6378411.351:104803,6378380.991:104805,6378414.96:104806,6378345.09:[104807,104819,104844,104870],6378412.542:104808,6378470.401:104809,6378376.331:104810,6378379.031:104811,6378407.621:104812,6378376.811:[104813,104827],6378313.92:104814,6378414.93:104815,6378413.021:104816,6378380.381:104817,6378530.851:104818,6378591.521:104820,6378378.881:104821,6378408.481:[104822,104832],6378375.601:[104823,104838],6378408.041:104824,6378655.071:104825,6378409.151:104826,6378315.7:[104829,104840,104845,104851],6378285.86:[104830,104835,104859],6378379.301:104831,6378560.121:104833,6378531.821:104834,6378500.6:104836,6378376.041:104837,6378406.601:104839,6378438.991:104841,6378345.42:104842,6378593.86:104843,6378381.271:[104846,104847],6378413.671:104848,6378344.377:104849,6378563.891:104850,6378408.091:104852,6378377.671:104853,6378472.751:104854,6378412.511:104855,6378407.281:104856,6378534.451:104857,6378406.051:104858,6378532.921:104860,6378380.091:104861,6378408.941:104862,6378624.171:104863,6378377.411:104864,6378474.591:104865,6378407.141:104866,6378376.871:104867,6378375.251:104868,6378405.971:104869,6378437.651:104871};class f extends _{constructor(t){if("number"==typeof t)return super(),this.m_factor=t,void(this.m_wkid=0);super(t)}getUnitType(){return 1}convertFromRadians(t){return t/this.getUnitToBaseFactor()}convertToRadians(t){return t*this.getUnitToBaseFactor()}}function x(t){return new Hr}class P{constructor(t,e,s){void 0===t?(this.x=new a.H,this.y=new a.H,this.z=new a.H):t instanceof o.d?(this.x=new a.H(t.x),this.y=new a.H(t.y),this.z=new a.H(t.z)):t instanceof a.H?(this.x=t.clone(),this.y=e.clone(),this.z=s.clone()):(0,i.a)("EPoint3D constructor")}dotProduct(t){return this.x.mulE(t.x).addE(this.y.mulE(t.y)).addE(this.z.mulE(t.z))}crossProduct(t){return new P(this.y.mulE(t.z).subE(this.z.mulE(t.y)),this.z.mulE(t.x).subE(this.x.mulE(t.z)),this.x.mulE(t.y).subE(this.y.mulE(t.x)))}crossProductVector(t){const e=this.y.mulE(t.z).subE(t.y.mulE(this.z)),s=t.x.mulE(this.z).subE(this.x.mulE(t.z)),n=this.x.mulE(t.y).subE(t.x.mulE(this.y));return new P(e,s,n)}sqrLength(){return this.x.mulE(this.x).addE(this.y.mulE(this.y)).addE(this.z.mulE(this.z))}length(){return this.sqrLength().sqrt()}static distance(t,e){return t.sub(e).length()}negate(){return new P(this.x.negate(),this.y.negate(),this.z.negate())}add(t){return new P(this.x.addE(t.x),this.y.addE(t.y),this.z.addE(t.z))}sub(t){return new P(this.x.subE(t.x),this.y.subE(t.y),this.z.subE(t.z))}subThis(t){return this.x.subThisE(t.x),this.y.subThisE(t.y),this.z.subThisE(t.z),this}addThis(t){return this.x.addThisE(t.x),this.y.addThisE(t.y),this.z.addThisE(t.z),this}mul(t){return new P(this.x.mulE(t),this.y.mulE(t),this.z.mulE(t))}div(t){return new P(this.x.divE(t),this.y.divE(t),this.z.divE(t))}eq(t){return this.x.eq(t.x)&&this.y.eq(t.y)&&this.z.eq(t.z)}isZero(){return this.x.isZero()&&this.y.isZero()&&this.z.isZero()}value(){return o.d.construct(this.x.value(),this.y.value(),this.z.value())}}class y{constructor(t){if(this.m_origin=new o.d,this.m_normal=new o.d,this.m_axisX=new o.d,this.m_axisY=new o.d,!t)return this.m_origin=new o.d,this.m_normal=new o.d(0,0,1),this.m_axisX=new o.d(1,0,0),void(this.m_axisY=new o.d(0,1,0));t.pt0&&t.pt1&&t.pt2?this.setFromPoints(t.pt0,t.pt1,t.pt2):(0,i.g)(0,`unimplemented constructor options ${JSON.stringify(t)}`)}assign(t){return(0,i.g)(0),this}set(t,e,s,n){(0,i.g)(0)}setFromPoints(t,e,s){let n=e.sub(t);const i=s.sub(t);this.m_normal=n.crossProductVector(i);let r=!0;if(this.m_normal.isZero()){if(r=!1,n.isZero()&&(n=i),n.isZero()){const e=0,s=1;return this.m_normal.setCoords(e,e,s),this.m_axisX.setCoords(s,e,e),this.m_axisY.setCoords(e,s,e),this.m_origin=t,!1}this.m_axisX=n.getUnitVector(),this.m_normal=this.m_axisX.createAPerpendicular()}else this.m_normal.normalizeThis(),this.m_axisX=n.getUnitVector();return this.m_axisY=this.m_normal.crossProductVector(this.m_axisX),this.m_origin=t,r}getCoord(t,e){return(0,i.g)(0),{}}getCoord2D(t){return(0,i.g)(0),{}}getCoordX(t,e){return(0,i.g)(0),0}getCoordY(t,e){return(0,i.g)(0),0}getCoordZ(t,e){return(0,i.g)(0),0}setPreferredAxisX(t){(0,i.g)(0)}getOrigin(){return(0,i.g)(0),{}}getNormal(){return(0,i.g)(0),{}}getAxisX(){return this.m_axisX.clone()}getAxisY(){return this.m_axisY.clone()}setAxisX(t,e=!1){(0,i.g)(0)}setAxisY(t,e=!1){(0,i.g)(0)}recalculateAxisY(){(0,i.g)(0)}setOrigin(t){(0,i.g)(0)}setNormal(t,e){(0,i.g)(0)}intersect(t,e){return(0,i.g)(0),!1}intersectLine(t){return(0,i.g)(0),0}intersectLineEx(t,e){return(0,i.g)(0),0}closestCoordinate(t){const e=t.sub(this.m_origin),s=new a.P;return s.x=e.dotProduct(this.m_axisX),s.y=e.dotProduct(this.m_axisY),s}projectVector(t){return(0,i.g)(0),{}}signedDistance(t){return(0,i.g)(0),0}distance(t){return(0,i.g)(0),0}}function E(t,e){return!1}function C(t,e,s,n,r=100,o=E){let h,m,l,u,c,g,d,_,p;(0,i.g)(n>0);let f,x,P,y=0,C=0;const v=(0,a.aq)();e>s&&(s=(0,a.c)(e,e=s));const S=t(e),b=t(s);S<b?(h=m=l=e,u=c=g=S):(h=m=l=s,u=c=g=b);let I=0;for(;I<r&&(P=.5*(s-e),p=e+P,f=n*(Math.abs(h)+.25),x=2*f,!(o(h,u)||Math.abs(h-p)<=x-P));++I){if(Math.abs(C)>f){const t=(h-m)*(u-g);let n=(h-l)*(u-c),i=(h-l)*n-(h-m)*t;n=2*(n-t),n>0&&(i=-i),n=Math.abs(n);const r=C;C=y,Math.abs(i)>=Math.abs(n*r*.5)||i<=n*(e-h)||i>=n*(s-h)?(C=h>=p?e-h:s-h,y=(0,a.aq)()*C):(y=i/n,_=h+y,(_-e<x||s-_<x)&&(y=p-h<0?-Math.abs(f):Math.abs(f)))}else C=h>=p?e-h:s-h,y=C*v;_=h+y,d=t(_),d<u?(_>=h?e=h:s=h,l=m,m=h,h=_,g=c,c=u,u=d):(_<h?e=_:s=_,d<=c||m===h?(l=m,m=_,g=c,c=d):(d<=g||l===h||l===m)&&(l=_,g=d))}return(0,a.l)(h,u)}function v(t,e,s){return t>s?t-=Math.ceil((t-s)/a.p)*a.p:t<e&&(t+=Math.ceil((e-t)/a.p)*a.p),t}function S(t,e,s){return function(t,e,s){const n=s.x,i=s.y;return b(t,e,Math.cos(n),Math.sin(n),Math.cos(i),Math.sin(i),0)}(t,e,s)}function b(t,e,s,n,i,r,a){const h=t/Math.sqrt(1-e*r*r),m=h+a,l=m*i*s,u=m*i*n,c=(h*(1-e)+a)*r;return o.d.construct(l,u,c)}function I(t,e,s){const n=new a.H,i=new a.H,r=new a.H,o=new a.H;n.setCos(s.x),i.setSin(s.x),r.setCos(s.y),o.setSin(s.y);const h=o.negate().mulE(o.mul(e)).add(1).sqrt(),m=new a.H(t).divE(h),l=m.mulE(r).mulE(n),u=m.mulE(r).mulE(i),c=m.mul(1-e).mulE(o);return new P(l,u,c)}function D(t,e,s){const n=s.x,i=s.y,r=s.z,o=Math.atan2(i,n),h=Math.sqrt(n*n+i*i),m=Math.atan2(r,(1-e)*h);return a.P.construct(o,m)}function w(t,e,s){const n=1-e,i=t/Math.sqrt((0,a.a)(s.x)+(0,a.a)(s.y)+(0,a.a)(s.z)/n);return s.mul(i)}function T(t,e,s,n,i){const r=S(t,e,s),a=S(t,e,n);return D(0,e,o.d.lerp(r,a,i))}function N(t,e,s){const n=new o.d;return n.setCrossProductVector(e,s),Math.abs(Math.atan2(n.length(),e.dotProduct(s)))*t}function A(t,e,s,n,i){const r=s.getUnitVector(),a=n.getUnitVector(),h=e.getUnitVector(),m=new o.d;if(m.setCrossProductVector(r,a),!m.isZero()){m.normalizeThis();const e=h.sub(m.mul(m.dotProduct(h)));if(!e.isZero()){e.normalizeThis();const s=r.add(a).mul(.5);if(s.dotProduct(e)>s.dotProduct(r)){const s=Math.abs(m.dotProduct(h)),n=Math.asin(s);return i.assign(e.getUnitVector().mul(t)),n*t}}}const l=N(1,r,h),u=N(1,a,h);return l<=u?(i.assign(s),l*t):(i.assign(n),u*t)}function G(t,e,s,n,r,m=0,l){if(2===m||3===m)return function(t,e,s,n,i,r=!1,h){const m=w(t,e,s);if(r){const r=new y({pt0:new o.d(0,0,0),pt1:n,pt2:i}),l=r.closestCoordinate(s),u=r.closestCoordinate(n),c=r.closestCoordinate(i),g=a.P.getClosestCoordinate(u,c,l),d=w(t,e,o.d.lerp(n,i,g)),_=o.d.distance(d,m);return h&&h.assign(d),(0,a.l)(g,_)}const l=s=>{const r=w(t,e,o.d.lerp(n,i,s));return o.d.distance(r,m)},u=o.d.distance(n,i);if(u>0){const s=R(t,u),{first:r,second:m}=C(l,0,1,s);return h&&h.assign(w(t,e,o.d.lerp(n,i,r))),(0,a.l)(r,m)}{const t=o.d.distance(s,n);return h&&h.assign(s),(0,a.l)(.5,t)}}(t,e,s,n,r,3===m,l);const u=D(0,e,s),c=s=>{const a=D(0,e,o.d.lerp(n,r,s));return function(t,e,s,n,r){switch((0,i.g)(s.isFinite()&&n.isFinite()),r){case 0:return function(t,e,s,n){const i={stack:[],error:void 0,hasError:!1};try{const r=(0,h.b)(i,new Ao,!1);return Ro.geodeticDistance(t,e,s.x,s.y,n.x,n.y,r,null,null,qo.PE_LINETYPE_GEODESIC),r.val}catch(t){i.error=t,i.hasError=!0}finally{(0,h.c)(i)}}(t,e,s,n);case 1:return function(t,e,s){const n={stack:[],error:void 0,hasError:!1};try{const i=(0,h.b)(n,new Ao,!1);return Ro.greatEllipticDistance(t,e,s.x,s.y,s.x,s.y,i,null,null),i.val}catch(t){n.error=t,n.hasError=!0}finally{(0,h.c)(n)}}(t,e,s);case 2:case 3:{const i=S(t,e,s),r=S(t,e,n);return o.d.distance(i,r)}default:(0,i.t)("")}}(t,e,u,a,m)},g=o.d.distance(n,r);if(g>0){const s=R(t,g),{first:i,second:h}=C(c,0,1,s);return l&&l.assign(w(t,e,o.d.lerp(n,r,i))),(0,a.l)(i,h)}{const t=c(0);return l&&l.assign(n),(0,a.l)(.5,t)}}function q(t,e,s,n,i,o){if(o[0]=Number.NaN,o[1]=Number.NaN,Math.abs(s.x-n.x)>Math.PI)return 0;if(Math.abs(s.y)>a.o||Math.abs(n.y)>a.o)return 0;if((Math.abs(s.y)===a.o||Math.abs(n.y)===a.o)&&s.x!==n.x)return 0;if(Math.abs(i)>=a.o)return 0;if(s.y>0&&n.y>0&&s.y>i&&n.y>i||s.y<0&&n.y<0&&s.y<i&&n.y<i)return 0;const h=r.a0.constructPoint2D(s),m=r.a0.constructPoint2D(n),l=I(1,e,h),u=I(1,e,m),c=l.crossProductVector(u);if(c.z.isZero())return a.E.construct(s.y,n.y).containsCoordinate(i)?(o[0]=s.x,1):0;const g=c.x.divE(c.z.negate()),d=c.y.divE(c.z.negate()),_=g.mulE(g).addE(d.mulE(d)).sqrt();if(_.isZero()||g.isZero()&&d.isZero())return 0===i?(o[0]=s.x,o[1]=n.x,2):0;const p=(1-e)*Math.tan(i)/_.value();if(Math.abs(p)>1)return 0;const f=Math.acos(p),x=Math.atan2(d.value(),g.value()),P=x-f;let y=x+f;const E=Math.min(s.x,n.x),C=Math.max(s.x,n.x);v(P,E,C),0!==i?v(y,E,C):y=P;let S=0;return E<=P&&P<=C&&(o[S]=P,S++),y!==P&&E<=y&&y<=C&&(o[S]=y,S++),S}function M(t,e){e[0]>.5*Math.PI?(t[0]+=Math.PI,e[0]=Math.PI-e[0]):e[0]<.5*-Math.PI&&(t[0]-=Math.PI,e[0]=-Math.PI-e[0]),(0,i.g)(e[0]>=.5*-Math.PI&&e[0]<=.5*Math.PI)}function F(t,e,s,n,i){n=(0,a.s)(n,-a.o,a.o),i=(0,a.s)(i,-a.o,a.o);const r=a.o-.03;let o;return o=n>r&&i>r||n<-r&&i<-r?function(t,e,s){let n=1;if(e<0&&(n=-1,e=-e,s=-s),0!==t){const i=t*t,r=i*t,o=[1,(1+11*t)/12,(1+118*t+241*i)/360,(1+1089*t+10419*i+8651*r)/20160,(1+9836*t+318246*i+1027436*r+r*t*458881)/1814400],h=e=>{let s=0;const n=(0,a.a)(e)/(t-1);for(let t=o.length-1;t>=0;--t)s=o[t]+s*n;return s*=-(0,a.a)(e/(1-t)),s},m=h(a.o-e);return(h(a.o-s)-m)*n}{const t=a.o-e,i=a.o-s,r=-4*(0,a.a)(Math.sin(t/2));return(-4*(0,a.a)(Math.sin(i/2))-r)*n}}(t,n,i):V(t,i)-V(t,n),.5*(s-e)*o*function(t){return 1-t}(t)}function V(t,e){if(0===e)return 0;const s=Math.sin(e);let n=s,i=s;if(0!==t){n/=1-t*s*s;const e=Math.sqrt(t);i=s*(0,a.y)(e*s)}return n+i}function Y(t,e){return t/Math.sqrt(1-e)}function X(t,e){return(1-e)*t}function R(t,e){if(0!==e){const s=t*(0,a.aJ)()/e;return Math.min(s,1e-10)}return 0}class H{constructor(t){this.m_currentShift=63n,this.m_currentElt=0n,this.m_iCurrentElt=-1,this.m_parent=t,this.m_aiSetElts=t.m_bits.flatMap(((t,e)=>e))}next(){if(this.m_currentShift++,64n===this.m_currentShift){if(this.m_iCurrentElt++,this.m_iCurrentElt===this.m_aiSetElts.length)return H.npos();this.m_currentShift=0n,this.m_currentElt=this.m_parent.m_bits[this.m_aiSetElts[this.m_iCurrentElt]]}for(;this.m_currentShift<63n&&!(this.m_currentElt&1n<<this.m_currentShift);)this.m_currentShift++;return this.m_currentElt&1n<<this.m_currentShift?64*this.m_aiSetElts[this.m_iCurrentElt]+Number(this.m_currentShift):this.next()}static npos(){return Number.MAX_SAFE_INTEGER}}function k(t){return 1n<<(0x3fn&BigInt(t))}function L(t){return t>>6}class B{constructor(t){this.m_bits=[],void 0!==t&&t.copy&&(this.m_bits=t.copy.m_bits.slice())}assignMove(){return this}assignCopy(){return this}hasBit(t){const e=k(t),s=L(t);return void 0!==this.m_bits[s]&&!!(this.m_bits[s]&e)}setBit(t){const e=k(t),s=L(t);void 0===this.m_bits[s]&&(this.m_bits[s]=0n),this.m_bits[s]|=e}clearBit(t){}flipBit(t){const e=k(t),s=L(t);return void 0===this.m_bits[s]&&(this.m_bits[s]=0n),this.m_bits[s]^=e,0n!==(this.m_bits[s]&e)}clear(){this.m_bits.length=0}isZero(){let t=0;return this.m_bits.forEach((e=>{t|=e?2:1})),!(2&t)}equals(t){if(this===t)return!0;if(this.m_bits.length!==t.m_bits.length)return!1;let e=0;return this.m_bits.forEach(((s,n)=>{e|=s===t.m_bits[n]?2:1})),!(1&e||(t.m_bits.forEach(((t,s)=>{e|=t===this.m_bits[s]?2:1})),1&e))}notEquals(t){return!this.equals(t)}assignOr(t){return t.m_bits.forEach(((t,e)=>{void 0===this.m_bits[e]?this.m_bits[e]=t:this.m_bits[e]|=t})),this}assignSubtract(t){return t.m_bits.forEach(((t,e)=>{void 0!==this.m_bits[e]&&(this.m_bits[e]&=~t)})),this}assignAnd(t){return t.m_bits.forEach(((t,e)=>{void 0!==this.m_bits[e]&&(this.m_bits[e]&=t)})),this}assignXor(t){return t.m_bits.forEach(((t,e)=>{void 0===this.m_bits[e]?this.m_bits[e]=t:this.m_bits[e]^=t})),this}getHashCode(){return this.m_bits.reduce(((t,e)=>(0,a.aB)(t,e)),(0,a.au)(0))}getUnorderedBitIterator(){return new H(this)}}class z{constructor(t,e){this.m_map=new Map,this.m_hf=t,this.m_ef=e}add(t){const e=this.m_hf(t);if(!this.m_map.has(e))return this.m_map.set(e,t),this;const s=this.m_map.get(e);return s instanceof Array?s.find((e=>this.m_ef(e,t)))||s.push(t):this.m_ef(s,t)||this.m_map.set(e,[s,t]),this}clear(){this.m_map.clear()}delete(t){return!1}has(t){const e=this.m_hf(t);if(!this.m_map.has(e))return!1;const s=this.m_map.get(e);return s instanceof Array?void 0!==s.find((e=>this.m_ef(e,t))):this.m_ef(s,t)}get(t){const e=this.m_hf(t),s=this.m_map.get(e);if(void 0!==s)return s instanceof Array?s.find((e=>this.m_ef(e,t))):s}get size(){let t=0;for(const e of this.m_map.values())t+=e instanceof Array?e.length:1;return t}forEach(t,e){}[Symbol.iterator](){return(new Set)[Symbol.iterator]()}entries(){return(new Set).entries()}keys(){return(new Set).keys()}values(){return(new Set).values()}get[Symbol.toStringTag](){return"ValueSet"}}class U extends o.a3{constructor(t){super(),this.m_bufferLeft=new r.S,this.m_bufferRight=new r.S,this.m_intervalLeft=a.E.constructEmpty(),this.m_intervalRight=a.E.constructEmpty(),this.m_yScanline=Number.NaN,this.m_helper=t}compare(t,e,s){const n=e,i=t.getElement(s);this.m_helper.querySegmentXY(n,this.m_bufferLeft),this.m_helper.querySegmentXY(i,this.m_bufferRight);const r=this.m_bufferLeft.get(),o=this.m_bufferRight.get();if(this.m_intervalLeft.setCoords(r.getStartX(),r.getEndX()),this.m_intervalRight.setCoords(o.getStartX(),o.getEndX()),this.m_intervalLeft.vmax<this.m_intervalRight.vmin)return-1;if(this.m_intervalLeft.vmin>this.m_intervalRight.vmax)return 1;const a=r.getStartY()===r.getEndY(),h=o.getStartY()===o.getEndY();if(a||h){if(a&&h)return 0;if(r.getStartY()===o.getStartY()&&r.getStartX()===o.getStartX())return a?1:-1;if(r.getEndY()===o.getEndY()&&r.getEndX()===o.getEndX())return a?-1:1}let m=r.intersectionOfYMonotonicWithAxisX(this.m_yScanline,this.m_intervalLeft.vmin),l=o.intersectionOfYMonotonicWithAxisX(this.m_yScanline,this.m_intervalRight.vmin);if(m===l){const t=r.getEndY(),e=o.getEndY(),s=Math.min(t,e);let n=.5*(s+this.m_yScanline);n===this.m_yScanline&&(n=s),m=r.intersectionOfYMonotonicWithAxisX(n,this.m_intervalLeft.vmin),l=o.intersectionOfYMonotonicWithAxisX(n,this.m_intervalRight.vmin)}return m<l?-1:m>l?1:0}setY(t){this.m_yScanline=t}}class O{constructor(t){this.m_segmentBuffer=new r.S,this.m_point=a.P.getNAN(),this.m_parent=t}setPointXY(t){this.m_point.assign(t)}compare(t,e){const s=t.getElement(e);this.m_parent.querySegmentXY(s,this.m_segmentBuffer);const n=this.m_segmentBuffer.get(),i=new a.E;if(i.setCoords(n.getStartX(),n.getEndX()),this.m_point.x<i.vmin)return-1;if(this.m_point.x>i.vmax)return 1;const r=n.intersectionOfYMonotonicWithAxisX(this.m_point.y,this.m_point.x);return this.m_point.x<r?-1:this.m_point.x>r?1:0}}var W,j,Z;function Q(t,e){return{parentage:t,rank:e}}function K(t,e){const s=t.length;if(s!==e.length)return!1;const n=t[0].parentage;if(n!==e[0].parentage)return!1;if(-1===n)return!0;for(let n=1;n<s;++n)if(t[n].parentage!==e[n].parentage)return!1;return!0}function $(t,e,s){s.length=0;let n=!1;{let i=t.getHalfEdgeVertexIterator(e);for(;i!==r.n;){const e=t.getVertexFromVertexIterator(i),r=t.getShape().getSegmentRank(e),o=t.getShape().getSegmentParentage(e);n||=o>=0,s.push(Q(o,r)),i=t.incrementVertexIterator(i)}}{let i=t.getHalfEdgeVertexIterator(t.getHalfEdgeTwin(e));for(;i!==r.n;){const e=t.getVertexFromVertexIterator(i),r=t.getShape().getSegmentRank(e),o=t.getShape().getSegmentParentage(e);n||=o>=0,s.push(Q(o,r)),i=t.incrementVertexIterator(i)}}n&&s.sort(((t,e)=>t.rank>e.rank?-1:t.rank<e.rank?1:t.parentage<e.parentage?-1:t.parentage>e.parentage?1:0)),-1===s[0].parentage&&(s.length=1)}(Z=W||(W={}))[Z.enumInputModeBuildGraph=0]="enumInputModeBuildGraph",Z[Z.enumInputModeSimplifyAlternate=1]="enumInputModeSimplifyAlternate",Z[Z.enumInputModeSimplifyWinding=2]="enumInputModeSimplifyWinding",function(t){t[t.enumSegmentParentageBreakNode=1]="enumSegmentParentageBreakNode",t[t.enumPathBreakNode=2]="enumPathBreakNode"}(j||(j={}));class J{constructor(){this.m_shape=null,this.m_clusterData=new o.S(8),this.m_clusterVertices=new o.S(2),this.m_firstCluster=r.n,this.m_lastCluster=r.n,this.m_halfEdgeData=new o.S(8),this.m_chainData=new o.S(8),this.m_chainAreas=null,this.m_chainPerimeters=null,this.m_universeChain=-1,this.m_simplifiedGeometry=-1,this.m_edgeIndices=[],this.m_clusterIndices=[],this.m_chainIndices=[],this.m_bBuildGeometryParentageSets=!1,this.m_chainBitSetIndex=-1,this.m_edgeBitSetIndex=-1,this.m_edgeBitSetIndexLeft=-1,this.m_emptyBitSet=null,this.m_geometryMapID=null,this.m_uniqueBitSets=null,this.m_chainBitSets=[],this.m_edgeBitSets=[],this.m_checkDirtyPlanesweepTolerance=Number.NaN,this.m_geometryIDIndex=-1,this.m_clusterIndex=-1,this.m_halfEdgeIndex=-1,this.m_tmpHalfEdgeParentageIndex=-1,this.m_tmpHalfEdgeParentageIndexLeft=-1,this.m_tmpHalfEdgeWindingNumberIndex=-1,this.m_tmpHalfEdgeOddEvenNumberIndex=-1,this.m_segmentParentageIndex=-1,this.m_segmentIndexHe=-1,this.m_clusterBreakNodeIndex=-1,this.m_universeGeomID=-1,this.m_pointCount=0,this.m_progressCounter=0,this.m_bBuildChains=!0,this.m_bDirtyCheckFailed=!1}setCheckDirtyPlanesweepTolerance(t){this.m_checkDirtyPlanesweepTolerance=t}dirtyCheckFailed(){return this.m_bDirtyCheckFailed}getShape(){return this.m_shape}setEditShape(t,e,s=!0,n=!1){n?this.setEditShapeImpl3D_(t,W.enumInputModeBuildGraph,null,e,!1):this.setEditShapeImpl_(t,W.enumInputModeBuildGraph,null,e,s)}setAndSimplifyEditShapeAlternate(t,e,s=null,n=!1){const r=[];r.push(e),this.m_simplifiedGeometry=e,n?this.setEditShapeImpl3D_(t,W.enumInputModeSimplifyAlternate,r,s,!1):this.setEditShapeImpl_(t,W.enumInputModeSimplifyAlternate,r,s,t.getGeometryType(e)===i.G.enumPolygon)}setAndSimplifyEditShapeWinding(t,e,s=null){const n=[];n.push(e),this.m_simplifiedGeometry=e,this.setEditShapeImpl_(t,W.enumInputModeSimplifyWinding,n,s,!0)}removeShape(){null!==this.m_shape&&(-1!==this.m_geometryIDIndex&&(this.m_shape.removeGeometryUserIndex(this.m_geometryIDIndex),this.m_geometryIDIndex=-1),-1!==this.m_clusterIndex&&(this.m_shape.removeUserIndex(this.m_clusterIndex),this.m_clusterIndex=-1),-1!==this.m_halfEdgeIndex&&(this.m_shape.removeUserIndex(this.m_halfEdgeIndex),this.m_halfEdgeIndex=-1),-1!==this.m_tmpHalfEdgeParentageIndex&&(this.deleteUserIndexForHalfEdges(this.m_tmpHalfEdgeParentageIndex),this.m_tmpHalfEdgeParentageIndex=-1),-1!==this.m_tmpHalfEdgeParentageIndexLeft&&(this.deleteUserIndexForHalfEdges(this.m_tmpHalfEdgeParentageIndexLeft),this.m_tmpHalfEdgeParentageIndexLeft=-1),-1!==this.m_tmpHalfEdgeWindingNumberIndex&&(this.deleteUserIndexForHalfEdges(this.m_tmpHalfEdgeWindingNumberIndex),this.m_tmpHalfEdgeWindingNumberIndex=-1),-1!==this.m_tmpHalfEdgeOddEvenNumberIndex&&(this.deleteUserIndexForHalfEdges(this.m_tmpHalfEdgeOddEvenNumberIndex),this.m_tmpHalfEdgeOddEvenNumberIndex=-1),-1!==this.m_segmentParentageIndex&&(this.deleteUserIndexForHalfEdges(this.m_segmentParentageIndex),this.m_segmentParentageIndex=-1),-1!==this.m_segmentIndexHe&&(this.deleteUserIndexForHalfEdges(this.m_segmentIndexHe),this.m_segmentIndexHe=-1),-1!==this.m_clusterBreakNodeIndex&&(this.deleteUserIndexForClusters(this.m_clusterBreakNodeIndex),this.m_clusterBreakNodeIndex=-1),this.deleteEdgeBitSets_(),this.deleteChainBitSets_(),this.m_emptyBitSet=null,this.m_geometryMapID=null,this.m_shape=null,this.m_clusterData.deleteAll(!0),this.m_clusterVertices.deleteAll(!0),this.m_firstCluster=r.n,this.m_lastCluster=r.n,this.m_halfEdgeData.deleteAll(!0),this.m_edgeIndices.length=0,this.m_clusterIndices.length=0,this.m_chainIndices.length=0,this.m_chainData.deleteAll(!0),this.m_universeChain=r.n,this.m_chainAreas=null)}getClusterHalfEdge(t){return this.m_clusterData.getField(t,2)}queryXY(t,e){const s=this.getClusterVertexIndex_(t);e.assign(this.m_shape.getXYWithIndex(s))}queryXYZ(t,e){(0,i.g)(0)}getClusterParentage(t){return this.m_clusterData.getField(t,1)}getFirstCluster(){return this.m_firstCluster}getPrevCluster(t){return this.m_clusterData.getField(t,3)}getNextCluster(t){return this.m_clusterData.getField(t,4)}getClusterChain(t){return this.m_clusterData.getField(t,6)}getClusterVertexIterator(t){return this.m_clusterData.getField(t,7)}incrementVertexIterator(t){return this.m_clusterVertices.getField(t,1)}getVertexFromVertexIterator(t){return this.m_clusterVertices.getField(t,0)}getClusterUserIndex(t,e){const s=this.getClusterIndex_(t),n=this.m_clusterIndices[e];return n.size()<=s?-1:n.read(s)}setClusterUserIndex(t,e,s){const n=this.getClusterIndex_(t),i=this.m_clusterIndices[e];i.size()<=n&&i.resize(this.m_clusterData.size(),-1),i.write(n,s)}hasClusterUserIndexFlags(t,e,s){if(-1===e)return!1;const n=this.getClusterUserIndex(t,e);return-1!==n&&0!==(s&n)}setClusterUserIndexFlags(t,e,s){const n=this.getClusterIndex_(t),i=this.m_clusterIndices[e];i.size()<=n&&i.resize(this.m_clusterData.size(),-1);let r=i.read(n);-1===r&&(r=0),i.write(n,s|r)}clearClusterUserIndexFlags(t,e,s){const n=this.getClusterIndex_(t),i=this.m_clusterIndices[e];i.size()<=n&&i.resize(this.m_clusterData.size(),-1);let r=i.read(n);-1===r&&(r=0),i.write(n,~s&r)}createUserIndexForClusters(t=-1){const e=new o.A(this.m_clusterData.capacity(),t);for(let t=0,s=this.m_clusterIndices.length;t<s;t++)if(null===this.m_clusterIndices[t])return this.m_clusterIndices[t]=e,t;return this.m_clusterIndices.push(e),this.m_clusterIndices.length-1}deleteUserIndexForClusters(t){this.m_clusterIndices[t]=null}getHalfEdgeOrigin(t){return this.m_halfEdgeData.getField(t,1)}getHalfEdgeTo(t){return this.getHalfEdgeOrigin(this.getHalfEdgeTwin(t))}getHalfEdgeTwin(t){return this.m_halfEdgeData.getField(t,4)}getHalfEdgePrev(t){return this.m_halfEdgeData.getField(t,5)}getHalfEdgeNext(t){return this.m_halfEdgeData.getField(t,6)}getHalfEdgeChain(t){return this.m_halfEdgeData.getField(t,2)}getHalfEdgeFaceParentage(t){return this.getChainParentage(this.getHalfEdgeChain(t))}getHalfEdgeVertexIterator(t){return this.m_halfEdgeData.getField(t,7)}getHalfEdgeFromXY(t,e){this.queryXY(this.getHalfEdgeOrigin(t),e)}getHalfEdgeToXY(t,e){this.queryXY(this.getHalfEdgeTo(t),e)}isHalfEdgeCurve(t){return-1!==this.m_segmentIndexHe&&-1!==this.getHalfEdgeUserIndex(t,this.m_segmentIndexHe)}getHalfEdgeFromXYZ(t,e){(0,i.g)(0)}getHalfEdgeToXYZ(t,e){(0,i.g)(0)}getHalfEdgeParentage(t){return this.m_halfEdgeData.getField(t,3)&J.c_EdgeParentageMask}getHalfEdgeUserIndex(t,e){const s=this.getHalfEdgeIndex_(t),n=this.m_edgeIndices[e];return n.size()<=s?-1:n.read(s)}setHalfEdgeUserIndex(t,e,s){const n=this.getHalfEdgeIndex_(t),i=this.m_edgeIndices[e];i.size()<=n&&i.resize(this.m_halfEdgeData.size(),-1),i.write(n,s)}createUserIndexForHalfEdges(t){void 0===t&&(t=-1);const e=new o.A(this.m_halfEdgeData.capacity(),t);for(let t=0,s=this.m_edgeIndices.length;t<s;t++)if(null===this.m_edgeIndices[t])return this.m_edgeIndices[t]=e,t;this.m_edgeIndices.push(e);const s=this.m_edgeIndices.length-1;return(0,i.g)(s>=0&&s<=Number.MAX_SAFE_INTEGER),s}deleteUserIndexForHalfEdges(t){this.m_edgeIndices[t]=null}deleteEdgesBreakFaces_(t){for(let e=0,s=t.length;e<s;e++){const s=t[e],n=this.getHalfEdgeChain(s),i=this.getHalfEdgeTwin(s),o=this.getHalfEdgeChain(i);this.setChainHalfEdge_(n,r.n),this.setChainHalfEdge_(o,r.n),this.updateVertexToHalfEdgeConnection_(s,!0),this.deleteEdgeImpl_(s)}}doesHalfEdgeBelongToAPolygonInterior(t,e){return(0,i.g)(0),!1}doesHalfEdgeBelongToAPolygonExterior(t,e){return(0,i.g)(0),!1}doesHalfEdgeBelongToAPolygonBoundary(t,e){return(0,i.g)(0),!1}doesHalfEdgeBelongToAPolylineInterior(t,e){return(0,i.g)(0),!1}doesHalfEdgeBelongToAPolylineExterior(t,e){return(0,i.g)(0),!1}doesClusterBelongToAPolygonInterior(t,e){return(0,i.g)(0),!1}doesClusterBelongToAPolygonExterior(t,e){return(0,i.g)(0),!1}doesClusterBelongToAPolygonBoundary(t,e){return(0,i.g)(0),!1}getFirstChain(){return this.m_universeChain}getChainHalfEdge(t){return this.m_chainData.getField(t,1)}getChainParentage(t){return this.m_chainData.getField(t,2)}getChainParent(t){return this.m_chainData.getField(t,3)}getChainFirstIsland(t){return this.m_chainData.getField(t,4)}getChainNextInParent(t){return this.m_chainData.getField(t,5)}getChainNext(t){return this.m_chainData.getField(t,7)}getChainArea(t){const e=this.getChainIndex_(t);let s=this.m_chainAreas.read(e);return Number.isNaN(s)&&(this.updateChainAreaAndPerimeter_(t),s=this.m_chainAreas.read(e)),s}getChainPerimeter(t){return(0,i.g)(0),0}getChainUserIndex(t,e){const s=this.getChainIndex_(t),n=this.m_chainIndices[e];return n.size()<=s?-1:n.read(s)}setChainUserIndex(t,e,s){const n=this.getChainIndex_(t),i=this.m_chainIndices[e];i.size()<=n&&i.resize(this.m_chainData.size(),-1),i.write(n,s)}createUserIndexForChains(){const t=new o.A(this.m_chainData.capacity(),-1);for(let e=0,s=this.m_chainIndices.length;e<s;e++)if(null===this.m_chainIndices[e])return this.m_chainIndices[e]=t,e;return this.m_chainIndices.push(t),this.m_chainIndices.length-1}deleteUserIndexForChains(t){this.m_chainIndices[t]=null}extractPolygonFromChainAndIslands(t,e,s,n){const o=e===r.n?t.createGeometry(i.G.enumPolygon):e,a=new r.S;this.extractPolygonPathFromChain_(t,o,s,n,a);for(let e=this.getChainFirstIsland(s);e!==r.n;e=this.getChainNextInParent(e))this.extractPolygonPathFromChain_(t,o,e,n,a);return o}getGeometryID(t){const e=this.m_shape.getGeometryUserIndex(t,this.m_geometryIDIndex);return(0,i.g)(e>=0),1<<Math.min(e,31)}getClusterFromVertex(t){return this.m_shape.getUserIndex(t,this.m_clusterIndex)}getHalfEdgeFromVertex(t){return this.m_shape.getUserIndex(t,this.m_halfEdgeIndex)}buildGeometryParentageSets(){this.m_bBuildGeometryParentageSets=!0}getChainBitSet(t){if((0,i.g)(this.m_bBuildGeometryParentageSets),-1===this.m_chainBitSetIndex)return this.getEmptySet();const e=this.getChainUserIndex(t,this.m_chainBitSetIndex);(0,i.g)(e>=0);let s=this.m_chainBitSets.at(e);return s||(s=this.getEmptySet()),s}getChainBoundaryBitSet(t){(0,i.g)(this.m_bBuildGeometryParentageSets);const e=new B,s=t=>{const s=this.getChainHalfEdge(t);let n=s;do{const t=this.getEdgeBitSet_(n);null!==t&&e.assignOr(t);const s=this.getEdgeBitSet_(this.getHalfEdgeTwin(n));null!==s&&e.assignOr(s),n=this.getHalfEdgeNext(n)}while(n!==s)};s(t);for(let e=this.getChainFirstIsland(t);e!==r.n;e=this.getChainNextInParent(e))s(t);return e}getChainPolygons(t){return(0,i.g)(0),[]}getGeometriesFromBits(t){if(!this.m_bBuildGeometryParentageSets||null===t)return[];if(null===this.m_geometryMapID){this.m_geometryMapID=new Map;for(let t=this.m_shape.getFirstGeometry();t!==r.n;t=this.m_shape.getNextGeometry(t))this.m_geometryMapID.set(this.m_shape.getGeometryUserIndex(t,this.m_geometryIDIndex),t)}const e=[],s=t.getUnorderedBitIterator();for(let t=s.next();t!==H.npos();t=s.next())(0,i.g)(this.m_geometryMapID.has(t)),e.push(this.m_geometryMapID.get(t));return e}getVertexDominant(t,e){if(e===r.n)return t;const s=this.getClusterFromVertex(t);return this.getVertexDominantFromCluster(s,e)}getVertexDominantFromCluster(t,e){if(e!==r.n){let s=r.n;for(let n=this.getClusterVertexIterator(t);n!==r.n;n=this.incrementVertexIterator(n)){const t=this.getVertexFromVertexIterator(n);s===r.n&&(s=t);const i=this.m_shape.getPathFromVertex(t);if(this.m_shape.getGeometryFromPath(i)===e){s=t;break}}return s}{const e=this.getClusterVertexIterator(t);return e!==r.n?this.getVertexFromVertexIterator(e):r.n}}isBreakNode(t){return this.hasClusterUserIndexFlags(t,this.m_clusterBreakNodeIndex,j.enumSegmentParentageBreakNode)}setBreakNode(t,e){(0,i.g)(-1!==this.m_clusterBreakNodeIndex),e?this.setClusterUserIndexFlags(t,this.m_clusterBreakNodeIndex,j.enumSegmentParentageBreakNode):this.clearClusterUserIndexFlags(t,this.m_clusterBreakNodeIndex,j.enumSegmentParentageBreakNode)}isStrongPathNode(t){return this.hasClusterUserIndexFlags(t,this.m_clusterBreakNodeIndex,j.enumPathBreakNode)}setStrongPathNode(t,e){if(-1===this.m_clusterBreakNodeIndex){if(!e)return;this.m_clusterBreakNodeIndex=this.createUserIndexForClusters()}e?this.setClusterUserIndexFlags(t,this.m_clusterBreakNodeIndex,j.enumPathBreakNode):this.clearClusterUserIndexFlags(t,this.m_clusterBreakNodeIndex,j.enumPathBreakNode)}getSegmentParentage(t){if(-1===this.m_segmentParentageIndex)return-1;const e=this.getHalfEdgeUserIndex(t,this.m_segmentParentageIndex);return e>=0?e:-1}isCrossroadAhead(t){const e=this.getHalfEdgeNext(t);if(this.isStrongPathNode(this.getHalfEdgeOrigin(e)))return!0;const s=this.getHalfEdgeTwin(e),n=this.getHalfEdgeNext(s);return t!==this.getHalfEdgeTwin(n)}isCrossroadBehind(t){return(0,i.g)(0),!1}getHalfEdgeConnector(t,e){const s=this.getClusterHalfEdge(t);if(s===r.n)return r.n;let n=s,i=r.n,o=r.n;do{if(this.getHalfEdgeTo(n)===e)return n;if(i===r.n){if(i=this.getClusterHalfEdge(e),i===r.n)return r.n;o=i}if(this.getHalfEdgeTo(o)===t)return n=this.getHalfEdgeTwin(o),n;n=this.getHalfEdgeNext(this.getHalfEdgeTwin(n)),o=this.getHalfEdgeNext(this.getHalfEdgeTwin(o))}while(n!==s&&o!==i);return r.n}querySegmentXY(t,e){if(-1!==this.m_segmentIndexHe){let s=this.getHalfEdgeUserIndex(t,this.m_segmentIndexHe);if(-1!==s){if(-2!==s){const t=this.m_shape.getSegmentFromIndex(s);e.copyFrom(t,!0)}else{s=this.getHalfEdgeUserIndex(this.getHalfEdgeTwin(t),this.m_segmentIndexHe);const n=this.m_shape.getSegmentFromIndex(s);e.copyFrom(n,!0),e.get().reverse()}return}}e.createLine();const s=e.get(),n=a.P.getNAN();this.getHalfEdgeFromXY(t,n),s.setStartXY(n),this.getHalfEdgeToXY(t,n),s.setEndXY(n)}isCurveEdge(t){return-1!==this.m_segmentIndexHe&&-1!==this.getHalfEdgeUserIndex(t,this.m_segmentIndexHe)}compareEdgeAnglesCurveHelper_(t,e,s){const n=new r.S,o=new r.S;this.querySegmentXY(t,n),this.querySegmentXY(e,o);const h=n.get(),m=o.get();if(h.equals(m))return 0;const l=new a.P;this.getHalfEdgeFromXY(t,l);const u=new a.P;this.getHalfEdgeToXY(t,u);const c=new a.P;return this.getHalfEdgeToXY(e,c),(0,i.g)(!u.isEqualPoint2D(c)),(0,r.R)(h,m)}compareEdgeAnglesHelper_(t,e,s){if(t===e)return 0;if(this.isHalfEdgeCurve(t)||this.isHalfEdgeCurve(e))return this.compareEdgeAnglesCurveHelper_(t,e,s);const n=a.P.getNAN();this.getHalfEdgeToXY(t,n);const i=a.P.getNAN();if(this.getHalfEdgeToXY(e,i),n.isEqualPoint2D(i))return 0;const r=a.P.getNAN();this.getHalfEdgeFromXY(t,r);const o=a.P.getNAN();o.setSub(n,r);const h=a.P.getNAN();return h.setSub(i,r),!s||h.y>=0&&o.y>0?a.P.compareVectors(o,h):0}compareEdgeAngles_(t,e){return this.compareEdgeAnglesHelper_(t,e,!1)}compareEdgeAnglesForPair_(t,e){return this.compareEdgeAnglesHelper_(t,e,!0)}compareEdgeAngles3D_(t,e){return(0,i.g)(0),0}compareEdgeAnglesForPair3D_(t,e){return(0,i.g)(0),0}dbgDumpChains_(){}dbgDumpChainToPolygon_(t,e){}deleteEdgeInternal_(t){const e=this.getHalfEdgeChain(t),s=this.getHalfEdgeTwin(t),n=this.getHalfEdgeChain(s);(0,i.g)(n===e),(0,i.g)(t===this.getHalfEdgeNext(s)||s===this.getHalfEdgeNext(t));let o=this.getHalfEdgeNext(t);o===s&&(o=this.getHalfEdgeNext(o),o===t&&(o=r.n));const a=this.getChainIndex_(e),h=this.m_chainAreas.read(a);Number.isNaN(h)||(this.setChainArea_(e,Number.NaN),this.setChainPerimeter_(e,Number.NaN));const m=this.getChainHalfEdge(e);m!==t&&m!==s||this.setChainHalfEdge_(e,o),this.updateVertexToHalfEdgeConnection_(t,!0),this.deleteEdgeImpl_(t)}getFirstUnvisitedHalfEdgeOnCluster_(t,e,s){let n=e!==r.n?e:this.getClusterHalfEdge(t);if(n===r.n)return r.n;const i=n;for(;;){if(1!==this.getHalfEdgeUserIndex(n,s))return n;const t=this.getHalfEdgeNext(this.getHalfEdgeTwin(n));if(t===i)return r.n;n=t}}removeSpikes_(){let t=!1;const e=this.createUserIndexForHalfEdges();for(let s=this.getFirstCluster();s!==r.n;s=this.getNextCluster(s)){let n=r.n;for(;;){let i=this.getFirstUnvisitedHalfEdgeOnCluster_(s,n,e);if(i===r.n)break;n=this.getHalfEdgeNext(this.getHalfEdgeTwin(i));let o=i;for(;;){const s=this.getHalfEdgeNext(o),a=this.getHalfEdgePrev(o),h=this.getHalfEdgeTwin(o);if(a===h){if(this.deleteEdgeInternal_(o),t=!0,n!==o&&n!==h||(n=r.n),o===i||a===i){if(i=s,o===i||a===i)break;o=s;continue}}else this.setHalfEdgeUserIndex(o,e,1);if(o=s,o===i)break}}}return this.deleteUserIndexForHalfEdges(e),t}progress_(t,e=!1){}newCluster_(){const t=this.m_clusterData.newElement();return this.m_clusterData.setField(t,1,0),t}newHalfEdgePair_(){const t=this.m_halfEdgeData.newElement();this.m_halfEdgeData.setField(t,2,0),this.m_halfEdgeData.setField(t,3,0);const e=this.m_halfEdgeData.newElement();return this.m_halfEdgeData.setField(e,2,0),this.m_halfEdgeData.setField(e,3,0),this.setHalfEdgeTwin_(t,e),this.setHalfEdgeTwin_(e,t),t}newChain_(){const t=this.m_chainData.newElement();return this.m_chainData.setField(t,2,0),t}deleteChain_(t){return(0,i.g)(0),0}getClusterIndex_(t){return this.m_clusterData.elementToIndex(t)}setClusterVertexIterator_(t,e){this.m_clusterData.setField(t,7,e)}setClusterHalfEdge_(t,e){this.m_clusterData.setField(t,2,e)}setClusterParentage_(t,e){this.m_clusterData.setField(t,1,e)}setPrevCluster_(t,e){this.m_clusterData.setField(t,3,e)}setNextCluster_(t,e){this.m_clusterData.setField(t,4,e)}setClusterVertexIndex_(t,e){this.m_clusterData.setField(t,5,e)}getClusterVertexIndex_(t){return this.m_clusterData.getField(t,5)}setClusterChain_(t,e){this.m_clusterData.setField(t,6,e)}addClusterToExteriorChain_(t,e){this.setClusterChain_(e,t)}getHalfEdgeIndex_(t){return this.m_halfEdgeData.elementToIndex(t)}setHalfEdgeOrigin_(t,e){this.m_halfEdgeData.setField(t,1,e)}setHalfEdgeTwin_(t,e){this.m_halfEdgeData.setField(t,4,e)}setHalfEdgePrev_(t,e){this.m_halfEdgeData.setField(t,5,e)}setHalfEdgeNext_(t,e){this.m_halfEdgeData.setField(t,6,e)}setHalfEdgeChain_(t,e){this.m_halfEdgeData.setField(t,2,e)}setHalfEdgeParentage_(t,e){this.m_halfEdgeData.setField(t,3,e)}getHalfEdgeParentageMask_(t){return this.m_halfEdgeData.getField(t,3)}setHalfEdgeVertexIterator_(t,e){this.m_halfEdgeData.setField(t,7,e)}updateVertexToHalfEdgeConnectionHelper_(t,e){const s=e?r.n:t;for(let e=this.getHalfEdgeVertexIterator(t);e!==r.n;e=this.incrementVertexIterator(e)){const t=this.getVertexFromVertexIterator(e);this.m_shape.setUserIndex(t,this.m_halfEdgeIndex,s)}}updateVertexToHalfEdgeConnection_(t,e){t!==r.n&&(this.updateVertexToHalfEdgeConnectionHelper_(t,e),this.updateVertexToHalfEdgeConnectionHelper_(this.getHalfEdgeTwin(t),e))}getChainIndex_(t){return this.m_chainData.elementToIndex(t)}setChainHalfEdge_(t,e){this.m_chainData.setField(t,1,e)}setChainParentage_(t,e){this.m_chainData.setField(t,2,e)}setChainParent_(t,e){this.m_chainData.setField(t,3,e);const s=this.getChainFirstIsland(e);this.setChainNextInParent_(t,s),this.setChainFirstIsland_(e,t)}setChainFirstIsland_(t,e){this.m_chainData.setField(t,4,e)}setChainNextInParent_(t,e){this.m_chainData.setField(t,5,e)}setChainPrev_(t,e){this.m_chainData.setField(t,6,e)}setChainNext_(t,e){this.m_chainData.setField(t,7,e)}setChainArea_(t,e){const s=this.getChainIndex_(t);this.m_chainAreas.write(s,e)}setChainPerimeter_(t,e){const s=this.getChainIndex_(t);this.m_chainPerimeters.write(s,e)}updateChainAreaAndPerimeter_(t){const e=this.m_shape.hasCurves(),s=new a.K(0),n=new a.K(0),i=this.getChainHalfEdge(t),o=a.P.getNAN(),h=a.P.getNAN(),m=a.P.getNAN();this.getHalfEdgeFromXY(i,o),h.setCoordsPoint2D(o);let l=i;do{this.getHalfEdgeToXY(l,m),e&&this.isCurveEdge(l)||n.pe(a.P.distance(h,m)),this.getHalfEdgeChain(this.getHalfEdgeTwin(l))!==t&&s.pe((m.x-o.x-(h.x-o.x))*(m.y-o.y+(h.y-o.y))*.5),h.setCoordsPoint2D(m),l=this.getHalfEdgeNext(l)}while(l!==i);if(e){const e=new r.S;l=i;do{this.getHalfEdgeToXY(l,m);const i=this.isCurveEdge(l);if(i&&(this.querySegmentXY(l,e),n.pe(e.get().calculateLength2D())),this.getHalfEdgeChain(this.getHalfEdgeTwin(l))!==t&&i){const t=e.get().calculateArea2DHelper();s.pe(t)}l=this.getHalfEdgeNext(l)}while(l!==i)}const u=this.getChainIndex_(t);this.m_chainAreas.write(u,s.getResult()),this.m_chainPerimeters.write(u,n.getResult())}getChainTopmostEdge_(t){return(0,i.g)(0),0}planeSweepParentage_(t,e){const s=new U(this),n=new o.T;n.setCapacity(Math.trunc(this.m_pointCount/2)),n.setComparator(s);const i=[],h=this.createUserIndexForHalfEdges();let m=null;const l=a.P.getNAN();for(let a=this.getFirstCluster();a!==r.n;a=this.getNextCluster(a)){this.progress_(e);const u=this.getClusterHalfEdge(a);if(u!==r.n){if(i.length=0,!this.tryOptimizedInsertion_(n,h,i,a,u)){this.queryXY(a,l),s.setY(l.y);let t=u;do{const e=this.getHalfEdgeUserIndex(t,h);-1!==e&&(n.deleteNode(e),this.setHalfEdgeUserIndex(t,h,o.S.impossibleIndex2())),t=this.getHalfEdgeNext(this.getHalfEdgeTwin(t))}while(u!==t);t=u;do{if(-1===this.getHalfEdgeUserIndex(t,h)){const e=n.addElement(t);i.push(e)}t=this.getHalfEdgeNext(this.getHalfEdgeTwin(t))}while(u!==t)}for(let e=i.length-1;e>=0;e--){const s=i[e],r=n.getElement(s),o=this.getHalfEdgeTwin(r);this.setHalfEdgeUserIndex(o,h,s),this.planeSweepParentagePropagateParentage_(n,s,t)}}else if(this.getClusterChain(a)===r.n){null===m&&(m=new O(this)),this.queryXY(a,l),m.setPointXY(l);const t=n.searchLowerBound(m);let e=this.m_universeChain;if(-1!==t){let s=n.getElement(t);this.getHalfEdgeChain(s)===this.getHalfEdgeC