1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209 |
- import {
- T
- } from "./chunk-VGSBB3MM.js";
- import {
- a,
- f,
- l as l2
- } from "./chunk-3T4BXU2T.js";
- import {
- s
- } from "./chunk-SRMDO2KR.js";
- import {
- b
- } from "./chunk-PZKZIMMP.js";
- import {
- e
- } from "./chunk-YLVXZ2PS.js";
- import {
- X
- } from "./chunk-WFSV2B2I.js";
- import {
- t as t2
- } from "./chunk-J525NRN3.js";
- import {
- C
- } from "./chunk-MI7HWWFL.js";
- import {
- e as e2
- } from "./chunk-EZZVK4K6.js";
- import {
- p,
- v,
- z
- } from "./chunk-EGVIPYN2.js";
- import {
- l
- } from "./chunk-7XXXCK2A.js";
- import {
- t
- } from "./chunk-GZT4BVFP.js";
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/MemoryBuffer.js
- var t3 = class {
- constructor(t7) {
- this._array = [], t7 <= 0 && console.error("strideInBytes must be positive!"), this._stride = t7;
- }
- get array() {
- return this._array;
- }
- get index() {
- return 4 * this._array.length / this._stride;
- }
- get itemSize() {
- return this._stride;
- }
- get sizeInBytes() {
- return 4 * this._array.length;
- }
- reset() {
- this.array.length = 0;
- }
- toBuffer() {
- return new Uint32Array(this._array).buffer;
- }
- static i1616to32(t7, r2) {
- return 65535 & t7 | r2 << 16;
- }
- static i8888to32(t7, r2, e4, s2) {
- return 255 & t7 | (255 & r2) << 8 | (255 & e4) << 16 | s2 << 24;
- }
- static i8816to32(t7, r2, e4) {
- return 255 & t7 | (255 & r2) << 8 | e4 << 16;
- }
- };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/enums.js
- var N;
- var R;
- !function(N3) {
- N3[N3.R8_SIGNED = 0] = "R8_SIGNED", N3[N3.R8_UNSIGNED = 1] = "R8_UNSIGNED", N3[N3.R16_SIGNED = 2] = "R16_SIGNED", N3[N3.R16_UNSIGNED = 3] = "R16_UNSIGNED", N3[N3.R8G8_SIGNED = 4] = "R8G8_SIGNED", N3[N3.R8G8_UNSIGNED = 5] = "R8G8_UNSIGNED", N3[N3.R16G16_SIGNED = 6] = "R16G16_SIGNED", N3[N3.R16G16_UNSIGNED = 7] = "R16G16_UNSIGNED", N3[N3.R8G8B8A8_SIGNED = 8] = "R8G8B8A8_SIGNED", N3[N3.R8G8B8A8_UNSIGNED = 9] = "R8G8B8A8_UNSIGNED", N3[N3.R8G8B8A8_COLOR = 10] = "R8G8B8A8_COLOR", N3[N3.R16G16B16A16_DASHARRAY = 11] = "R16G16B16A16_DASHARRAY", N3[N3.R16G16B16A16_PATTERN = 12] = "R16G16B16A16_PATTERN";
- }(N || (N = {})), function(N3) {
- N3[N3.UNIFORM = 0] = "UNIFORM", N3[N3.DATA_DRIVEN = 1] = "DATA_DRIVEN", N3[N3.INTERPOLATED_DATA_DRIVEN = 2] = "INTERPOLATED_DATA_DRIVEN", N3[N3.UNUSED = 3] = "UNUSED";
- }(R || (R = {}));
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLMaterial.js
- var i = class {
- constructor(t7) {
- this._locations = new Map(), this._key = t7;
- }
- get key() {
- return this._key;
- }
- get type() {
- return 7 & this._key;
- }
- defines() {
- return [];
- }
- getStride() {
- return this._layoutInfo || this._buildAttributesInfo(), this._stride;
- }
- getAttributeLocations() {
- return this._locations.size === 0 && this._buildAttributesInfo(), this._locations;
- }
- getLayoutInfo() {
- return this._layoutInfo || this._buildAttributesInfo(), this._layoutInfo;
- }
- getEncodingInfos() {
- return this._propertyEncodingInfo || this._buildAttributesInfo(), this._propertyEncodingInfo;
- }
- getUniforms() {
- return this._uniforms || this._buildAttributesInfo(), this._uniforms;
- }
- getShaderHeader() {
- return this._shaderHeader || this._buildAttributesInfo(), this._shaderHeader;
- }
- getShaderMain() {
- return this._shaderMain || this._buildAttributesInfo(), this._shaderMain;
- }
- setDataUniforms(t7, e4, n2, o2, s2) {
- const r2 = this.getUniforms();
- for (const i5 of r2) {
- const { name: r3, type: a5, getValue: c5 } = i5, u2 = c5(n2, e4, o2, s2);
- if (u2 !== null)
- switch (a5) {
- case "float":
- t7.setUniform1f(r3, u2);
- break;
- case "vec2":
- t7.setUniform2fv(r3, u2);
- break;
- case "vec4":
- t7.setUniform4fv(r3, u2);
- }
- }
- }
- encodeAttributes(t7, e4, o2, s2) {
- const r2 = this.attributesInfo(), i5 = this.getEncodingInfos(), a5 = [];
- let c5 = 0, u2 = 0;
- for (const f4 of Object.keys(i5)) {
- const _3 = i5[f4], { type: h2, precisionFactor: d4, isLayout: l6 } = r2[f4], y2 = l6 ? o2.getLayoutProperty(f4) : o2.getPaintProperty(f4), m2 = y2.interpolator?.getInterpolationRange(e4);
- let I2 = 0;
- for (const o3 of _3) {
- const { offset: r3, bufferElementsToAdd: i6 } = o3;
- if (i6 > 0) {
- for (let t8 = 0; t8 < i6; t8++)
- a5.push(0);
- c5 += u2, u2 = o3.bufferElementsToAdd;
- }
- const f5 = s2 ?? y2.getValue(m2 ? m2[I2] : e4, t7);
- switch (h2) {
- case N.R8_SIGNED:
- case N.R8_UNSIGNED:
- a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3);
- break;
- case N.R16_SIGNED:
- case N.R16_UNSIGNED:
- a5[c5] |= this._encodeShort(f5 * (d4 || 1), 8 * r3);
- break;
- case N.R8G8_SIGNED:
- case N.R8G8_UNSIGNED:
- a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3), a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3 + 8);
- break;
- case N.R16G16_SIGNED:
- case N.R16G16_UNSIGNED:
- a5[c5] |= this._encodeShort(f5 * (d4 || 1), 8 * r3), a5[c5] |= this._encodeShort(f5 * (d4 || 1), 8 * r3 + 16);
- break;
- case N.R8G8B8A8_SIGNED:
- case N.R8G8B8A8_UNSIGNED:
- a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3), a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3 + 8), a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3 + 16), a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3 + 24);
- break;
- case N.R8G8B8A8_COLOR:
- a5[c5] = this._encodeColor(f5);
- break;
- case N.R16G16B16A16_DASHARRAY:
- case N.R16G16B16A16_PATTERN:
- this._encodePattern(c5, a5, f5);
- break;
- default:
- throw new Error("Unsupported encoding type");
- }
- I2++;
- }
- }
- return a5;
- }
- getAtributeState(t7) {
- let e4 = 0;
- const n2 = 3 + 2 * t7;
- return e4 |= this._bit(n2), e4 |= this._bit(n2 + 1) << 1, e4;
- }
- _buildAttributesInfo() {
- const t7 = [], e4 = {}, n2 = {};
- let r2 = -1;
- const a5 = this.attributesInfo(), c5 = this.attributes();
- let u2 = -1;
- for (const s2 of c5) {
- u2++;
- const c6 = this.getAtributeState(u2);
- if (c6 === R.UNIFORM || c6 === R.UNUSED)
- continue;
- const f5 = a5[s2], _4 = [];
- e4[s2] = _4;
- const h3 = f5.type;
- for (let e5 = 0; e5 < c6; e5++) {
- const { dataType: e6, bytesPerElement: o2, count: s3, normalized: a6 } = i._encodingInfo[h3], c7 = o2 * s3, u3 = `${e6}-${a6 === true}`;
- let f6 = n2[u3], d4 = 0;
- if (!f6 || f6.count + s3 > 4)
- r2++, f6 = { dataIndex: r2, count: 0, offset: 0 }, s3 !== 4 && (n2[u3] = f6), t7.push({ location: -1, name: "a_data_" + r2, count: s3, type: e6, normalized: a6 }), d4 = Math.ceil(Math.max(c7 / 4, 1));
- else {
- const e7 = t7[f6.dataIndex];
- e7.count += s3;
- d4 = Math.ceil(Math.max(e7.count * o2 / 4, 1)) - Math.ceil(Math.max(f6.offset / 4, 1));
- }
- _4.push({ dataIndex: f6.dataIndex, offset: f6.offset, bufferElementsToAdd: d4 }), f6.offset += c7, f6.count += s3;
- }
- }
- for (const o2 of t7)
- switch (o2.type) {
- case C.BYTE:
- case C.UNSIGNED_BYTE:
- o2.count = 4;
- break;
- case C.SHORT:
- case C.UNSIGNED_SHORT:
- o2.count += o2.count % 2;
- }
- this._buildVertexBufferLayout(t7);
- let f4 = 0;
- const _3 = this._layoutInfo.geometry;
- for (const o2 of _3)
- this._locations.set(o2.name, f4++);
- const h2 = this._layoutInfo.opacity;
- if (h2)
- for (const o2 of h2)
- this._locations.set(o2.name, f4++);
- this._buildShaderInfo(t7, e4), this._propertyEncodingInfo = e4;
- }
- _buildVertexBufferLayout(t7) {
- const e4 = {}, n2 = this.geometryInfo();
- let o2 = n2[0].stride;
- if (t7.length === 0)
- e4.geometry = n2;
- else {
- const s2 = [];
- let i5 = o2;
- for (const e5 of t7)
- o2 += a2(e5.type) * e5.count;
- for (const t8 of n2)
- s2.push(new t2(t8.name, t8.count, t8.type, t8.offset, o2, t8.normalized));
- for (const e5 of t7)
- s2.push(new t2(e5.name, e5.count, e5.type, i5, o2, e5.normalized)), i5 += a2(e5.type) * e5.count;
- e4.geometry = s2;
- }
- this.opacityInfo() && (e4.opacity = this.opacityInfo()), this._layoutInfo = e4, this._stride = o2;
- }
- _buildShaderInfo(e4, s2) {
- let r2 = "\n", a5 = "\n";
- const u2 = [];
- for (const t7 of e4)
- r2 += `attribute ${this._getType(t7.count)} ${t7.name};
- `;
- const f4 = this.attributes(), _3 = this.attributesInfo();
- let h2 = -1;
- for (const d4 of f4) {
- h2++;
- const { name: e5, type: f5, precisionFactor: l6, isLayout: y2 } = _3[d4], m2 = l6 && l6 !== 1 ? " * " + 1 / l6 : "", { bytesPerElement: I2, count: E2 } = i._encodingInfo[f5], p2 = (t7) => `a_data_${t7.dataIndex}${c(E2, t7.offset, I2)}`;
- switch (this.getAtributeState(h2)) {
- case R.UNIFORM:
- {
- const o2 = this._getType(E2), s3 = `u_${e5}`;
- u2.push({ name: s3, type: o2, getValue: (e6, o3, s4, r3) => {
- const i5 = y2 ? e6.getLayoutValue(d4, o3) : e6.getPaintValue(d4, o3);
- if (f5 === N.R16G16B16A16_DASHARRAY) {
- const n2 = e6.getDashKey(i5, e6.getLayoutValue("line-cap", o3)), s5 = r3.getMosaicItemPosition(n2, false);
- if (t(s5))
- return null;
- const { tl: a6, br: c5 } = s5;
- return [a6[0], c5[1], c5[0], a6[1]];
- }
- if (f5 === N.R16G16B16A16_PATTERN) {
- const e7 = r3.getMosaicItemPosition(i5, !d4.includes("line-"));
- if (t(e7))
- return null;
- const { tl: n2, br: o4 } = e7;
- return [n2[0], o4[1], o4[0], n2[1]];
- }
- if (f5 === N.R8G8B8A8_COLOR) {
- const t7 = i5[3];
- return [t7 * i5[0], t7 * i5[1], t7 * i5[2], t7];
- }
- return i5;
- } }), r2 += `uniform ${o2} ${s3};
- `, a5 += `${o2} ${e5} = ${s3};
- `;
- }
- break;
- case R.DATA_DRIVEN:
- {
- const t7 = p2(s2[d4][0]);
- a5 += `${this._getType(E2)} ${e5} = ${t7}${m2};
- `;
- }
- break;
- case R.INTERPOLATED_DATA_DRIVEN: {
- const t7 = `u_t_${e5}`;
- u2.push({ name: t7, type: "float", getValue: (t8, e6, n3, o3) => (y2 ? t8.getLayoutProperty(d4) : t8.getPaintProperty(d4)).interpolator.interpolationUniformValue(n3, e6) }), r2 += `uniform float ${t7};
- `;
- const n2 = p2(s2[d4][0]), o2 = p2(s2[d4][1]);
- a5 += `${this._getType(E2)} ${e5} = mix(${n2}${m2}, ${o2}${m2}, ${t7});
- `;
- }
- }
- }
- this._shaderHeader = r2, this._shaderMain = a5, this._uniforms = u2;
- }
- _bit(t7) {
- return (this._key & 1 << t7) >> t7;
- }
- _getType(t7) {
- switch (t7) {
- case 1:
- return "float";
- case 2:
- return "vec2";
- case 3:
- return "vec3";
- case 4:
- return "vec4";
- }
- throw new Error("Invalid count");
- }
- _encodeColor(t7) {
- const n2 = 255 * t7[3];
- return t3.i8888to32(t7[0] * n2, t7[1] * n2, t7[2] * n2, n2);
- }
- _encodePattern(t7, e4, n2) {
- if (!n2 || !n2.rect)
- return;
- const o2 = 2, s2 = n2.rect, r2 = n2.width, i5 = n2.height;
- e4[t7] = this._encodeShort(s2.x + o2, 0), e4[t7] |= this._encodeShort(s2.y + o2 + i5, 16), e4[t7 + 1] = this._encodeShort(s2.x + o2 + r2, 0), e4[t7 + 1] |= this._encodeShort(s2.y + o2, 16);
- }
- _encodeByte(t7, e4) {
- return (255 & t7) << e4;
- }
- _encodeShort(t7, e4) {
- return (65535 & t7) << e4;
- }
- };
- i._encodingInfo = { [N.R8_SIGNED]: { dataType: C.BYTE, bytesPerElement: 1, count: 1, normalized: false }, [N.R8_UNSIGNED]: { dataType: C.UNSIGNED_BYTE, bytesPerElement: 1, count: 1, normalized: false }, [N.R16_SIGNED]: { dataType: C.SHORT, bytesPerElement: 2, count: 1, normalized: false }, [N.R16_UNSIGNED]: { dataType: C.UNSIGNED_SHORT, bytesPerElement: 2, count: 1, normalized: false }, [N.R8G8_SIGNED]: { dataType: C.BYTE, bytesPerElement: 1, count: 2, normalized: false }, [N.R8G8_UNSIGNED]: { dataType: C.UNSIGNED_BYTE, bytesPerElement: 1, count: 2, normalized: false }, [N.R16G16_SIGNED]: { dataType: C.SHORT, bytesPerElement: 2, count: 2, normalized: false }, [N.R16G16_UNSIGNED]: { dataType: C.UNSIGNED_SHORT, bytesPerElement: 2, count: 2, normalized: false }, [N.R8G8B8A8_SIGNED]: { dataType: C.BYTE, bytesPerElement: 1, count: 4, normalized: false }, [N.R8G8B8A8_UNSIGNED]: { dataType: C.UNSIGNED_BYTE, bytesPerElement: 1, count: 4, normalized: false }, [N.R8G8B8A8_COLOR]: { dataType: C.UNSIGNED_BYTE, bytesPerElement: 1, count: 4, normalized: true }, [N.R16G16B16A16_DASHARRAY]: { dataType: C.UNSIGNED_SHORT, bytesPerElement: 2, count: 4, normalized: false }, [N.R16G16B16A16_PATTERN]: { dataType: C.UNSIGNED_SHORT, bytesPerElement: 2, count: 4, normalized: false } };
- var a2 = (t7) => {
- switch (t7) {
- case C.FLOAT:
- case C.INT:
- case C.UNSIGNED_INT:
- return 4;
- case C.SHORT:
- case C.UNSIGNED_SHORT:
- return 2;
- case C.BYTE:
- case C.UNSIGNED_BYTE:
- return 1;
- }
- };
- var c = (t7, e4, n2) => {
- const o2 = e4 / n2;
- if (t7 === 1)
- switch (o2) {
- case 0:
- return ".x";
- case 1:
- return ".y";
- case 2:
- return ".z";
- case 3:
- return ".w";
- }
- else if (t7 === 2)
- switch (o2) {
- case 0:
- return ".xy";
- case 1:
- return ".yz";
- case 2:
- return ".zw";
- }
- else if (t7 === 3)
- switch (o2) {
- case 0:
- return ".xyz";
- case 1:
- return ".yzw";
- }
- return "";
- };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js
- var T2 = class extends i {
- constructor(r2) {
- super(r2);
- }
- geometryInfo() {
- return T2.GEOMETRY_LAYOUT;
- }
- opacityInfo() {
- return null;
- }
- attributes() {
- return T2.ATTRIBUTES;
- }
- attributesInfo() {
- return T2.ATTRIBUTES_INFO;
- }
- };
- T2.ATTRIBUTES = [], T2.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.BYTE, 0, 2)], T2.ATTRIBUTES_INFO = {};
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js
- var t4 = class extends i {
- constructor(r2) {
- super(r2);
- }
- geometryInfo() {
- return t4.GEOMETRY_LAYOUT;
- }
- opacityInfo() {
- return null;
- }
- attributes() {
- return t4.ATTRIBUTES;
- }
- attributesInfo() {
- return t4.ATTRIBUTES_INFO;
- }
- };
- t4.ATTRIBUTES = ["circle-radius", "circle-color", "circle-opacity", "circle-stroke-width", "circle-stroke-color", "circle-stroke-opacity", "circle-blur"], t4.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.SHORT, 0, 4)], t4.ATTRIBUTES_INFO = { "circle-radius": { name: "radius", type: N.R8_UNSIGNED }, "circle-color": { name: "color", type: N.R8G8B8A8_COLOR }, "circle-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "circle-stroke-width": { name: "stroke_width", type: N.R8_UNSIGNED, precisionFactor: 4 }, "circle-stroke-color": { name: "stroke_color", type: N.R8G8B8A8_COLOR }, "circle-stroke-opacity": { name: "stroke_opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "circle-blur": { name: "blur", type: N.R8_UNSIGNED, precisionFactor: 32 } };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js
- var l3 = class extends i {
- constructor(o2) {
- super(o2);
- }
- geometryInfo() {
- return l3.GEOMETRY_LAYOUT;
- }
- opacityInfo() {
- return null;
- }
- attributes() {
- return l3.ATTRIBUTES;
- }
- attributesInfo() {
- return l3.ATTRIBUTES_INFO;
- }
- };
- l3.ATTRIBUTES = ["fill-color", "fill-opacity", "fill-pattern"], l3.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.SHORT, 0, 4)], l3.ATTRIBUTES_INFO = { "fill-color": { name: "color", type: N.R8G8B8A8_COLOR }, "fill-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "fill-pattern": { name: "tlbr", type: N.R16G16B16A16_PATTERN, isOptional: true } };
- var T3 = class extends i {
- constructor(o2, t7) {
- super(o2), this.usefillColor = t7;
- }
- geometryInfo() {
- return T3.GEOMETRY_LAYOUT;
- }
- opacityInfo() {
- return null;
- }
- attributes() {
- return this.usefillColor ? T3.ATTRIBUTES_FILL : T3.ATTRIBUTES_OUTLINE;
- }
- attributesInfo() {
- return this.usefillColor ? T3.ATTRIBUTES_INFO_FILL : T3.ATTRIBUTES_INFO_OUTLINE;
- }
- };
- T3.ATTRIBUTES_OUTLINE = ["fill-outline-color", "fill-opacity"], T3.ATTRIBUTES_FILL = ["fill-color", "fill-opacity"], T3.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.SHORT, 0, 8), new t2("a_offset", 2, C.BYTE, 4, 8), new t2("a_xnormal", 2, C.BYTE, 6, 8)], T3.ATTRIBUTES_INFO_OUTLINE = { "fill-outline-color": { name: "color", type: N.R8G8B8A8_COLOR }, "fill-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 } }, T3.ATTRIBUTES_INFO_FILL = { "fill-color": { name: "color", type: N.R8G8B8A8_COLOR }, "fill-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 } };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js
- var i2 = class extends i {
- constructor(e4) {
- super(e4);
- }
- geometryInfo() {
- return i2.GEOMETRY_LAYOUT;
- }
- opacityInfo() {
- return null;
- }
- attributes() {
- return i2.ATTRIBUTES;
- }
- attributesInfo() {
- return i2.ATTRIBUTES_INFO;
- }
- };
- i2.ATTRIBUTES = ["line-blur", "line-color", "line-gap-width", "line-offset", "line-opacity", "line-width", "line-pattern", "line-dasharray"], i2.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.SHORT, 0, 16), new t2("a_extrude_offset", 4, C.BYTE, 4, 16), new t2("a_dir_normal", 4, C.BYTE, 8, 16), new t2("a_accumulatedDistance", 2, C.UNSIGNED_SHORT, 12, 16)], i2.ATTRIBUTES_INFO = { "line-width": { name: "width", type: N.R8_UNSIGNED, precisionFactor: 2 }, "line-gap-width": { name: "gap_width", type: N.R8_UNSIGNED, precisionFactor: 2 }, "line-offset": { name: "offset", type: N.R8_SIGNED, precisionFactor: 2 }, "line-color": { name: "color", type: N.R8G8B8A8_COLOR }, "line-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "line-blur": { name: "blur", type: N.R8_UNSIGNED, precisionFactor: 4 }, "line-pattern": { name: "tlbr", type: N.R16G16B16A16_PATTERN, isOptional: true }, "line-dasharray": { name: "tlbr", type: N.R16G16B16A16_DASHARRAY, isOptional: true } };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js
- var a3 = [new t2("a_pos", 2, C.SHORT, 0, 16), new t2("a_vertexOffset", 2, C.SHORT, 4, 16), new t2("a_texAngleRange", 4, C.UNSIGNED_BYTE, 8, 16), new t2("a_levelInfo", 4, C.UNSIGNED_BYTE, 12, 16)];
- var n = [new t2("a_opacityInfo", 1, C.UNSIGNED_BYTE, 0, 1)];
- var i3 = class extends i {
- constructor(o2) {
- super(o2);
- }
- geometryInfo() {
- return a3;
- }
- opacityInfo() {
- return n;
- }
- attributes() {
- return i3.ATTRIBUTES;
- }
- attributesInfo() {
- return i3.ATTRIBUTES_INFO;
- }
- };
- i3.ATTRIBUTES = ["icon-color", "icon-opacity", "icon-halo-blur", "icon-halo-color", "icon-halo-width", "icon-size"], i3.ATTRIBUTES_INFO = { "icon-color": { name: "color", type: N.R8G8B8A8_COLOR }, "icon-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "icon-halo-color": { name: "halo_color", type: N.R8G8B8A8_COLOR }, "icon-halo-width": { name: "halo_width", type: N.R8_UNSIGNED, precisionFactor: 4 }, "icon-halo-blur": { name: "halo_blur", type: N.R8_UNSIGNED, precisionFactor: 4 }, "icon-size": { name: "size", type: N.R8_UNSIGNED, precisionFactor: 32, isLayout: true } };
- var c2 = class extends i {
- constructor(o2) {
- super(o2);
- }
- geometryInfo() {
- return a3;
- }
- opacityInfo() {
- return n;
- }
- attributes() {
- return c2.ATTRIBUTES;
- }
- attributesInfo() {
- return c2.ATTRIBUTES_INFO;
- }
- };
- c2.ATTRIBUTES = ["text-color", "text-opacity", "text-halo-blur", "text-halo-color", "text-halo-width", "text-size"], c2.ATTRIBUTES_INFO = { "text-color": { name: "color", type: N.R8G8B8A8_COLOR }, "text-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "text-halo-color": { name: "halo_color", type: N.R8G8B8A8_COLOR }, "text-halo-width": { name: "halo_width", type: N.R8_UNSIGNED, precisionFactor: 4 }, "text-halo-blur": { name: "halo_blur", type: N.R8_UNSIGNED, precisionFactor: 4 }, "text-size": { name: "size", type: N.R8_UNSIGNED, isLayout: true } };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/expression/types.js
- var r = { kind: "null" };
- var e3 = { kind: "number" };
- var t5 = { kind: "string" };
- var i4 = { kind: "boolean" };
- var o = { kind: "color" };
- var f2 = { kind: "object" };
- var u = { kind: "value" };
- function a4(n2, r2) {
- return { kind: "array", itemType: n2, n: r2 };
- }
- var y = [r, e3, t5, i4, o, f2, a4(u)];
- function k(n2) {
- if (n2.kind === "array") {
- const r2 = k(n2.itemType);
- return typeof n2.n == "number" ? `array<${r2}, ${n2.n}>` : n2.itemType.kind === "value" ? "array" : `array<${r2}>`;
- }
- return n2.kind;
- }
- function l4(y2) {
- if (y2 === null)
- return r;
- if (typeof y2 == "string")
- return t5;
- if (typeof y2 == "boolean")
- return i4;
- if (typeof y2 == "number")
- return e3;
- if (y2 instanceof l)
- return o;
- if (Array.isArray(y2)) {
- let n2;
- for (const r2 of y2) {
- const e4 = l4(r2);
- if (n2) {
- if (n2 !== e4) {
- n2 = u;
- break;
- }
- } else
- n2 = e4;
- }
- return a4(n2 || u, y2.length);
- }
- return typeof y2 == "object" ? f2 : u;
- }
- function c3(n2, r2) {
- if (r2.kind === "array")
- return n2.kind === "array" && (n2.n === 0 && n2.itemType.kind === "value" || c3(n2.itemType, r2.itemType)) && (typeof r2.n != "number" || r2.n === n2.n);
- if (r2.kind === "value") {
- for (const e4 of y)
- if (c3(n2, e4))
- return true;
- }
- return r2.kind === n2.kind;
- }
- function d(r2) {
- if (r2 === null)
- return "";
- const e4 = typeof r2;
- return e4 === "string" ? r2 : e4 === "number" || e4 === "boolean" ? String(r2) : r2 instanceof l ? r2.toString() : JSON.stringify(r2);
- }
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/expression/expression.js
- var v2 = class {
- constructor(t7) {
- this.parent = t7, this.vars = {};
- }
- add(t7, e4) {
- this.vars[t7] = e4;
- }
- get(t7) {
- return this.vars[t7] ? this.vars[t7] : this.parent ? this.parent.get(t7) : null;
- }
- };
- var b2 = class {
- constructor() {
- this.type = u;
- }
- static parse(t7) {
- if (t7.length > 1)
- throw new Error('"id" does not expect arguments');
- return new b2();
- }
- evaluate(t7, e4) {
- return t7?.id;
- }
- };
- var d2 = class {
- constructor() {
- this.type = t5;
- }
- static parse(t7) {
- if (t7.length > 1)
- throw new Error('"geometry-type" does not expect arguments');
- return new d2();
- }
- evaluate(t7, e4) {
- if (!t7)
- return null;
- switch (t7.type) {
- case s.Point:
- return "Point";
- case s.LineString:
- return "LineString";
- case s.Polygon:
- return "Polygon";
- default:
- return null;
- }
- }
- };
- var x = class {
- constructor() {
- this.type = f2;
- }
- static parse(t7) {
- if (t7.length > 1)
- throw new Error('"properties" does not expect arguments');
- return new x();
- }
- evaluate(t7, e4) {
- return t7?.values;
- }
- };
- var E = class {
- constructor() {
- this.type = e3;
- }
- static parse(t7) {
- if (t7.length > 1)
- throw new Error('"zoom" does not expect arguments');
- return new E();
- }
- evaluate(t7, e4) {
- return e4;
- }
- };
- var $ = class {
- constructor(t7, e4, r2) {
- this.lhs = t7, this.rhs = e4, this.compare = r2, this.type = i4;
- }
- static parse(t7, e4, r2) {
- if (t7.length !== 3 && t7.length !== 4)
- throw new Error(`"${t7[0]}" expects 2 or 3 arguments`);
- if (t7.length === 4)
- throw new Error(`"${t7[0]}" collator not supported`);
- return new $(pt(t7[1], e4), pt(t7[2], e4), r2);
- }
- evaluate(t7, e4) {
- return this.compare(this.lhs.evaluate(t7, e4), this.rhs.evaluate(t7, e4));
- }
- };
- var M = class extends $ {
- static parse(t7, e4) {
- return $.parse(t7, e4, (t8, e5) => t8 === e5);
- }
- };
- var k2 = class extends $ {
- static parse(t7, e4) {
- return $.parse(t7, e4, (t8, e5) => t8 !== e5);
- }
- };
- var A = class extends $ {
- static parse(t7, e4) {
- return $.parse(t7, e4, (t8, e5) => t8 < e5);
- }
- };
- var j = class extends $ {
- static parse(t7, e4) {
- return $.parse(t7, e4, (t8, e5) => t8 <= e5);
- }
- };
- var q = class extends $ {
- static parse(t7, e4) {
- return $.parse(t7, e4, (t8, e5) => t8 > e5);
- }
- };
- var _ = class extends $ {
- static parse(t7, e4) {
- return $.parse(t7, e4, (t8, e5) => t8 >= e5);
- }
- };
- var N2 = class {
- constructor(t7) {
- this.arg = t7, this.type = i4;
- }
- static parse(t7, e4) {
- if (t7.length !== 2)
- throw new Error('"!" expects 1 argument');
- return new N2(pt(t7[1], e4));
- }
- evaluate(t7, e4) {
- return !this.arg.evaluate(t7, e4);
- }
- };
- var R2 = class {
- constructor(t7) {
- this.args = t7, this.type = i4;
- }
- static parse(t7, e4) {
- const r2 = [];
- for (let s2 = 1; s2 < t7.length; s2++)
- r2.push(pt(t7[s2], e4));
- return new R2(r2);
- }
- evaluate(t7, e4) {
- for (const r2 of this.args)
- if (!r2.evaluate(t7, e4))
- return false;
- return true;
- }
- };
- var C2 = class {
- constructor(t7) {
- this.args = t7, this.type = i4;
- }
- static parse(t7, e4) {
- const r2 = [];
- for (let s2 = 1; s2 < t7.length; s2++)
- r2.push(pt(t7[s2], e4));
- return new C2(r2);
- }
- evaluate(t7, e4) {
- for (const r2 of this.args)
- if (r2.evaluate(t7, e4))
- return true;
- return false;
- }
- };
- var z2 = class {
- constructor(t7) {
- this.args = t7, this.type = i4;
- }
- static parse(t7, e4) {
- const r2 = [];
- for (let s2 = 1; s2 < t7.length; s2++)
- r2.push(pt(t7[s2], e4));
- return new z2(r2);
- }
- evaluate(t7, e4) {
- for (const r2 of this.args)
- if (r2.evaluate(t7, e4))
- return false;
- return true;
- }
- };
- var I = class {
- constructor(t7, e4, r2) {
- this.type = t7, this.args = e4, this.fallback = r2;
- }
- static parse(t7, e4, r2) {
- if (t7.length < 4)
- throw new Error('"case" expects at least 3 arguments');
- if (t7.length % 2 == 1)
- throw new Error('"case" expects an odd number of arguments');
- let s2;
- const n2 = [];
- for (let o2 = 1; o2 < t7.length - 1; o2 += 2) {
- const a6 = pt(t7[o2], e4), i5 = pt(t7[o2 + 1], e4, r2);
- s2 || (s2 = i5.type), n2.push({ condition: a6, output: i5 });
- }
- const a5 = pt(t7[t7.length - 1], e4, r2);
- return s2 || (s2 = a5.type), new I(s2, n2, a5);
- }
- evaluate(t7, e4) {
- for (const r2 of this.args)
- if (r2.condition.evaluate(t7, e4))
- return r2.output.evaluate(t7, e4);
- return this.fallback.evaluate(t7, e4);
- }
- };
- var L = class {
- constructor(t7, e4) {
- this.type = t7, this.args = e4;
- }
- static parse(t7, e4) {
- if (t7.length < 2)
- throw new Error('"coalesce" expects at least 1 argument');
- let r2;
- const s2 = [];
- for (let n2 = 1; n2 < t7.length; n2++) {
- const a5 = pt(t7[n2], e4);
- r2 || (r2 = a5.type), s2.push(a5);
- }
- return new L(r2, s2);
- }
- evaluate(t7, e4) {
- for (const r2 of this.args) {
- const s2 = r2.evaluate(t7, e4);
- if (s2 !== null)
- return s2;
- }
- return null;
- }
- };
- var U = class {
- constructor(t7, e4, r2, s2, n2) {
- this.type = t7, this.input = e4, this.labels = r2, this.outputs = s2, this.fallback = n2;
- }
- static parse(t7, e4) {
- if (t7.length < 3)
- throw new Error('"match" expects at least 3 arguments');
- if (t7.length % 2 == 0)
- throw new Error('"case" expects an even number of arguments');
- let r2;
- const s2 = pt(t7[1], e4), n2 = [], a5 = {};
- let o2;
- for (let i5 = 2; i5 < t7.length - 1; i5 += 2) {
- let s3 = t7[i5];
- Array.isArray(s3) || (s3 = [s3]);
- for (const t8 of s3) {
- const e5 = typeof t8;
- if (e5 !== "string" && e5 !== "number")
- throw new Error('"match" requires string or number literal as labels');
- if (o2) {
- if (e5 !== o2)
- throw new Error('"match" requires labels to have the same type');
- } else
- o2 = e5;
- a5[t8] = n2.length;
- }
- const l6 = pt(t7[i5 + 1], e4);
- r2 || (r2 = l6.type), n2.push(l6);
- }
- return new U(r2, s2, a5, n2, pt(t7[t7.length - 1], e4));
- }
- evaluate(t7, e4) {
- const r2 = this.input.evaluate(t7, e4);
- return (this.outputs[this.labels[r2]] || this.fallback).evaluate(t7, e4);
- }
- };
- var P = class {
- constructor(t7, e4, r2, s2, n2) {
- this.operator = t7, this.type = e4, this.interpolation = r2, this.input = s2, this.stops = n2;
- }
- static parse(t7, e4, r2) {
- const s2 = t7[0];
- if (t7.length < 5)
- throw new Error(`"${s2}" expects at least 4 arguments`);
- const n2 = t7[1];
- if (!Array.isArray(n2) || n2.length === 0)
- throw new Error(`"${n2}" is not a valid interpolation`);
- switch (n2[0]) {
- case "linear":
- if (n2.length !== 1)
- throw new Error("Linear interpolation cannot have parameters");
- break;
- case "exponential":
- if (n2.length !== 2 || typeof n2[1] != "number")
- throw new Error("Exponential interpolation requires one numeric argument");
- break;
- case "cubic-bezier":
- if (n2.length !== 5)
- throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");
- for (let t8 = 1; t8 < 5; t8++) {
- const e5 = n2[t8];
- if (typeof e5 != "number" || e5 < 0 || e5 > 1)
- throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");
- }
- break;
- default:
- throw new Error(`"${t7[0]}" unknown interpolation type "${n2[0]}"`);
- }
- if (t7.length % 2 != 1)
- throw new Error(`"${s2}" expects an even number of arguments`);
- const a5 = pt(t7[2], e4, e3);
- let o2;
- s2 === "interpolate-hcl" || s2 === "interpolate-lab" ? o2 = o : r2 && r2.kind !== "value" && (o2 = r2);
- const i5 = [];
- for (let l6 = 3; l6 < t7.length; l6 += 2) {
- const r3 = t7[l6];
- if (typeof r3 != "number")
- throw new Error(`"${s2}" requires stop inputs as literal numbers`);
- if (i5.length && i5[i5.length - 1][0] >= r3)
- throw new Error(`"${s2}" requires strictly ascending stop inputs`);
- const n3 = pt(t7[l6 + 1], e4, o2);
- o2 || (o2 = n3.type), i5.push([r3, n3]);
- }
- if (o2 && o2 !== o && o2 !== e3 && (o2.kind !== "array" || o2.itemType !== e3))
- throw new Error(`"${s2}" cannot interpolate type ${k(o2)}`);
- return new P(s2, o2, n2, a5, i5);
- }
- evaluate(n2, o2) {
- const i5 = this.stops;
- if (i5.length === 1)
- return i5[0][1].evaluate(n2, o2);
- const l6 = this.input.evaluate(n2, o2);
- if (l6 <= i5[0][0])
- return i5[0][1].evaluate(n2, o2);
- if (l6 >= i5[i5.length - 1][0])
- return i5[i5.length - 1][1].evaluate(n2, o2);
- let u2 = 0;
- for (; ++u2 < i5.length && !(l6 < i5[u2][0]); )
- ;
- const c5 = i5[u2 - 1][0], h2 = i5[u2][0], g = P.interpolationRatio(this.interpolation, l6, c5, h2), f4 = i5[u2 - 1][1].evaluate(n2, o2), w = i5[u2][1].evaluate(n2, o2);
- if (this.operator === "interpolate") {
- if (this.type.kind === "array" && Array.isArray(f4) && Array.isArray(w))
- return f4.map((t7, e4) => b(t7, w[e4], g));
- if (this.type.kind === "color" && f4 instanceof l && w instanceof l) {
- const e4 = new l(f4), r2 = new l(w);
- return new l([b(e4.r, r2.r, g), b(e4.g, r2.g, g), b(e4.b, r2.b, g), b(e4.a, r2.a, g)]);
- }
- if (this.type.kind === "number" && typeof f4 == "number" && typeof w == "number")
- return b(f4, w, g);
- throw new Error(`"${this.operator}" cannot interpolate type ${k(this.type)}`);
- }
- if (this.operator === "interpolate-hcl") {
- const s2 = v(f4), n3 = v(w), o3 = n3.h - s2.h, i6 = p({ h: s2.h + g * (o3 > 180 || o3 < -180 ? o3 - 360 * Math.round(o3 / 360) : o3), c: b(s2.c, n3.c, g), l: b(s2.l, n3.l, g) });
- return new l({ a: b(f4.a, w.a, g), ...i6 });
- }
- if (this.operator === "interpolate-lab") {
- const e4 = z(f4), n3 = z(w), o3 = p({ l: b(e4.l, n3.l, g), a: b(e4.a, n3.a, g), b: b(e4.b, n3.b, g) });
- return new l({ a: b(f4.a, w.a, g), ...o3 });
- }
- throw new Error(`Unexpected operator "${this.operator}"`);
- }
- interpolationUniformValue(t7, e4) {
- const r2 = this.stops;
- if (r2.length === 1)
- return 0;
- if (t7 >= r2[r2.length - 1][0])
- return 0;
- let s2 = 0;
- for (; ++s2 < r2.length && !(t7 < r2[s2][0]); )
- ;
- const n2 = r2[s2 - 1][0], a5 = r2[s2][0];
- return P.interpolationRatio(this.interpolation, e4, n2, a5);
- }
- getInterpolationRange(t7) {
- const e4 = this.stops;
- if (e4.length === 1) {
- const t8 = e4[0][0];
- return [t8, t8];
- }
- const r2 = e4[e4.length - 1][0];
- if (t7 >= r2)
- return [r2, r2];
- let s2 = 0;
- for (; ++s2 < e4.length && !(t7 < e4[s2][0]); )
- ;
- return [e4[s2 - 1][0], e4[s2][0]];
- }
- static interpolationRatio(t7, e4, r2, s2) {
- let a5 = 0;
- if (t7[0] === "linear")
- a5 = P._exponentialInterpolationRatio(e4, 1, r2, s2);
- else if (t7[0] === "exponential")
- a5 = P._exponentialInterpolationRatio(e4, t7[1], r2, s2);
- else if (t7[0] === "cubic-bezier") {
- a5 = e2(t7[1], t7[2], t7[3], t7[4])(P._exponentialInterpolationRatio(e4, 1, r2, s2), 1e-5);
- }
- return a5 < 0 ? a5 = 0 : a5 > 1 && (a5 = 1), a5;
- }
- static _exponentialInterpolationRatio(t7, e4, r2, s2) {
- const n2 = s2 - r2;
- if (n2 === 0)
- return 0;
- const a5 = t7 - r2;
- return e4 === 1 ? a5 / n2 : (e4 ** a5 - 1) / (e4 ** n2 - 1);
- }
- };
- var S = class {
- constructor(t7, e4, r2) {
- this.type = t7, this.input = e4, this.stops = r2;
- }
- static parse(t7, e4) {
- if (t7.length < 5)
- throw new Error('"step" expects at least 4 arguments');
- if (t7.length % 2 != 1)
- throw new Error('"step" expects an even number of arguments');
- const r2 = pt(t7[1], e4, e3);
- let s2;
- const n2 = [];
- n2.push([-1 / 0, pt(t7[2], e4)]);
- for (let a5 = 3; a5 < t7.length; a5 += 2) {
- const r3 = t7[a5];
- if (typeof r3 != "number")
- throw new Error('"step" requires stop inputs as literal numbers');
- if (n2.length && n2[n2.length - 1][0] >= r3)
- throw new Error('"step" requires strictly ascending stop inputs');
- const o2 = pt(t7[a5 + 1], e4);
- s2 || (s2 = o2.type), n2.push([r3, o2]);
- }
- return new S(s2, r2, n2);
- }
- evaluate(t7, e4) {
- const r2 = this.stops;
- if (r2.length === 1)
- return r2[0][1].evaluate(t7, e4);
- const s2 = this.input.evaluate(t7, e4);
- let n2 = 0;
- for (; ++n2 < r2.length && !(s2 < r2[n2][0]); )
- ;
- return this.stops[n2 - 1][1].evaluate(t7, e4);
- }
- };
- var B = class {
- constructor(t7, e4) {
- this.type = t7, this.output = e4;
- }
- static parse(t7, e4, r2) {
- if (t7.length < 4)
- throw new Error('"let" expects at least 3 arguments');
- if (t7.length % 2 == 1)
- throw new Error('"let" expects an odd number of arguments');
- const s2 = new v2(e4);
- for (let a5 = 1; a5 < t7.length - 1; a5 += 2) {
- const r3 = t7[a5];
- if (typeof r3 != "string")
- throw new Error(`"let" requires a string to define variable names - found ${r3}`);
- s2.add(r3, pt(t7[a5 + 1], e4));
- }
- const n2 = pt(t7[t7.length - 1], s2, r2);
- return new B(n2.type, n2);
- }
- evaluate(t7, e4) {
- return this.output.evaluate(t7, e4);
- }
- };
- var G = class {
- constructor(t7, e4) {
- this.type = t7, this.output = e4;
- }
- static parse(t7, e4, r2) {
- if (t7.length !== 2 || typeof t7[1] != "string")
- throw new Error('"var" requires just one literal string argument');
- const s2 = e4.get(t7[1]);
- if (!s2)
- throw new Error(`${t7[1]} must be defined before being used in a "var" expression`);
- return new G(r2 || u, s2);
- }
- evaluate(t7, e4) {
- return this.output.evaluate(t7, e4);
- }
- };
- var O = class {
- constructor(t7, e4, r2) {
- this.type = t7, this.index = e4, this.array = r2;
- }
- static parse(t7, e4) {
- if (t7.length !== 3)
- throw new Error('"at" expects 2 arguments');
- const r2 = pt(t7[1], e4, e3), s2 = pt(t7[2], e4);
- return new O(s2.type.itemType, r2, s2);
- }
- evaluate(t7, e4) {
- const r2 = this.index.evaluate(t7, e4), s2 = this.array.evaluate(t7, e4);
- if (r2 < 0 || r2 >= s2.length)
- throw new Error('"at" index out of bounds');
- if (r2 !== Math.floor(r2))
- throw new Error('"at" index must be an integer');
- return s2[r2];
- }
- };
- var T4 = class {
- constructor(t7, e4) {
- this.key = t7, this.obj = e4, this.type = u;
- }
- static parse(t7, e4) {
- let r2, s2;
- switch (t7.length) {
- case 2:
- return r2 = pt(t7[1], e4), new T4(r2);
- case 3:
- return r2 = pt(t7[1], e4), s2 = pt(t7[2], e4), new T4(r2, s2);
- default:
- throw new Error('"get" expects 1 or 2 arguments');
- }
- }
- evaluate(t7, e4) {
- const r2 = this.key.evaluate(t7, e4);
- if (this.obj) {
- return this.obj.evaluate(t7, e4)[r2];
- }
- return t7?.values[r2];
- }
- };
- var F = class {
- constructor(t7, e4) {
- this.key = t7, this.obj = e4, this.type = i4;
- }
- static parse(t7, e4) {
- let r2, s2;
- switch (t7.length) {
- case 2:
- return r2 = pt(t7[1], e4), new F(r2);
- case 3:
- return r2 = pt(t7[1], e4), s2 = pt(t7[2], e4), new F(r2, s2);
- default:
- throw new Error('"has" expects 1 or 2 arguments');
- }
- }
- evaluate(t7, e4) {
- const r2 = this.key.evaluate(t7, e4);
- if (this.obj) {
- return r2 in this.obj.evaluate(t7, e4);
- }
- return !!t7?.values[r2];
- }
- };
- var V = class {
- constructor(t7, e4) {
- this.key = t7, this.vals = e4, this.type = i4;
- }
- static parse(t7, e4) {
- if (t7.length !== 3)
- throw new Error('"in" expects 2 arguments');
- return new V(pt(t7[1], e4), pt(t7[2], e4));
- }
- evaluate(t7, e4) {
- const r2 = this.key.evaluate(t7, e4);
- return this.vals.evaluate(t7, e4).includes(r2);
- }
- };
- var D = class {
- constructor(t7, e4, r2) {
- this.item = t7, this.array = e4, this.from = r2, this.type = e3;
- }
- static parse(t7, e4) {
- if (t7.length < 3 || t7.length > 4)
- throw new Error('"index-of" expects 3 or 4 arguments');
- const r2 = pt(t7[1], e4), s2 = pt(t7[2], e4);
- if (t7.length === 4) {
- const n2 = pt(t7[3], e4, e3);
- return new D(r2, s2, n2);
- }
- return new D(r2, s2);
- }
- evaluate(t7, e4) {
- const r2 = this.item.evaluate(t7, e4), s2 = this.array.evaluate(t7, e4);
- if (this.from) {
- const n2 = this.from.evaluate(t7, e4);
- if (n2 !== Math.floor(n2))
- throw new Error('"index-of" index must be an integer');
- return s2.indexOf(r2, n2);
- }
- return s2.indexOf(r2);
- }
- };
- var H = class {
- constructor(t7) {
- this.arg = t7, this.type = e3;
- }
- static parse(t7, e4) {
- if (t7.length !== 2)
- throw new Error('"length" expects 2 arguments');
- const r2 = pt(t7[1], e4);
- return new H(r2);
- }
- evaluate(t7, e4) {
- const r2 = this.arg.evaluate(t7, e4);
- if (typeof r2 == "string")
- return r2.length;
- if (Array.isArray(r2))
- return r2.length;
- throw new Error('"length" expects string or array');
- }
- };
- var J = class {
- constructor(t7, e4, r2, s2) {
- this.type = t7, this.array = e4, this.from = r2, this.to = s2;
- }
- static parse(t7, e4) {
- if (t7.length < 3 || t7.length > 4)
- throw new Error('"slice" expects 2 or 3 arguments');
- const r2 = pt(t7[1], e4), s2 = pt(t7[2], e4, e3);
- if (s2.type !== e3)
- throw new Error('"slice" index must return a number');
- if (t7.length === 4) {
- const n2 = pt(t7[3], e4, e3);
- if (n2.type !== e3)
- throw new Error('"slice" index must return a number');
- return new J(r2.type, r2, s2, n2);
- }
- return new J(r2.type, r2, s2);
- }
- evaluate(t7, e4) {
- const r2 = this.array.evaluate(t7, e4);
- if (!Array.isArray(r2) && typeof r2 != "string")
- throw new Error('"slice" input must be an array or a string');
- const s2 = this.from.evaluate(t7, e4);
- if (s2 < 0 || s2 >= r2.length)
- throw new Error('"slice" index out of bounds');
- if (s2 !== Math.floor(s2))
- throw new Error('"slice" index must be an integer');
- if (this.to) {
- const n2 = this.to.evaluate(t7, e4);
- if (n2 < 0 || n2 >= r2.length)
- throw new Error('"slice" index out of bounds');
- if (n2 !== Math.floor(n2))
- throw new Error('"slice" index must be an integer');
- return r2.slice(s2, n2);
- }
- return r2.slice(s2);
- }
- };
- var K = class {
- constructor() {
- this.type = i4;
- }
- static parse(t7) {
- if (t7.length !== 1)
- throw new Error('"has-id" expects no arguments');
- return new K();
- }
- evaluate(t7, e4) {
- return t7 && t7.id !== void 0;
- }
- };
- var Q = class {
- constructor(t7, e4) {
- this.args = t7, this.calculate = e4, this.type = e3;
- }
- static parse(t7, e4, r2) {
- const s2 = t7.slice(1).map((t8) => pt(t8, e4));
- return new Q(s2, r2);
- }
- evaluate(t7, e4) {
- let r2;
- return this.args && (r2 = this.args.map((r3) => r3.evaluate(t7, e4))), this.calculate(r2);
- }
- };
- var W = class extends Q {
- static parse(t7, e4) {
- switch (t7.length) {
- case 2:
- return Q.parse(t7, e4, (t8) => -t8[0]);
- case 3:
- return Q.parse(t7, e4, (t8) => t8[0] - t8[1]);
- default:
- throw new Error('"-" expects 1 or 2 arguments');
- }
- }
- };
- var X2 = class extends Q {
- static parse(t7, e4) {
- return Q.parse(t7, e4, (t8) => {
- let e5 = 1;
- for (const r2 of t8)
- e5 *= r2;
- return e5;
- });
- }
- };
- var Y = class extends Q {
- static parse(t7, e4) {
- if (t7.length === 3)
- return Q.parse(t7, e4, (t8) => t8[0] / t8[1]);
- throw new Error('"/" expects 2 arguments');
- }
- };
- var Z = class extends Q {
- static parse(t7, e4) {
- if (t7.length === 3)
- return Q.parse(t7, e4, (t8) => t8[0] % t8[1]);
- throw new Error('"%" expects 2 arguments');
- }
- };
- var tt = class extends Q {
- static parse(t7, e4) {
- if (t7.length === 3)
- return Q.parse(t7, e4, (t8) => t8[0] ** t8[1]);
- throw new Error('"^" expects 1 or 2 arguments');
- }
- };
- var et = class extends Q {
- static parse(t7, e4) {
- return Q.parse(t7, e4, (t8) => {
- let e5 = 0;
- for (const r2 of t8)
- e5 += r2;
- return e5;
- });
- }
- };
- var rt = class {
- constructor(t7, e4) {
- this.args = t7, this.calculate = e4, this.type = e3;
- }
- static parse(t7, e4) {
- const r2 = t7.slice(1).map((t8) => pt(t8, e4));
- return new rt(r2, rt.ops[t7[0]]);
- }
- evaluate(t7, e4) {
- let r2;
- return this.args && (r2 = this.args.map((r3) => r3.evaluate(t7, e4))), this.calculate(r2);
- }
- };
- rt.ops = { abs: (t7) => Math.abs(t7[0]), acos: (t7) => Math.acos(t7[0]), asin: (t7) => Math.asin(t7[0]), atan: (t7) => Math.atan(t7[0]), ceil: (t7) => Math.ceil(t7[0]), cos: (t7) => Math.cos(t7[0]), e: () => Math.E, floor: (t7) => Math.floor(t7[0]), ln: (t7) => Math.log(t7[0]), ln2: () => Math.LN2, log10: (t7) => Math.log(t7[0]) / Math.LN10, log2: (t7) => Math.log(t7[0]) / Math.LN2, max: (t7) => Math.max(...t7), min: (t7) => Math.min(...t7), pi: () => Math.PI, round: (t7) => Math.round(t7[0]), sin: (t7) => Math.sin(t7[0]), sqrt: (t7) => Math.sqrt(t7[0]), tan: (t7) => Math.tan(t7[0]) };
- var st = class {
- constructor(t7) {
- this.args = t7, this.type = t5;
- }
- static parse(t7, e4) {
- return new st(t7.slice(1).map((t8) => pt(t8, e4)));
- }
- evaluate(t7, e4) {
- return this.args.map((r2) => r2.evaluate(t7, e4)).join("");
- }
- };
- var nt = class {
- constructor(t7, e4) {
- this.arg = t7, this.calculate = e4, this.type = t5;
- }
- static parse(t7, e4) {
- if (t7.length !== 2)
- throw new Error(`${t7[0]} expects 1 argument`);
- const r2 = pt(t7[1], e4);
- return new nt(r2, nt.ops[t7[0]]);
- }
- evaluate(t7, e4) {
- return this.calculate(this.arg.evaluate(t7, e4));
- }
- };
- nt.ops = { downcase: (t7) => t7.toLowerCase(), upcase: (t7) => t7.toUpperCase() };
- var at = class {
- constructor(t7) {
- this.args = t7, this.type = o;
- }
- static parse(t7, e4) {
- if (t7.length !== 4)
- throw new Error('"rgb" expects 3 arguments');
- const r2 = t7.slice(1).map((t8) => pt(t8, e4));
- return new at(r2);
- }
- evaluate(e4, r2) {
- const s2 = this._validate(this.args[0].evaluate(e4, r2)), n2 = this._validate(this.args[1].evaluate(e4, r2)), a5 = this._validate(this.args[2].evaluate(e4, r2));
- return new l({ r: s2, g: n2, b: a5 });
- }
- _validate(t7) {
- if (typeof t7 != "number" || t7 < 0 || t7 > 255)
- throw new Error(`${t7}: invalid color component`);
- return Math.round(t7);
- }
- };
- var ot = class {
- constructor(t7) {
- this.args = t7, this.type = o;
- }
- static parse(t7, e4) {
- if (t7.length !== 5)
- throw new Error('"rgba" expects 4 arguments');
- const r2 = t7.slice(1).map((t8) => pt(t8, e4));
- return new ot(r2);
- }
- evaluate(e4, r2) {
- const s2 = this._validate(this.args[0].evaluate(e4, r2)), n2 = this._validate(this.args[1].evaluate(e4, r2)), a5 = this._validate(this.args[2].evaluate(e4, r2)), o2 = this._validateAlpha(this.args[3].evaluate(e4, r2));
- return new l({ r: s2, g: n2, b: a5, a: o2 });
- }
- _validate(t7) {
- if (typeof t7 != "number" || t7 < 0 || t7 > 255)
- throw new Error(`${t7}: invalid color component`);
- return Math.round(t7);
- }
- _validateAlpha(t7) {
- if (typeof t7 != "number" || t7 < 0 || t7 > 1)
- throw new Error(`${t7}: invalid alpha color component`);
- return t7;
- }
- };
- var it = class {
- constructor(t7) {
- this.color = t7, this.type = a4(e3, 4);
- }
- static parse(t7, e4) {
- if (t7.length !== 2)
- throw new Error('"to-rgba" expects 1 argument');
- const r2 = pt(t7[1], e4);
- return new it(r2);
- }
- evaluate(e4, r2) {
- return new l(this.color.evaluate(e4, r2)).toRgba();
- }
- };
- var lt = class {
- constructor(t7, e4) {
- this.type = t7, this.args = e4;
- }
- static parse(t7, e4) {
- const r2 = t7[0];
- if (t7.length < 2)
- throw new Error(`${r2} expects at least one argument`);
- let s2, n2 = 1;
- if (r2 === "array") {
- if (t7.length > 2) {
- switch (t7[1]) {
- case "string":
- s2 = t5;
- break;
- case "number":
- s2 = e3;
- break;
- case "boolean":
- s2 = i4;
- break;
- default:
- throw new Error('"array" type argument must be string, number or boolean');
- }
- n2++;
- } else
- s2 = u;
- let e5;
- if (t7.length > 3) {
- if (e5 = t7[2], e5 !== null && (typeof e5 != "number" || e5 < 0 || e5 !== Math.floor(e5)))
- throw new Error('"array" length argument must be a positive integer literal');
- n2++;
- }
- s2 = a4(s2, e5);
- } else
- switch (r2) {
- case "string":
- s2 = t5;
- break;
- case "number":
- s2 = e3;
- break;
- case "boolean":
- s2 = i4;
- break;
- case "object":
- s2 = f2;
- }
- const a5 = [];
- for (; n2 < t7.length; n2++) {
- const r3 = pt(t7[n2], e4);
- a5.push(r3);
- }
- return new lt(s2, a5);
- }
- evaluate(t7, e4) {
- let r2;
- for (const s2 of this.args) {
- const n2 = s2.evaluate(t7, e4);
- if (r2 = l4(n2), c3(r2, this.type))
- return n2;
- }
- throw new Error(`Expected ${k(this.type)} but got ${k(r2)}`);
- }
- };
- var ut = class {
- constructor(t7, e4) {
- this.type = t7, this.args = e4;
- }
- static parse(t7, e4) {
- const r2 = t7[0], s2 = ut.types[r2];
- if (s2 === i4 || s2 === t5) {
- if (t7.length !== 2)
- throw new Error(`${r2} expects one argument`);
- } else if (t7.length < 2)
- throw new Error(`${r2} expects at least one argument`);
- const n2 = [];
- for (let a5 = 1; a5 < t7.length; a5++) {
- const r3 = pt(t7[a5], e4);
- n2.push(r3);
- }
- return new ut(s2, n2);
- }
- evaluate(e4, r2) {
- if (this.type === i4)
- return Boolean(this.args[0].evaluate(e4, r2));
- if (this.type === t5)
- return d(this.args[0].evaluate(e4, r2));
- if (this.type === e3) {
- for (const t7 of this.args) {
- const s2 = Number(t7.evaluate(e4, r2));
- if (!isNaN(s2))
- return s2;
- }
- return null;
- }
- if (this.type === o) {
- for (const s2 of this.args)
- try {
- const n2 = ut.toColor(s2.evaluate(e4, r2));
- if (n2 instanceof l)
- return n2;
- } catch {
- }
- return null;
- }
- }
- static toBoolean(t7) {
- return Boolean(t7);
- }
- static toString(t7) {
- return d(t7);
- }
- static toNumber(t7) {
- const e4 = Number(t7);
- if (isNaN(e4))
- throw new Error(`"${t7}" is not a number`);
- return e4;
- }
- static toColor(e4) {
- if (e4 instanceof l)
- return e4;
- if (typeof e4 == "string") {
- const r2 = l.fromString(e4);
- if (r2)
- return r2;
- throw new Error(`"${e4}" is not a color`);
- }
- if (Array.isArray(e4))
- return l.fromArray(e4);
- throw new Error(`"${e4}" is not a color`);
- }
- };
- ut.types = { "to-boolean": i4, "to-color": o, "to-number": e3, "to-string": t5 };
- var ct = class {
- constructor(t7) {
- this.val = t7, this.type = l4(t7);
- }
- static parse(t7) {
- if (t7.length !== 2)
- throw new Error('"literal" expects 1 argument');
- return new ct(t7[1]);
- }
- evaluate(t7, e4) {
- return this.val;
- }
- };
- var ht = class {
- constructor(t7) {
- this.arg = t7, this.type = t5;
- }
- static parse(t7, e4) {
- if (t7.length !== 2)
- throw new Error('"typeof" expects 1 argument');
- return new ht(pt(t7[1], e4));
- }
- evaluate(t7, e4) {
- return k(l4(this.arg.evaluate(t7, e4)));
- }
- };
- function pt(t7, e4, r2) {
- const s2 = typeof t7;
- if (s2 === "string" || s2 === "boolean" || s2 === "number" || t7 === null) {
- if (r2)
- switch (r2.kind) {
- case "string":
- s2 !== "string" && (t7 = ut.toString(t7));
- break;
- case "number":
- s2 !== "number" && (t7 = ut.toNumber(t7));
- break;
- case "color":
- t7 = ut.toColor(t7);
- }
- t7 = ["literal", t7];
- }
- if (!Array.isArray(t7) || t7.length === 0)
- throw new Error("Expression must be a non empty array");
- const n2 = t7[0];
- if (typeof n2 != "string")
- throw new Error("First element of expression must be a string");
- const a5 = gt[n2];
- if (a5 === void 0)
- throw new Error(`Invalid expression operator "${n2}"`);
- if (!a5)
- throw new Error(`Unimplemented expression operator "${n2}"`);
- return a5.parse(t7, e4, r2);
- }
- var gt = { array: lt, boolean: lt, collator: null, format: null, image: null, literal: ct, number: lt, "number-format": null, object: lt, string: lt, "to-boolean": ut, "to-color": ut, "to-number": ut, "to-string": ut, typeof: ht, accumulated: null, "feature-state": null, "geometry-type": d2, id: b2, "line-progress": null, properties: x, at: O, get: T4, has: F, in: V, "index-of": D, length: H, slice: J, "!": N2, "!=": k2, "<": A, "<=": j, "==": M, ">": q, ">=": _, all: R2, any: C2, case: I, coalesce: L, match: U, within: null, interpolate: P, "interpolate-hcl": P, "interpolate-lab": P, step: S, let: B, var: G, concat: st, downcase: nt, "is-supported-script": null, "resolved-locale": null, upcase: nt, rgb: at, rgba: ot, "to-rgba": it, "-": W, "*": X2, "/": Y, "%": Z, "^": tt, "+": et, abs: rt, acos: rt, asin: rt, atan: rt, ceil: rt, cos: rt, e: rt, floor: rt, ln: rt, ln2: rt, log10: rt, log2: rt, max: rt, min: rt, pi: rt, round: rt, sin: rt, sqrt: rt, tan: rt, zoom: E, "heatmap-density": null, "has-id": K, none: z2 };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/Filter.js
- var t6 = class {
- constructor(e4) {
- this._expression = e4;
- }
- filter(e4, r2) {
- if (!this._expression)
- return true;
- try {
- return this._expression.evaluate(e4, r2);
- } catch (t7) {
- return console.log(t7.message), true;
- }
- }
- static createFilter(n2) {
- if (!n2)
- return null;
- this.isLegacyFilter(n2) && (n2 = this.convertLegacyFilter(n2));
- try {
- const s2 = pt(n2, null, i4);
- return new t6(s2);
- } catch (s2) {
- return console.log(s2.message), null;
- }
- }
- static isLegacyFilter(e4) {
- if (!Array.isArray(e4))
- return true;
- if (e4.length === 0)
- return true;
- switch (e4[0]) {
- case "==":
- case "!=":
- case ">":
- case "<":
- case ">=":
- case "<=":
- return e4.length === 3 && typeof e4[1] == "string" && !Array.isArray(e4[2]);
- case "in":
- return e4.length >= 3 && typeof e4[1] == "string" && !Array.isArray(e4[2]);
- case "!in":
- case "none":
- case "!has":
- return true;
- case "any":
- case "all":
- for (let r2 = 1; r2 < e4.length; r2++)
- if (this.isLegacyFilter(e4[r2]))
- return true;
- return false;
- case "has":
- return e4.length === 2 && (e4[1] === "$id" || e4[1] === "$type");
- default:
- return false;
- }
- }
- static convertLegacyFilter(e4) {
- if (!Array.isArray(e4) || e4.length === 0)
- return true;
- const r2 = e4[0];
- if (e4.length === 1)
- return r2 !== "any";
- switch (r2) {
- case "==":
- return t6.convertComparison("==", e4[1], e4[2]);
- case "!=":
- return t6.negate(t6.convertComparison("==", e4[1], e4[2]));
- case ">":
- case "<":
- case ">=":
- case "<=":
- return t6.convertComparison(r2, e4[1], e4[2]);
- case "in":
- return t6.convertIn(e4[1], e4.slice(2));
- case "!in":
- return t6.negate(t6.convertIn(e4[1], e4.slice(2)));
- case "any":
- case "all":
- case "none":
- return t6.convertCombining(r2, e4.slice(1));
- case "has":
- return t6.convertHas(e4[1]);
- case "!has":
- return t6.negate(t6.convertHas(e4[1]));
- default:
- throw new Error("Unexpected legacy filter.");
- }
- }
- static convertComparison(e4, r2, t7) {
- switch (r2) {
- case "$type":
- return [e4, ["geometry-type"], t7];
- case "$id":
- return [e4, ["id"], t7];
- default:
- return [e4, ["get", r2], t7];
- }
- }
- static convertIn(e4, r2) {
- switch (e4) {
- case "$type":
- return ["in", ["geometry-type"], ["literal", r2]];
- case "$id":
- return ["in", ["id"], ["literal", r2]];
- default:
- return ["in", ["get", e4], ["literal", r2]];
- }
- }
- static convertHas(e4) {
- switch (e4) {
- case "$type":
- return true;
- case "$id":
- return ["has-id"];
- default:
- return ["has", e4];
- }
- }
- static convertCombining(e4, r2) {
- return [e4].concat(r2.map(this.convertLegacyFilter));
- }
- static negate(e4) {
- return ["!", e4];
- }
- };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleProperty.js
- var h = class {
- constructor(t7, e4) {
- let n2;
- switch (this.isDataDriven = false, this.interpolator = null, t7.type) {
- case "number":
- case "color":
- n2 = true;
- break;
- case "array":
- n2 = t7.value === "number";
- break;
- default:
- n2 = false;
- }
- if (e4 == null && (e4 = t7.default), Array.isArray(e4) && e4.length > 0 && gt[e4[0]]) {
- const r2 = { number: e3, color: o, string: t5, boolean: i4, enum: t5 };
- try {
- const n3 = t7.type === "array" ? a4(r2[t7.value] || u, t7.length) : r2[t7.type], u2 = pt(e4, null, n3);
- this.getValue = this._buildExpression(u2, t7), this.isDataDriven = true, u2 instanceof P && u2.input instanceof E && (this.interpolator = u2);
- } catch (c5) {
- console.log(c5.message), this.getValue = this._buildSimple(t7.default);
- }
- return;
- }
- n2 && e4.type === "interval" && (n2 = false);
- const h2 = e4 && e4.stops && e4.stops.length > 0;
- if (h2)
- for (const r2 of e4.stops)
- r2[1] = this._validate(r2[1], t7);
- if (this.isDataDriven = !!e4 && !!e4.property, this.isDataDriven)
- if (e4.default !== void 0 && (e4.default = this._validate(e4.default, t7)), h2)
- switch (e4.type) {
- case "identity":
- this.getValue = this._buildIdentity(e4, t7);
- break;
- case "categorical":
- this.getValue = this._buildCategorical(e4, t7);
- break;
- default:
- this.getValue = n2 ? this._buildInterpolate(e4, t7) : this._buildInterval(e4, t7);
- }
- else
- this.getValue = this._buildIdentity(e4, t7);
- else
- h2 ? this.getValue = n2 ? this._buildZoomInterpolate(e4) : this._buildZoomInterval(e4) : (e4 = this._validate(e4, t7), this.getValue = this._buildSimple(e4));
- }
- _validate(t7, e4) {
- if (e4.type === "number") {
- if (t7 < e4.minimum)
- return e4.minimum;
- if (t7 > e4.maximum)
- return e4.maximum;
- } else
- e4.type === "color" ? t7 = h._parseColor(t7) : e4.type === "enum" ? typeof t7 == "string" && (t7 = e4.values.indexOf(t7)) : e4.type === "array" && e4.value === "enum" ? t7 = t7.map((t8) => typeof t8 == "string" ? e4.values.indexOf(t8) : t8) : e4.type === "string" && (t7 = d(t7));
- return t7;
- }
- _buildSimple(t7) {
- return () => t7;
- }
- _buildExpression(t7, e4) {
- return (r2, i5) => {
- try {
- const l6 = t7.evaluate(i5, r2);
- return l6 === void 0 ? e4.default : this._validate(l6, e4);
- } catch (l6) {
- return console.log(l6.message), e4.default;
- }
- };
- }
- _buildIdentity(t7, e4) {
- return (r2, i5) => {
- let l6;
- return i5 && (l6 = i5.values[t7.property]), l6 !== void 0 && (l6 = this._validate(l6, e4)), l6 != null ? l6 : t7.default !== void 0 ? t7.default : e4.default;
- };
- }
- _buildCategorical(t7, e4) {
- return (r2, i5) => {
- let l6;
- return i5 && (l6 = i5.values[t7.property]), l6 = this._categorical(l6, t7.stops), l6 !== void 0 ? l6 : t7.default !== void 0 ? t7.default : e4.default;
- };
- }
- _buildInterval(t7, e4) {
- return (r2, i5) => {
- let l6;
- return i5 && (l6 = i5.values[t7.property]), typeof l6 == "number" ? this._interval(l6, t7.stops) : t7.default !== void 0 ? t7.default : e4.default;
- };
- }
- _buildInterpolate(t7, e4) {
- return (r2, i5) => {
- let l6;
- return i5 && (l6 = i5.values[t7.property]), typeof l6 == "number" ? this._interpolate(l6, t7.stops, t7.base || 1) : t7.default !== void 0 ? t7.default : e4.default;
- };
- }
- _buildZoomInterpolate(t7) {
- return (e4) => this._interpolate(e4, t7.stops, t7.base || 1);
- }
- _buildZoomInterval(t7) {
- return (e4) => this._interval(e4, t7.stops);
- }
- _categorical(t7, e4) {
- const r2 = e4.length;
- for (let i5 = 0; i5 < r2; i5++)
- if (e4[i5][0] === t7)
- return e4[i5][1];
- }
- _interval(t7, e4) {
- const r2 = e4.length;
- let i5 = 0;
- for (let l6 = 0; l6 < r2 && e4[l6][0] <= t7; l6++)
- i5 = l6;
- return e4[i5][1];
- }
- _interpolate(t7, r2, i5) {
- let l6, a5;
- const s2 = r2.length;
- for (let e4 = 0; e4 < s2; e4++) {
- const i6 = r2[e4];
- if (!(i6[0] <= t7)) {
- a5 = i6;
- break;
- }
- l6 = i6;
- }
- if (l6 && a5) {
- const r3 = a5[0] - l6[0], s3 = t7 - l6[0], o2 = i5 === 1 ? s3 / r3 : (i5 ** s3 - 1) / (i5 ** r3 - 1);
- if (Array.isArray(l6[1])) {
- const t8 = l6[1], r4 = a5[1], i6 = [];
- for (let l7 = 0; l7 < t8.length; l7++)
- i6.push(b(t8[l7], r4[l7], o2));
- return i6;
- }
- return b(l6[1], a5[1], o2);
- }
- return l6 ? l6[1] : a5 ? a5[1] : void 0;
- }
- static _isEmpty(t7) {
- for (const e4 in t7)
- if (t7.hasOwnProperty(e4))
- return false;
- return true;
- }
- static _parseColor(e4) {
- return Array.isArray(e4) ? e4 : (typeof e4 == "string" && (e4 = new l(e4)), e4 instanceof l && !this._isEmpty(e4) ? l.toUnitRGBA(e4) : void 0);
- }
- };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleLayer.js
- var P2 = class {
- constructor(t7, i5, e4, a5) {
- switch (this.type = t7, this.typeName = i5.type, this.id = i5.id, this.source = i5.source, this.sourceLayer = i5["source-layer"], this.minzoom = i5.minzoom, this.maxzoom = i5.maxzoom, this.filter = i5.filter, this.layout = i5.layout, this.paint = i5.paint, this.z = e4, this.uid = a5, t7) {
- case a.BACKGROUND:
- this._layoutDefinition = f.backgroundLayoutDefinition, this._paintDefinition = f.backgroundPaintDefinition;
- break;
- case a.FILL:
- this._layoutDefinition = f.fillLayoutDefinition, this._paintDefinition = f.fillPaintDefinition;
- break;
- case a.LINE:
- this._layoutDefinition = f.lineLayoutDefinition, this._paintDefinition = f.linePaintDefinition;
- break;
- case a.SYMBOL:
- this._layoutDefinition = f.symbolLayoutDefinition, this._paintDefinition = f.symbolPaintDefinition;
- break;
- case a.CIRCLE:
- this._layoutDefinition = f.circleLayoutDefinition, this._paintDefinition = f.circlePaintDefinition;
- }
- this._layoutProperties = this._parseLayout(this.layout), this._paintProperties = this._parsePaint(this.paint);
- }
- getFeatureFilter() {
- return this._featureFilter !== void 0 ? this._featureFilter : this._featureFilter = t6.createFilter(this.filter);
- }
- getLayoutProperty(t7) {
- return this._layoutProperties[t7];
- }
- getPaintProperty(t7) {
- return this._paintProperties[t7];
- }
- getLayoutValue(t7, i5, e4) {
- let a5;
- const o2 = this._layoutProperties[t7];
- return o2 && (a5 = o2.getValue(i5, e4)), a5 === void 0 && (a5 = this._layoutDefinition[t7].default), a5;
- }
- getPaintValue(t7, i5, e4) {
- let a5;
- const o2 = this._paintProperties[t7];
- return o2 && (a5 = o2.getValue(i5, e4)), a5 === void 0 && (a5 = this._paintDefinition[t7].default), a5;
- }
- isPainterDataDriven() {
- const t7 = this._paintProperties;
- if (t7) {
- for (const i5 in t7)
- if (t7[i5].isDataDriven)
- return true;
- }
- return false;
- }
- _parseLayout(t7) {
- const i5 = {};
- for (const e4 in t7) {
- const a5 = this._layoutDefinition[e4];
- a5 && (i5[e4] = new h(a5, t7[e4]));
- }
- return i5;
- }
- _parsePaint(t7) {
- const i5 = {};
- for (const e4 in t7) {
- const a5 = this._paintDefinition[e4];
- a5 && (i5[e4] = new h(a5, t7[e4]));
- }
- return i5;
- }
- computeAttributesKey(t7, i5, e4, a5) {
- let o2 = 0, r2 = 0;
- for (const s2 of i5) {
- let t8 = 3;
- if (!s2 || s2 !== a5) {
- const i6 = e4[s2], { isLayout: a6, isOptional: o3 } = i6, r3 = a6 ? this.getLayoutProperty(s2) : this.getPaintProperty(s2);
- t8 = r3?.interpolator ? 2 : r3?.isDataDriven ? 1 : o3 && !r3 ? 3 : 0;
- }
- r2 |= t8 << o2, o2 += 2;
- }
- return r2 << 3 | t7;
- }
- };
- var c4 = class extends P2 {
- constructor(t7, a5, o2, r2) {
- super(t7, a5, o2, r2), this.backgroundMaterial = new T2(this.computeAttributesKey(T.BACKGROUND, T2.ATTRIBUTES, T2.ATTRIBUTES_INFO));
- }
- };
- var f3 = class extends P2 {
- constructor(t7, e4, a5, s2) {
- super(t7, e4, a5, s2);
- const n2 = this.getPaintProperty("fill-color"), h2 = this.getPaintProperty("fill-opacity"), l6 = this.getPaintProperty("fill-pattern");
- this.hasDataDrivenColor = n2?.isDataDriven, this.hasDataDrivenOpacity = h2?.isDataDriven, this.hasDataDrivenFill = this.hasDataDrivenColor || this.hasDataDrivenOpacity || l6?.isDataDriven;
- const p2 = this.getPaintProperty("fill-outline-color");
- this.outlineUsesFillColor = !p2, this.hasDataDrivenOutlineColor = p2?.isDataDriven, this.hasDataDrivenOutline = p2 ? p2.isDataDriven : !!n2 && n2.isDataDriven, this.hasDataDrivenOutline = (p2 ? this.hasDataDrivenOutlineColor : this.hasDataDrivenColor) || this.hasDataDrivenOpacity, this.fillMaterial = new l3(this.computeAttributesKey(T.FILL, l3.ATTRIBUTES, l3.ATTRIBUTES_INFO)), this.outlineMaterial = new T3(this.computeAttributesKey(T.OUTLINE, this.outlineUsesFillColor ? T3.ATTRIBUTES_FILL : T3.ATTRIBUTES_OUTLINE, this.outlineUsesFillColor ? T3.ATTRIBUTES_INFO_FILL : T3.ATTRIBUTES_INFO_OUTLINE), this.outlineUsesFillColor);
- }
- };
- var _2 = class extends P2 {
- constructor(t7, e4, a5, o2) {
- super(t7, e4, a5, o2);
- const r2 = this.getPaintProperty("line-pattern");
- if (this.lineMaterial = new i2(this.computeAttributesKey(T.LINE, i2.ATTRIBUTES, i2.ATTRIBUTES_INFO, r2 ? "line-dasharray" : "")), this.hasDataDrivenLine = this.getPaintProperty("line-blur")?.isDataDriven || this.getPaintProperty("line-color")?.isDataDriven || this.getPaintProperty("line-gap-width")?.isDataDriven || this.getPaintProperty("line-offset")?.isDataDriven || this.getPaintProperty("line-opacity")?.isDataDriven || this.getPaintProperty("line-pattern")?.isDataDriven || this.getPaintProperty("line-dasharray")?.isDataDriven || this.getLayoutProperty("line-cap")?.isDataDriven || this.getPaintProperty("line-width")?.isDataDriven, this.canUseThinTessellation = false, !this.hasDataDrivenLine) {
- const t8 = this.getPaintProperty("line-width");
- if (!t8 || typeof t8 == "number" && 0.5 * t8 < X) {
- const t9 = this.getPaintProperty("line-offset");
- (!t9 || typeof t9 == "number" && t9 === 0) && (this.canUseThinTessellation = true);
- }
- }
- }
- getDashKey(i5, e4) {
- let a5;
- switch (e4) {
- case e.BUTT:
- a5 = "Butt";
- break;
- case e.ROUND:
- a5 = "Round";
- break;
- case e.SQUARE:
- a5 = "Square";
- break;
- default:
- a5 = "Butt";
- }
- return `dasharray-[${i5.toString()}]-${a5}`;
- }
- };
- var L2 = class extends P2 {
- constructor(t7, e4, a5, o2) {
- super(t7, e4, a5, o2), this.iconMaterial = new i3(this.computeAttributesKey(T.ICON, i3.ATTRIBUTES, i3.ATTRIBUTES_INFO)), this.textMaterial = new c2(this.computeAttributesKey(T.TEXT, c2.ATTRIBUTES, c2.ATTRIBUTES_INFO)), this.hasDataDrivenIcon = this.getPaintProperty("icon-color")?.isDataDriven || this.getPaintProperty("icon-halo-blur")?.isDataDriven || this.getPaintProperty("icon-halo-color")?.isDataDriven || this.getPaintProperty("icon-halo-width")?.isDataDriven || this.getPaintProperty("icon-opacity")?.isDataDriven || this.getLayoutProperty("icon-size")?.isDataDriven, this.hasDataDrivenText = this.getPaintProperty("text-color")?.isDataDriven || this.getPaintProperty("text-halo-blur")?.isDataDriven || this.getPaintProperty("text-halo-color")?.isDataDriven || this.getPaintProperty("text-halo-width")?.isDataDriven || this.getPaintProperty("text-opacity")?.isDataDriven || this.getLayoutProperty("text-size")?.isDataDriven;
- }
- };
- var d3 = class extends P2 {
- constructor(t7, e4, o2, r2) {
- super(t7, e4, o2, r2), this.circleMaterial = new t4(this.computeAttributesKey(T.CIRCLE, t4.ATTRIBUTES, t4.ATTRIBUTES_INFO));
- }
- };
- var m = class {
- constructor(t7, i5, e4) {
- let a5;
- this.allowOverlap = t7.getLayoutValue("icon-allow-overlap", i5), this.ignorePlacement = t7.getLayoutValue("icon-ignore-placement", i5), this.keepUpright = t7.getLayoutValue("icon-keep-upright", i5), this.optional = t7.getLayoutValue("icon-optional", i5), this.rotationAlignment = t7.getLayoutValue("icon-rotation-alignment", i5), this.rotationAlignment === l2.AUTO && (this.rotationAlignment = e4 ? l2.MAP : l2.VIEWPORT), a5 = t7.getLayoutProperty("icon-anchor"), a5?.isDataDriven ? this._anchorProp = a5 : this.anchor = t7.getLayoutValue("icon-anchor", i5), a5 = t7.getLayoutProperty("icon-offset"), a5?.isDataDriven ? this._offsetProp = a5 : this.offset = t7.getLayoutValue("icon-offset", i5), a5 = t7.getLayoutProperty("icon-padding"), a5?.isDataDriven ? this._paddingProp = a5 : this.padding = t7.getLayoutValue("icon-padding", i5), a5 = t7.getLayoutProperty("icon-rotate"), a5?.isDataDriven ? this._rotateProp = a5 : this.rotate = t7.getLayoutValue("icon-rotate", i5), a5 = t7.getLayoutProperty("icon-size"), a5?.isDataDriven ? this._sizeProp = a5 : this.size = t7.getLayoutValue("icon-size", i5);
- }
- update(t7, i5) {
- this._anchorProp && (this.anchor = this._anchorProp.getValue(t7, i5)), this._offsetProp && (this.offset = this._offsetProp.getValue(t7, i5)), this._paddingProp && (this.padding = this._paddingProp.getValue(t7, i5)), this._rotateProp && (this.rotate = this._rotateProp.getValue(t7, i5)), this._sizeProp && (this.size = this._sizeProp.getValue(t7, i5));
- }
- };
- var T5 = class {
- constructor(t7, i5, e4) {
- let a5;
- this.allowOverlap = t7.getLayoutValue("text-allow-overlap", i5), this.ignorePlacement = t7.getLayoutValue("text-ignore-placement", i5), this.keepUpright = t7.getLayoutValue("text-keep-upright", i5), this.optional = t7.getLayoutValue("text-optional", i5), this.rotationAlignment = t7.getLayoutValue("text-rotation-alignment", i5), this.rotationAlignment === l2.AUTO && (this.rotationAlignment = e4 ? l2.MAP : l2.VIEWPORT), a5 = t7.getLayoutProperty("text-anchor"), a5?.isDataDriven ? this._anchorProp = a5 : this.anchor = t7.getLayoutValue("text-anchor", i5), a5 = t7.getLayoutProperty("text-justify"), a5?.isDataDriven ? this._justifyProp = a5 : this.justify = t7.getLayoutValue("text-justify", i5), a5 = t7.getLayoutProperty("text-letter-spacing"), a5?.isDataDriven ? this._letterSpacingProp = a5 : this.letterSpacing = t7.getLayoutValue("text-letter-spacing", i5), a5 = t7.getLayoutProperty("text-line-height"), a5?.isDataDriven ? this._lineHeightProp = a5 : this.lineHeight = t7.getLayoutValue("text-line-height", i5), a5 = t7.getLayoutProperty("text-max-angle"), a5?.isDataDriven ? this._maxAngleProp = a5 : this.maxAngle = t7.getLayoutValue("text-max-angle", i5), a5 = t7.getLayoutProperty("text-max-width"), a5?.isDataDriven ? this._maxWidthProp = a5 : this.maxWidth = t7.getLayoutValue("text-max-width", i5), a5 = t7.getLayoutProperty("text-offset"), a5?.isDataDriven ? this._offsetProp = a5 : this.offset = t7.getLayoutValue("text-offset", i5), a5 = t7.getLayoutProperty("text-padding"), a5?.isDataDriven ? this._paddingProp = a5 : this.padding = t7.getLayoutValue("text-padding", i5), a5 = t7.getLayoutProperty("text-rotate"), a5?.isDataDriven ? this._rotateProp = a5 : this.rotate = t7.getLayoutValue("text-rotate", i5), a5 = t7.getLayoutProperty("text-size"), a5?.isDataDriven ? this._sizeProp = a5 : this.size = t7.getLayoutValue("text-size", i5), a5 = t7.getLayoutProperty("text-writing-mode"), a5?.isDataDriven ? this._writingModeProp = a5 : this.writingMode = t7.getLayoutValue("text-writing-mode", i5);
- }
- update(t7, i5) {
- this._anchorProp && (this.anchor = this._anchorProp.getValue(t7, i5)), this._justifyProp && (this.justify = this._justifyProp.getValue(t7, i5)), this._letterSpacingProp && (this.letterSpacing = this._letterSpacingProp.getValue(t7, i5)), this._lineHeightProp && (this.lineHeight = this._lineHeightProp.getValue(t7, i5)), this._maxAngleProp && (this.maxAngle = this._maxAngleProp.getValue(t7, i5)), this._maxWidthProp && (this.maxWidth = this._maxWidthProp.getValue(t7, i5)), this._offsetProp && (this.offset = this._offsetProp.getValue(t7, i5)), this._paddingProp && (this.padding = this._paddingProp.getValue(t7, i5)), this._rotateProp && (this.rotate = this._rotateProp.getValue(t7, i5)), this._sizeProp && (this.size = this._sizeProp.getValue(t7, i5)), this._writingModeProp && (this.writingMode = this._writingModeProp.getValue(t7, i5));
- }
- };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleRepository.js
- var l5 = class {
- constructor(t7) {
- if (this._style = t7, this.backgroundBucketIds = [], this._uidToLayer = new Map(), this._layerByName = {}, this._runningId = 0, t7.layers || (t7.layers = []), this.version = parseFloat(t7.version), this.layers = t7.layers.map((e4, t8, r2) => this._create(e4, t8, r2)).filter((e4) => !!e4), this.layers) {
- let t8;
- for (let r2 = 0; r2 < this.layers.length; r2++)
- t8 = this.layers[r2], this._layerByName[t8.id] = t8, this._uidToLayer.set(t8.uid, t8), t8.type === a.BACKGROUND && this.backgroundBucketIds.push(t8.id);
- }
- this._identifyRefLayers();
- }
- isPainterDataDriven(e4) {
- const t7 = this._layerByName[e4];
- return !!t7 && t7.isPainterDataDriven();
- }
- getStyleLayerId(e4) {
- return e4 >= this.layers.length ? null : this.layers[e4].id;
- }
- getStyleLayerByUID(e4) {
- return this._uidToLayer.get(e4) ?? null;
- }
- getStyleLayerIndex(e4) {
- const t7 = this._layerByName[e4];
- return t7 ? this.layers.indexOf(t7) : -1;
- }
- setStyleLayer(e4, t7) {
- if (!e4 || !e4.id)
- return;
- const r2 = this._style;
- t7 != null && t7 >= this.layers.length && (t7 = this.layers.length - 1);
- let s2, i5 = true;
- const a5 = this._layerByName[e4.id];
- if (a5) {
- const y2 = this.layers.indexOf(a5);
- t7 || (t7 = y2), t7 === y2 ? (i5 = false, s2 = l5._recreateLayer(e4, a5), this.layers[t7] = s2, r2.layers[t7] = e4) : (this.layers.splice(y2, 1), r2.layers.splice(y2, 1), s2 = this._create(e4, t7, this.layers), this.layers.splice(t7, 0, s2), r2.layers.splice(t7, 0, e4));
- } else
- s2 = this._create(e4, t7, this.layers), !t7 || t7 >= this.layers.length ? (this.layers.push(s2), r2.layers.push(e4)) : (this.layers.splice(t7, 0, s2), r2.layers.splice(t7, 0, e4));
- this._layerByName[e4.id] = s2, this._uidToLayer.set(s2.uid, s2), i5 && this._recomputeZValues(), this._identifyRefLayers();
- }
- getStyleLayer(e4) {
- const t7 = this._layerByName[e4];
- return t7 ? { type: t7.typeName, id: t7.id, source: t7.source, "source-layer": t7.sourceLayer, minzoom: t7.minzoom, maxzoom: t7.maxzoom, filter: t7.filter, layout: t7.layout, paint: t7.paint } : null;
- }
- deleteStyleLayer(e4) {
- const t7 = this._layerByName[e4];
- if (t7) {
- delete this._layerByName[e4], this._uidToLayer.delete(t7.uid);
- const r2 = this.layers.indexOf(t7);
- this.layers.splice(r2, 1), this._style.layers.splice(r2, 1), this._recomputeZValues(), this._identifyRefLayers();
- }
- }
- getLayerById(e4) {
- return this._layerByName[e4];
- }
- getLayoutProperties(e4) {
- const t7 = this._layerByName[e4];
- return t7 ? t7.layout : null;
- }
- getPaintProperties(e4) {
- const t7 = this._layerByName[e4];
- return t7 ? t7.paint : null;
- }
- setPaintProperties(e4, t7) {
- const r2 = this._layerByName[e4];
- if (!r2)
- return;
- const s2 = { type: r2.typeName, id: r2.id, source: r2.source, "source-layer": r2.sourceLayer, minzoom: r2.minzoom, maxzoom: r2.maxzoom, filter: r2.filter, layout: r2.layout, paint: t7 }, i5 = l5._recreateLayer(s2, r2), a5 = this.layers.indexOf(r2);
- this.layers[a5] = i5, this._style.layers[a5].paint = t7, this._layerByName[r2.id] = i5, this._uidToLayer.set(r2.uid, i5);
- }
- setLayoutProperties(e4, t7) {
- const r2 = this._layerByName[e4];
- if (!r2)
- return;
- const s2 = { type: r2.typeName, id: r2.id, source: r2.source, "source-layer": r2.sourceLayer, minzoom: r2.minzoom, maxzoom: r2.maxzoom, filter: r2.filter, layout: t7, paint: r2.paint }, i5 = l5._recreateLayer(s2, r2), a5 = this.layers.indexOf(r2);
- this.layers[a5] = i5, this._style.layers[a5].layout = t7, this._layerByName[r2.id] = i5, this._uidToLayer.set(r2.uid, i5);
- }
- setStyleLayerVisibility(e4, t7) {
- const r2 = this._layerByName[e4];
- if (!r2)
- return;
- const s2 = r2.layout || {};
- s2.visibility = t7;
- const i5 = { type: r2.typeName, id: r2.id, source: r2.source, "source-layer": r2.sourceLayer, minzoom: r2.minzoom, maxzoom: r2.maxzoom, filter: r2.filter, layout: s2, paint: r2.paint }, a5 = l5._recreateLayer(i5, r2), y2 = this.layers.indexOf(r2);
- this.layers[y2] = a5, this._style.layers[y2].layout = s2, this._layerByName[r2.id] = a5, this._uidToLayer.set(r2.uid, a5);
- }
- getStyleLayerVisibility(e4) {
- const t7 = this._layerByName[e4];
- if (!t7)
- return "none";
- return t7.layout?.visibility ?? "visible";
- }
- _recomputeZValues() {
- const e4 = this.layers, t7 = 1 / (e4.length + 1);
- for (let r2 = 0; r2 < e4.length; r2++)
- e4[r2].z = 1 - (1 + r2) * t7;
- }
- _identifyRefLayers() {
- const t7 = [], r2 = [];
- let s2 = 0;
- for (const i5 of this.layers) {
- const a5 = i5.layout;
- if (i5.type === a.FILL) {
- const e4 = i5;
- let r3 = i5.source + "|" + i5.sourceLayer;
- r3 += "|" + a5?.visibility, r3 += "|" + i5.minzoom, r3 += "|" + i5.maxzoom, r3 += "|" + JSON.stringify(i5.filter), (e4.hasDataDrivenFill || e4.hasDataDrivenOutline) && (r3 += "|" + s2), t7.push({ key: r3, layer: i5 });
- } else if (i5.type === a.LINE) {
- const e4 = i5;
- let t8 = i5.source + "|" + i5.sourceLayer;
- t8 += "|" + a5?.visibility, t8 += "|" + i5.minzoom, t8 += "|" + i5.maxzoom, t8 += "|" + JSON.stringify(i5.filter), t8 += "|" + (a5 !== void 0 ? a5["line-cap"] : ""), t8 += "|" + (a5 !== void 0 ? a5["line-join"] : ""), e4.hasDataDrivenLine && (t8 += "|" + s2), r2.push({ key: t8, layer: i5 });
- }
- ++s2;
- }
- this._assignRefLayers(t7), this._assignRefLayers(r2);
- }
- _assignRefLayers(t7) {
- let r2, s2;
- t7.sort((e4, t8) => e4.key < t8.key ? -1 : e4.key > t8.key ? 1 : 0);
- const i5 = t7.length;
- for (let a5 = 0; a5 < i5; a5++) {
- const l6 = t7[a5];
- if (l6.key === r2)
- l6.layer.refLayerId = s2;
- else if (r2 = l6.key, s2 = l6.layer.id, l6.layer.type === a.FILL) {
- if (!l6.layer.getPaintProperty("fill-outline-color"))
- for (let e4 = a5 + 1; e4 < i5; e4++) {
- const i6 = t7[e4];
- if (i6.key !== r2)
- break;
- if (i6.layer.getPaintProperty("fill-outline-color")) {
- t7[a5] = i6, t7[e4] = l6, s2 = i6.layer.id;
- break;
- }
- }
- } else if (l6.layer.type === a.LINE) {
- let e4 = l6.layer;
- for (let y2 = a5 + 1; y2 < i5; y2++) {
- const i6 = t7[y2];
- if (i6.key !== r2)
- break;
- const n2 = i6.layer;
- (e4.canUseThinTessellation && !n2.canUseThinTessellation || !e4.canUseThinTessellation && (n2.getPaintProperty("line-pattern") || n2.getPaintProperty("line-dasharray"))) && (e4 = n2, t7[a5] = i6, t7[y2] = l6, s2 = i6.layer.id);
- }
- }
- }
- }
- _create(l6, y2, n2) {
- const o2 = 1 - (1 + y2) * (1 / (n2.length + 1)), u2 = this._runningId++;
- switch (l6.type) {
- case "background":
- return new c4(a.BACKGROUND, l6, o2, u2);
- case "fill":
- return new f3(a.FILL, l6, o2, u2);
- case "line":
- return new _2(a.LINE, l6, o2, u2);
- case "symbol":
- return new L2(a.SYMBOL, l6, o2, u2);
- case "raster":
- console.warn(`Unsupported vector tile raster layer ${l6.id}`);
- case "circle":
- return new d3(a.CIRCLE, l6, o2, u2);
- }
- }
- static _recreateLayer(l6, y2) {
- switch (l6.type) {
- case "background":
- return new c4(a.BACKGROUND, l6, y2.z, y2.uid);
- case "fill":
- return new f3(a.FILL, l6, y2.z, y2.uid);
- case "line":
- return new _2(a.LINE, l6, y2.z, y2.uid);
- case "symbol":
- return new L2(a.SYMBOL, l6, y2.z, y2.uid);
- case "raster":
- console.warn(`Unsupported vector tile raster layer ${l6.id}`);
- case "circle":
- return new d3(a.CIRCLE, l6, y2.z, y2.uid);
- }
- }
- };
- export {
- t3 as t,
- m,
- T5 as T,
- l5 as l
- };
- //# sourceMappingURL=chunk-Y4YDGLMZ.js.map
|