@placemarkio/polyline 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,122 +1,106 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decode = decode;
4
- exports.encode = encode;
5
- exports.geoJSONToPolyline = geoJSONToPolyline;
6
- exports.polylineToGeoJSON = polylineToGeoJSON;
7
- // https://github.com/mapbox/polyline/blob/master/src/polyline.js
8
- // Based off of [the offical Google document](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
9
- //
10
- // Some parts from [this implementation](http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/PolylineEncoder.js)
11
- // by [Mark McClure](http://facstaff.unca.edu/mcmcclur/)
1
+
2
+ //#region src/index.ts
12
3
  function py2_round(value) {
13
- // Google's polyline algorithm uses the same rounding strategy as Python 2,
14
- // which is different from JS for negative values
15
- return Math.floor(Math.abs(value) + 0.5) * (value >= 0 ? 1 : -1);
4
+ return Math.floor(Math.abs(value) + .5) * (value >= 0 ? 1 : -1);
16
5
  }
17
6
  function encodeNumber(current, previous, factor) {
18
- current = py2_round(current * factor);
19
- previous = py2_round(previous * factor);
20
- let coordinate = current - previous;
21
- coordinate <<= 1;
22
- if (current - previous < 0) {
23
- coordinate = ~coordinate;
24
- }
25
- let output = "";
26
- while (coordinate >= 0x20) {
27
- output += String.fromCharCode((0x20 | (coordinate & 0x1f)) + 63);
28
- coordinate >>= 5;
29
- }
30
- output += String.fromCharCode(coordinate + 63);
31
- return output;
7
+ current = py2_round(current * factor);
8
+ previous = py2_round(previous * factor);
9
+ let coordinate = current - previous;
10
+ coordinate <<= 1;
11
+ if (current - previous < 0) coordinate = ~coordinate;
12
+ let output = "";
13
+ while (coordinate >= 32) {
14
+ output += String.fromCharCode((32 | coordinate & 31) + 63);
15
+ coordinate >>= 5;
16
+ }
17
+ output += String.fromCharCode(coordinate + 63);
18
+ return output;
32
19
  }
33
20
  function resultChange(result) {
34
- return result & 1 ? ~(result >> 1) : result >> 1;
21
+ return result & 1 ? ~(result >> 1) : result >> 1;
35
22
  }
36
23
  /**
37
- * Decodes any string into a [longitude, latitude] coordinates array.
38
- *
39
- * Any string is a valid polyline, but if you provide this
40
- * with an arbitrary string, it'll produce coordinates well
41
- * outside of the normal range.
42
- */
24
+ * Decodes any string into a [longitude, latitude] coordinates array.
25
+ *
26
+ * Any string is a valid polyline, but if you provide this
27
+ * with an arbitrary string, it'll produce coordinates well
28
+ * outside of the normal range.
29
+ */
43
30
  function decode(str, precision = 5) {
44
- const factor = 10 ** precision;
45
- let index = 0;
46
- let lat = 0;
47
- let lng = 0;
48
- const coordinates = [];
49
- let shift = 0;
50
- let result = 0;
51
- let byte = null;
52
- let latitude_change;
53
- let longitude_change;
54
- // Coordinates have variable length when encoded, so just keep
55
- // track of whether we've hit the end of the string. In each
56
- // loop iteration, a single coordinate is decoded.
57
- while (index < str.length) {
58
- // Reset shift, result, and byte
59
- byte = null;
60
- shift = 0;
61
- result = 0;
62
- do {
63
- byte = str.charCodeAt(index++) - 63;
64
- result |= (byte & 0x1f) << shift;
65
- shift += 5;
66
- } while (byte >= 0x20);
67
- latitude_change = resultChange(result);
68
- shift = result = 0;
69
- do {
70
- byte = str.charCodeAt(index++) - 63;
71
- result |= (byte & 0x1f) << shift;
72
- shift += 5;
73
- } while (byte >= 0x20);
74
- longitude_change = resultChange(result);
75
- lat += latitude_change;
76
- lng += longitude_change;
77
- coordinates.push([lng / factor, lat / factor]);
78
- }
79
- return coordinates;
31
+ const factor = 10 ** precision;
32
+ let index = 0;
33
+ let lat = 0;
34
+ let lng = 0;
35
+ const coordinates = [];
36
+ let shift = 0;
37
+ let result = 0;
38
+ let byte = null;
39
+ let latitude_change;
40
+ let longitude_change;
41
+ while (index < str.length) {
42
+ byte = null;
43
+ shift = 0;
44
+ result = 0;
45
+ do {
46
+ byte = str.charCodeAt(index++) - 63;
47
+ result |= (byte & 31) << shift;
48
+ shift += 5;
49
+ } while (byte >= 32);
50
+ latitude_change = resultChange(result);
51
+ shift = result = 0;
52
+ do {
53
+ byte = str.charCodeAt(index++) - 63;
54
+ result |= (byte & 31) << shift;
55
+ shift += 5;
56
+ } while (byte >= 32);
57
+ longitude_change = resultChange(result);
58
+ lat += latitude_change;
59
+ lng += longitude_change;
60
+ coordinates.push([lng / factor, lat / factor]);
61
+ }
62
+ return coordinates;
80
63
  }
81
64
  /**
82
- * Encodes the given [latitude, longitude] coordinates array.
83
- *
84
- * @param coordinates Coordinates, in longitude, latitude order
85
- * @returns encoded polyline
86
- */
65
+ * Encodes the given [latitude, longitude] coordinates array.
66
+ *
67
+ * @param coordinates Coordinates, in longitude, latitude order
68
+ * @returns encoded polyline
69
+ */
87
70
  function encode(coordinates, precision = 5) {
88
- if (!coordinates.length) {
89
- return "";
90
- }
91
- const factor = 10 ** precision;
92
- let output = encodeNumber(coordinates[0][1], 0, factor) +
93
- encodeNumber(coordinates[0][0], 0, factor);
94
- for (let i = 1; i < coordinates.length; i++) {
95
- const a = coordinates[i];
96
- const b = coordinates[i - 1];
97
- output += encodeNumber(a[1], b[1], factor);
98
- output += encodeNumber(a[0], b[0], factor);
99
- }
100
- return output;
71
+ if (!coordinates.length) return "";
72
+ const factor = 10 ** precision;
73
+ let output = encodeNumber(coordinates[0][1], 0, factor) + encodeNumber(coordinates[0][0], 0, factor);
74
+ for (let i = 1; i < coordinates.length; i++) {
75
+ const a = coordinates[i];
76
+ const b = coordinates[i - 1];
77
+ output += encodeNumber(a[1], b[1], factor);
78
+ output += encodeNumber(a[0], b[0], factor);
79
+ }
80
+ return output;
101
81
  }
102
82
  /**
103
- * Encodes a GeoJSON LineString feature/geometry.
104
- *
105
- * @param geojson A LineString
106
- */
83
+ * Encodes a GeoJSON LineString feature/geometry.
84
+ *
85
+ * @param geojson A LineString
86
+ */
107
87
  function geoJSONToPolyline(geojson, precision = 5) {
108
- return encode(geojson.coordinates, precision);
88
+ return encode(geojson.coordinates, precision);
109
89
  }
110
90
  /**
111
- * Decodes to a GeoJSON LineString geometry.
112
- *
113
- * @param str An encoded polyline as a string.
114
- */
91
+ * Decodes to a GeoJSON LineString geometry.
92
+ *
93
+ * @param str An encoded polyline as a string.
94
+ */
115
95
  function polylineToGeoJSON(str, precision = 5) {
116
- const coords = decode(str, precision);
117
- return {
118
- type: "LineString",
119
- coordinates: coords,
120
- };
96
+ return {
97
+ type: "LineString",
98
+ coordinates: decode(str, precision)
99
+ };
121
100
  }
122
- //# sourceMappingURL=index.js.map
101
+
102
+ //#endregion
103
+ exports.decode = decode;
104
+ exports.encode = encode;
105
+ exports.geoJSONToPolyline = geoJSONToPolyline;
106
+ exports.polylineToGeoJSON = polylineToGeoJSON;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,7 @@
1
- import type { LineString, Position } from "geojson";
1
+ import { LineString, Position } from "geojson";
2
+
3
+ //#region src/index.d.ts
4
+
2
5
  /**
3
6
  * Decodes any string into a [longitude, latitude] coordinates array.
4
7
  *
@@ -6,24 +9,26 @@ import type { LineString, Position } from "geojson";
6
9
  * with an arbitrary string, it'll produce coordinates well
7
10
  * outside of the normal range.
8
11
  */
9
- export declare function decode(str: string, precision?: number): Position[];
12
+ declare function decode(str: string, precision?: number): Position[];
10
13
  /**
11
14
  * Encodes the given [latitude, longitude] coordinates array.
12
15
  *
13
16
  * @param coordinates Coordinates, in longitude, latitude order
14
17
  * @returns encoded polyline
15
18
  */
16
- export declare function encode(coordinates: number[][], precision?: number): string;
19
+ declare function encode(coordinates: number[][], precision?: number): string;
17
20
  /**
18
21
  * Encodes a GeoJSON LineString feature/geometry.
19
22
  *
20
23
  * @param geojson A LineString
21
24
  */
22
- export declare function geoJSONToPolyline(geojson: LineString, precision?: number): string;
25
+ declare function geoJSONToPolyline(geojson: LineString, precision?: number): string;
23
26
  /**
24
27
  * Decodes to a GeoJSON LineString geometry.
25
28
  *
26
29
  * @param str An encoded polyline as a string.
27
30
  */
28
- export declare function polylineToGeoJSON(str: string, precision?: number): LineString;
29
- //# sourceMappingURL=index.d.ts.map
31
+ declare function polylineToGeoJSON(str: string, precision?: number): LineString;
32
+ //#endregion
33
+ export { decode, encode, geoJSONToPolyline, polylineToGeoJSON };
34
+ //# sourceMappingURL=index.d.cts.map
@@ -1,4 +1,7 @@
1
- import type { LineString, Position } from "geojson";
1
+ import { LineString, Position } from "geojson";
2
+
3
+ //#region src/index.d.ts
4
+
2
5
  /**
3
6
  * Decodes any string into a [longitude, latitude] coordinates array.
4
7
  *
@@ -6,24 +9,26 @@ import type { LineString, Position } from "geojson";
6
9
  * with an arbitrary string, it'll produce coordinates well
7
10
  * outside of the normal range.
8
11
  */
9
- export declare function decode(str: string, precision?: number): Position[];
12
+ declare function decode(str: string, precision?: number): Position[];
10
13
  /**
11
14
  * Encodes the given [latitude, longitude] coordinates array.
12
15
  *
13
16
  * @param coordinates Coordinates, in longitude, latitude order
14
17
  * @returns encoded polyline
15
18
  */
16
- export declare function encode(coordinates: number[][], precision?: number): string;
19
+ declare function encode(coordinates: number[][], precision?: number): string;
17
20
  /**
18
21
  * Encodes a GeoJSON LineString feature/geometry.
19
22
  *
20
23
  * @param geojson A LineString
21
24
  */
22
- export declare function geoJSONToPolyline(geojson: LineString, precision?: number): string;
25
+ declare function geoJSONToPolyline(geojson: LineString, precision?: number): string;
23
26
  /**
24
27
  * Decodes to a GeoJSON LineString geometry.
25
28
  *
26
29
  * @param str An encoded polyline as a string.
27
30
  */
28
- export declare function polylineToGeoJSON(str: string, precision?: number): LineString;
29
- //# sourceMappingURL=index.d.ts.map
31
+ declare function polylineToGeoJSON(str: string, precision?: number): LineString;
32
+ //#endregion
33
+ export { decode, encode, geoJSONToPolyline, polylineToGeoJSON };
34
+ //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs ADDED
@@ -0,0 +1,103 @@
1
+ //#region src/index.ts
2
+ function py2_round(value) {
3
+ return Math.floor(Math.abs(value) + .5) * (value >= 0 ? 1 : -1);
4
+ }
5
+ function encodeNumber(current, previous, factor) {
6
+ current = py2_round(current * factor);
7
+ previous = py2_round(previous * factor);
8
+ let coordinate = current - previous;
9
+ coordinate <<= 1;
10
+ if (current - previous < 0) coordinate = ~coordinate;
11
+ let output = "";
12
+ while (coordinate >= 32) {
13
+ output += String.fromCharCode((32 | coordinate & 31) + 63);
14
+ coordinate >>= 5;
15
+ }
16
+ output += String.fromCharCode(coordinate + 63);
17
+ return output;
18
+ }
19
+ function resultChange(result) {
20
+ return result & 1 ? ~(result >> 1) : result >> 1;
21
+ }
22
+ /**
23
+ * Decodes any string into a [longitude, latitude] coordinates array.
24
+ *
25
+ * Any string is a valid polyline, but if you provide this
26
+ * with an arbitrary string, it'll produce coordinates well
27
+ * outside of the normal range.
28
+ */
29
+ function decode(str, precision = 5) {
30
+ const factor = 10 ** precision;
31
+ let index = 0;
32
+ let lat = 0;
33
+ let lng = 0;
34
+ const coordinates = [];
35
+ let shift = 0;
36
+ let result = 0;
37
+ let byte = null;
38
+ let latitude_change;
39
+ let longitude_change;
40
+ while (index < str.length) {
41
+ byte = null;
42
+ shift = 0;
43
+ result = 0;
44
+ do {
45
+ byte = str.charCodeAt(index++) - 63;
46
+ result |= (byte & 31) << shift;
47
+ shift += 5;
48
+ } while (byte >= 32);
49
+ latitude_change = resultChange(result);
50
+ shift = result = 0;
51
+ do {
52
+ byte = str.charCodeAt(index++) - 63;
53
+ result |= (byte & 31) << shift;
54
+ shift += 5;
55
+ } while (byte >= 32);
56
+ longitude_change = resultChange(result);
57
+ lat += latitude_change;
58
+ lng += longitude_change;
59
+ coordinates.push([lng / factor, lat / factor]);
60
+ }
61
+ return coordinates;
62
+ }
63
+ /**
64
+ * Encodes the given [latitude, longitude] coordinates array.
65
+ *
66
+ * @param coordinates Coordinates, in longitude, latitude order
67
+ * @returns encoded polyline
68
+ */
69
+ function encode(coordinates, precision = 5) {
70
+ if (!coordinates.length) return "";
71
+ const factor = 10 ** precision;
72
+ let output = encodeNumber(coordinates[0][1], 0, factor) + encodeNumber(coordinates[0][0], 0, factor);
73
+ for (let i = 1; i < coordinates.length; i++) {
74
+ const a = coordinates[i];
75
+ const b = coordinates[i - 1];
76
+ output += encodeNumber(a[1], b[1], factor);
77
+ output += encodeNumber(a[0], b[0], factor);
78
+ }
79
+ return output;
80
+ }
81
+ /**
82
+ * Encodes a GeoJSON LineString feature/geometry.
83
+ *
84
+ * @param geojson A LineString
85
+ */
86
+ function geoJSONToPolyline(geojson, precision = 5) {
87
+ return encode(geojson.coordinates, precision);
88
+ }
89
+ /**
90
+ * Decodes to a GeoJSON LineString geometry.
91
+ *
92
+ * @param str An encoded polyline as a string.
93
+ */
94
+ function polylineToGeoJSON(str, precision = 5) {
95
+ return {
96
+ type: "LineString",
97
+ coordinates: decode(str, precision)
98
+ };
99
+ }
100
+
101
+ //#endregion
102
+ export { decode, encode, geoJSONToPolyline, polylineToGeoJSON };
103
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ window.hierarchyData = "eJyrVirKzy8pVrKKjtVRKkpNy0lNLsnMzytWsqqurQUAmx4Kpg=="
@@ -0,0 +1,18 @@
1
+ (function() {
2
+ addIcons();
3
+ function addIcons() {
4
+ if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons);
5
+ const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg"));
6
+ svg.innerHTML = `<g id="icon-1" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">M</text></g><g id="icon-2" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">M</text></g><g id="icon-4" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">N</text></g><g id="icon-8" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">E</text></g><g id="icon-16" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">P</text></g><g id="icon-32" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">V</text></g><g id="icon-64" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">F</text></g><g id="icon-128" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">C</text></g><g id="icon-256" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">I</text></g><g id="icon-512" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-constructor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">C</text></g><g id="icon-1024" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">P</text></g><g id="icon-2048" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-method)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">M</text></g><g id="icon-4096" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">F</text></g><g id="icon-8192" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">P</text></g><g id="icon-16384" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-constructor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">C</text></g><g id="icon-32768" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">P</text></g><g id="icon-65536" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">T</text></g><g id="icon-131072" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">T</text></g><g id="icon-262144" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">A</text></g><g id="icon-524288" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">A</text></g><g id="icon-1048576" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">A</text></g><g id="icon-2097152" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">T</text></g><g id="icon-4194304" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-reference)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">R</text></g><g id="icon-8388608" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-document)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><g stroke="var(--color-icon-text)" fill="none" stroke-width="1.5"><polygon points="6,5 6,19 18,19, 18,10 13,5"></polygon><line x1="9" y1="9" x2="13" y2="9"></line><line x1="9" y1="12" x2="15" y2="12"></line><line x1="9" y1="15" x2="15" y2="15"></line></g></g><g id="icon-folder" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-document)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><g stroke="var(--color-icon-text)" fill="none" stroke-width="1.5"><polygon points="5,5 10,5 12,8 19,8 19,18 5,18"></polygon></g></g><g id="icon-chevronDown" class="tsd-no-select"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-icon-text)"></path></g><g id="icon-chevronSmall" class="tsd-no-select"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-icon-text)"></path></g><g id="icon-checkbox" class="tsd-no-select"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></g><g id="icon-menu" class="tsd-no-select"><rect x="1" y="3" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-icon-text)"></rect></g><g id="icon-search" class="tsd-no-select"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-icon-text)"></path></g><g id="icon-anchor" class="tsd-no-select"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></g><g id="icon-alertNote" class="tsd-no-select"><path fill="var(--color-alert-note)" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></g><g id="icon-alertTip" class="tsd-no-select"><path fill="var(--color-alert-tip)" d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></g><g id="icon-alertImportant" class="tsd-no-select"><path fill="var(--color-alert-important)" d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></g><g id="icon-alertWarning" class="tsd-no-select"><path fill="var(--color-alert-warning)" d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></g><g id="icon-alertCaution" class="tsd-no-select"><path fill="var(--color-alert-caution)" d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></g>`;
7
+ svg.style.display = "none";
8
+ if (location.protocol === "file:") updateUseElements();
9
+ }
10
+
11
+ function updateUseElements() {
12
+ document.querySelectorAll("use").forEach(el => {
13
+ if (el.getAttribute("href").includes("#icon-")) {
14
+ el.setAttribute("href", el.getAttribute("href").replace(/.*#/, "#"));
15
+ }
16
+ });
17
+ }
18
+ })()