@dra2020/baseclient 1.0.12 → 1.0.15
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/README.md +16 -5
- package/dist/all/all.d.ts +18 -2
- package/dist/all/allclient.d.ts +18 -0
- package/dist/base.js +33010 -0
- package/dist/base.js.map +1 -0
- package/dist/baseclient.js +176 -1298
- package/dist/baseclient.js.map +1 -1
- package/dist/dbabstract/all.d.ts +1 -0
- package/dist/dbabstract/db.d.ts +83 -0
- package/dist/dbdynamo/all.d.ts +1 -0
- package/dist/dbdynamo/dbdynamo.d.ts +190 -0
- package/dist/filterexpr/filterexpr.d.ts +0 -3
- package/dist/fsm/fsm.d.ts +0 -1
- package/dist/fsmfile/all.d.ts +1 -0
- package/dist/fsmfile/fsmfile.d.ts +47 -0
- package/dist/jsonstream/all.d.ts +1 -0
- package/dist/jsonstream/jsonstream.d.ts +130 -0
- package/dist/lambda/all.d.ts +1 -0
- package/dist/lambda/env.d.ts +10 -0
- package/dist/lambda/lambda.d.ts +18 -0
- package/dist/logserver/all.d.ts +5 -0
- package/dist/logserver/log.d.ts +11 -0
- package/dist/logserver/logaccum.d.ts +154 -0
- package/dist/logserver/logblob.d.ts +24 -0
- package/dist/logserver/logconcat.d.ts +55 -0
- package/dist/logserver/logkey.d.ts +28 -0
- package/dist/memsqs/all.d.ts +4 -0
- package/dist/memsqs/client.d.ts +13 -0
- package/dist/memsqs/loopback.d.ts +11 -0
- package/dist/memsqs/orderedlist.d.ts +19 -0
- package/dist/memsqs/queue.d.ts +84 -0
- package/dist/memsqs/server.d.ts +37 -0
- package/dist/ot-js/otsession.d.ts +0 -3
- package/dist/poly/union.d.ts +0 -1
- package/dist/storage/all.d.ts +4 -0
- package/dist/storage/datablob.d.ts +9 -0
- package/dist/storage/env.d.ts +10 -0
- package/dist/storage/splitsblob.d.ts +13 -0
- package/dist/storage/storage.d.ts +166 -0
- package/dist/storages3/all.d.ts +1 -0
- package/dist/storages3/s3.d.ts +62 -0
- package/docs/dbabstract.md +2 -0
- package/docs/dbdynamo.md +2 -0
- package/docs/fsmfile.md +2 -0
- package/docs/jsonstream.md +44 -0
- package/docs/lambda.md +2 -0
- package/docs/logserver.md +2 -0
- package/docs/storage.md +2 -0
- package/docs/storages3.md +2 -0
- package/lib/all/all.ts +22 -2
- package/lib/all/allclient.ts +19 -0
- package/lib/dbabstract/all.ts +1 -0
- package/lib/dbabstract/db.ts +246 -0
- package/lib/dbdynamo/all.ts +1 -0
- package/lib/dbdynamo/dbdynamo.ts +1551 -0
- package/lib/filterexpr/filterexpr.ts +5 -79
- package/lib/fsm/fsm.ts +2 -12
- package/lib/fsmfile/all.ts +1 -0
- package/lib/fsmfile/fsmfile.ts +236 -0
- package/lib/jsonstream/all.ts +1 -0
- package/lib/jsonstream/jsonstream.ts +940 -0
- package/lib/lambda/all.ts +1 -0
- package/lib/lambda/env.ts +13 -0
- package/lib/lambda/lambda.ts +120 -0
- package/lib/logserver/all.ts +5 -0
- package/lib/logserver/log.ts +565 -0
- package/lib/logserver/logaccum.ts +1445 -0
- package/lib/logserver/logblob.ts +84 -0
- package/lib/logserver/logconcat.ts +313 -0
- package/lib/logserver/logkey.ts +125 -0
- package/lib/memsqs/all.ts +4 -0
- package/lib/memsqs/client.ts +268 -0
- package/lib/memsqs/loopback.ts +64 -0
- package/lib/memsqs/orderedlist.ts +74 -0
- package/lib/memsqs/queue.ts +395 -0
- package/lib/memsqs/server.ts +262 -0
- package/lib/ot-js/otsession.ts +1 -4
- package/lib/poly/hash.ts +1 -1
- package/lib/poly/polypack.ts +2 -12
- package/lib/poly/topo.ts +41 -15
- package/lib/poly/union.ts +0 -17
- package/lib/storage/all.ts +4 -0
- package/lib/storage/datablob.ts +36 -0
- package/lib/storage/env.ts +14 -0
- package/lib/storage/splitsblob.ts +63 -0
- package/lib/storage/storage.ts +604 -0
- package/lib/storages3/all.ts +1 -0
- package/lib/storages3/s3.ts +576 -0
- package/package.json +5 -17
- package/dist/geo/all.d.ts +0 -2
- package/dist/geo/geo.d.ts +0 -67
- package/dist/geo/vfeature.d.ts +0 -4
- package/docs/filterexpr.md +0 -22
- package/lib/geo/all.ts +0 -2
- package/lib/geo/geo.ts +0 -452
- package/lib/geo/vfeature.ts +0 -34
package/dist/baseclient.js
CHANGED
|
@@ -4,63 +4,42 @@
|
|
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
|
5
5
|
define([], factory);
|
|
6
6
|
else if(typeof exports === 'object')
|
|
7
|
-
exports["
|
|
7
|
+
exports["base"] = factory();
|
|
8
8
|
else
|
|
9
|
-
root["
|
|
9
|
+
root["base"] = factory();
|
|
10
10
|
})(global, function() {
|
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
|
12
12
|
/******/ "use strict";
|
|
13
13
|
/******/ var __webpack_modules__ = ({
|
|
14
14
|
|
|
15
|
-
/***/ "./lib/all/
|
|
16
|
-
|
|
17
|
-
!*** ./lib/all/
|
|
18
|
-
|
|
19
|
-
/***/ (
|
|
15
|
+
/***/ "./lib/all/allclient.ts":
|
|
16
|
+
/*!******************************!*\
|
|
17
|
+
!*** ./lib/all/allclient.ts ***!
|
|
18
|
+
\******************************/
|
|
19
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
|
-
if (k2 === undefined) k2 = k;
|
|
24
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
25
|
-
}) : (function(o, m, k, k2) {
|
|
26
|
-
if (k2 === undefined) k2 = k;
|
|
27
|
-
o[k2] = m[k];
|
|
28
|
-
}));
|
|
29
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
30
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
31
|
-
}) : function(o, v) {
|
|
32
|
-
o["default"] = v;
|
|
33
|
-
});
|
|
34
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
35
|
-
if (mod && mod.__esModule) return mod;
|
|
36
|
-
var result = {};
|
|
37
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
38
|
-
__setModuleDefault(result, mod);
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
22
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
42
|
-
exports.
|
|
23
|
+
exports.FilterExpr = exports.OTE = exports.OT = exports.LogClient = exports.LogAbstract = exports.Poly = exports.FSM = exports.Context = exports.Util = void 0;
|
|
43
24
|
// Client and Server
|
|
44
|
-
const Util =
|
|
25
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
45
26
|
exports.Util = Util;
|
|
46
|
-
const Context =
|
|
27
|
+
const Context = __webpack_require__(/*! ../context/all */ "./lib/context/all.ts");
|
|
47
28
|
exports.Context = Context;
|
|
48
|
-
const FSM =
|
|
29
|
+
const FSM = __webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts");
|
|
49
30
|
exports.FSM = FSM;
|
|
50
|
-
const Poly =
|
|
31
|
+
const Poly = __webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts");
|
|
51
32
|
exports.Poly = Poly;
|
|
52
|
-
const LogAbstract =
|
|
33
|
+
const LogAbstract = __webpack_require__(/*! ../logabstract/all */ "./lib/logabstract/all.ts");
|
|
53
34
|
exports.LogAbstract = LogAbstract;
|
|
54
|
-
const LogClient =
|
|
35
|
+
const LogClient = __webpack_require__(/*! ../logclient/all */ "./lib/logclient/all.ts");
|
|
55
36
|
exports.LogClient = LogClient;
|
|
56
|
-
const OT =
|
|
37
|
+
const OT = __webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts");
|
|
57
38
|
exports.OT = OT;
|
|
58
|
-
const OTE =
|
|
39
|
+
const OTE = __webpack_require__(/*! ../ot-editutil/all */ "./lib/ot-editutil/all.ts");
|
|
59
40
|
exports.OTE = OTE;
|
|
60
41
|
const all_1 = __webpack_require__(/*! ../filterexpr/all */ "./lib/filterexpr/all.ts");
|
|
61
42
|
Object.defineProperty(exports, "FilterExpr", ({ enumerable: true, get: function () { return all_1.FilterExpr; } }));
|
|
62
|
-
const G = __importStar(__webpack_require__(/*! ../geo/all */ "./lib/geo/all.ts"));
|
|
63
|
-
exports.G = G;
|
|
64
43
|
|
|
65
44
|
|
|
66
45
|
/***/ }),
|
|
@@ -92,31 +71,12 @@ __exportStar(__webpack_require__(/*! ./context */ "./lib/context/context.ts"), e
|
|
|
92
71
|
/*!********************************!*\
|
|
93
72
|
!*** ./lib/context/context.ts ***!
|
|
94
73
|
\********************************/
|
|
95
|
-
/***/ (
|
|
74
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
96
75
|
|
|
97
76
|
|
|
98
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
99
|
-
if (k2 === undefined) k2 = k;
|
|
100
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
101
|
-
}) : (function(o, m, k, k2) {
|
|
102
|
-
if (k2 === undefined) k2 = k;
|
|
103
|
-
o[k2] = m[k];
|
|
104
|
-
}));
|
|
105
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
106
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
107
|
-
}) : function(o, v) {
|
|
108
|
-
o["default"] = v;
|
|
109
|
-
});
|
|
110
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
111
|
-
if (mod && mod.__esModule) return mod;
|
|
112
|
-
var result = {};
|
|
113
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
114
|
-
__setModuleDefault(result, mod);
|
|
115
|
-
return result;
|
|
116
|
-
};
|
|
117
77
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
118
78
|
exports.create = void 0;
|
|
119
|
-
const Util =
|
|
79
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
120
80
|
class Context {
|
|
121
81
|
constructor() {
|
|
122
82
|
this.values = {};
|
|
@@ -196,31 +156,12 @@ __exportStar(__webpack_require__(/*! ./filterexpr */ "./lib/filterexpr/filterexp
|
|
|
196
156
|
/*!**************************************!*\
|
|
197
157
|
!*** ./lib/filterexpr/filterexpr.ts ***!
|
|
198
158
|
\**************************************/
|
|
199
|
-
/***/ (
|
|
159
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
200
160
|
|
|
201
161
|
|
|
202
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
203
|
-
if (k2 === undefined) k2 = k;
|
|
204
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
205
|
-
}) : (function(o, m, k, k2) {
|
|
206
|
-
if (k2 === undefined) k2 = k;
|
|
207
|
-
o[k2] = m[k];
|
|
208
|
-
}));
|
|
209
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
210
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
211
|
-
}) : function(o, v) {
|
|
212
|
-
o["default"] = v;
|
|
213
|
-
});
|
|
214
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
215
|
-
if (mod && mod.__esModule) return mod;
|
|
216
|
-
var result = {};
|
|
217
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
218
|
-
__setModuleDefault(result, mod);
|
|
219
|
-
return result;
|
|
220
|
-
};
|
|
221
162
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
222
163
|
exports.FilterExpr = void 0;
|
|
223
|
-
const Util =
|
|
164
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
224
165
|
const Space = 32;
|
|
225
166
|
const Tab = 9;
|
|
226
167
|
const Newline = 10;
|
|
@@ -597,40 +538,6 @@ function wordyDate(s) {
|
|
|
597
538
|
// But this is close enough to match what gets displayed by "prettyDate" while also letting selection by month year
|
|
598
539
|
return s;
|
|
599
540
|
}
|
|
600
|
-
function clauseEqual(c1, c2) {
|
|
601
|
-
if (c1 == null && c2 == null)
|
|
602
|
-
return true;
|
|
603
|
-
if (c1 == null || c2 == null)
|
|
604
|
-
return false;
|
|
605
|
-
if (c1.op.tt === c2.op.tt) {
|
|
606
|
-
if (c1.op.tt === TokType.Text)
|
|
607
|
-
return c1.op.text === c2.op.text;
|
|
608
|
-
else
|
|
609
|
-
return clauseEqual(c1.operand1, c2.operand1) && clauseEqual(c1.operand2, c2.operand2);
|
|
610
|
-
}
|
|
611
|
-
else
|
|
612
|
-
return false;
|
|
613
|
-
}
|
|
614
|
-
function containsClause(c, s) {
|
|
615
|
-
if (clauseEqual(c, s))
|
|
616
|
-
return true;
|
|
617
|
-
if (c == null || s == null)
|
|
618
|
-
return false;
|
|
619
|
-
return containsClause(c.operand1, s) || containsClause(c.operand2, s);
|
|
620
|
-
}
|
|
621
|
-
function removeClause(c, s) {
|
|
622
|
-
if (c == null || (c.op.tt === TokType.Text && c.op.tt !== s.op.tt))
|
|
623
|
-
return c;
|
|
624
|
-
else if (clauseEqual(c, s))
|
|
625
|
-
return null;
|
|
626
|
-
else {
|
|
627
|
-
c.operand1 = removeClause(c.operand1, s);
|
|
628
|
-
c.operand2 = removeClause(c.operand2, s);
|
|
629
|
-
if ((c.op.tt === TokType.And || c.op.tt === TokType.Or) && (c.operand1 == null || c.operand2 == null))
|
|
630
|
-
return c.operand1 || c.operand2;
|
|
631
|
-
return c;
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
541
|
class FilterExpr {
|
|
635
542
|
constructor(coder, expr) {
|
|
636
543
|
this.lexer = new Lexer(coder);
|
|
@@ -648,38 +555,13 @@ class FilterExpr {
|
|
|
648
555
|
asString() {
|
|
649
556
|
return this.asStringClause(this.parser.clause);
|
|
650
557
|
}
|
|
651
|
-
containsClause(expr) {
|
|
652
|
-
let sub = new FilterExpr(this.lexer.coder, expr);
|
|
653
|
-
return containsClause(this.parser.clause, sub.parser.clause);
|
|
654
|
-
}
|
|
655
|
-
addClause(expr) {
|
|
656
|
-
let sub = new FilterExpr(this.lexer.coder, expr);
|
|
657
|
-
if (!containsClause(this.parser.clause, sub.parser.clause)) {
|
|
658
|
-
if (this.parser.clause)
|
|
659
|
-
this.parser.clauses = [{ op: { tt: TokType.And }, operand1: this.parser.clause, operand2: sub.parser.clause }];
|
|
660
|
-
else
|
|
661
|
-
this.parser.clauses = [sub.parser.clause];
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
removeClause(expr) {
|
|
665
|
-
if (this.containsClause(expr)) {
|
|
666
|
-
let sub = new FilterExpr(this.lexer.coder, expr);
|
|
667
|
-
this.parser.clauses = [removeClause(this.parser.clause, sub.parser.clause)];
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
558
|
asStringClause(clause) {
|
|
671
559
|
if (clause == null)
|
|
672
560
|
return '';
|
|
673
|
-
if (clause.op.tt == TokType.Text)
|
|
674
|
-
|
|
675
|
-
if (this.lexer.tokens.length == 1 && this.lexer.tokens[0].tt === TokType.Text)
|
|
676
|
-
return clause.op.text;
|
|
677
|
-
else
|
|
678
|
-
return `'${clause.op.text}'`;
|
|
679
|
-
}
|
|
561
|
+
if (clause.op.tt == TokType.Text)
|
|
562
|
+
return `'${clause.op.text}'`;
|
|
680
563
|
let a = [];
|
|
681
|
-
|
|
682
|
-
a.push('(');
|
|
564
|
+
a.push('(');
|
|
683
565
|
switch (clause.op.tt) {
|
|
684
566
|
case TokType.And:
|
|
685
567
|
a.push(this.asStringClause(clause.operand1));
|
|
@@ -696,7 +578,8 @@ class FilterExpr {
|
|
|
696
578
|
a.push(this.asStringClause(clause.operand1));
|
|
697
579
|
break;
|
|
698
580
|
case TokType.Colon:
|
|
699
|
-
a.push(
|
|
581
|
+
a.push(this.asStringClause(clause.operand1));
|
|
582
|
+
a.push(':');
|
|
700
583
|
a.push(this.asStringClause(clause.operand2));
|
|
701
584
|
break;
|
|
702
585
|
case TokType.Equal:
|
|
@@ -711,8 +594,7 @@ class FilterExpr {
|
|
|
711
594
|
default:
|
|
712
595
|
throw 'Unexpected token in asString';
|
|
713
596
|
}
|
|
714
|
-
|
|
715
|
-
a.push(')');
|
|
597
|
+
a.push(')');
|
|
716
598
|
return a.join(' ');
|
|
717
599
|
}
|
|
718
600
|
testClause(o, types, clause, prop, relation) {
|
|
@@ -804,32 +686,13 @@ __exportStar(__webpack_require__(/*! ./fsm */ "./lib/fsm/fsm.ts"), exports);
|
|
|
804
686
|
/*!************************!*\
|
|
805
687
|
!*** ./lib/fsm/fsm.ts ***!
|
|
806
688
|
\************************/
|
|
807
|
-
/***/ (
|
|
689
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
808
690
|
|
|
809
691
|
|
|
810
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
811
|
-
if (k2 === undefined) k2 = k;
|
|
812
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
813
|
-
}) : (function(o, m, k, k2) {
|
|
814
|
-
if (k2 === undefined) k2 = k;
|
|
815
|
-
o[k2] = m[k];
|
|
816
|
-
}));
|
|
817
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
818
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
819
|
-
}) : function(o, v) {
|
|
820
|
-
o["default"] = v;
|
|
821
|
-
});
|
|
822
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
823
|
-
if (mod && mod.__esModule) return mod;
|
|
824
|
-
var result = {};
|
|
825
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
826
|
-
__setModuleDefault(result, mod);
|
|
827
|
-
return result;
|
|
828
|
-
};
|
|
829
692
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
830
693
|
exports.FsmArray = exports.FsmLoop = exports.DefaultLoopOptions = exports.FsmTracker = exports.FsmSerializer = exports.FsmSleep = exports.FsmOnDone = exports.Fsm = exports.FsmManager = exports.FSM_CUSTOM9 = exports.FSM_CUSTOM8 = exports.FSM_CUSTOM7 = exports.FSM_CUSTOM6 = exports.FSM_CUSTOM5 = exports.FSM_CUSTOM4 = exports.FSM_CUSTOM3 = exports.FSM_CUSTOM2 = exports.FSM_CUSTOM1 = exports.FSM_RELEASED = exports.FSM_ERROR = exports.FSM_DONE = exports.FSM_PENDING = exports.FSM_STARTING = void 0;
|
|
831
694
|
// Shared libraries
|
|
832
|
-
const Util =
|
|
695
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
833
696
|
// States
|
|
834
697
|
exports.FSM_STARTING = 0;
|
|
835
698
|
exports.FSM_PENDING = 1 << 0;
|
|
@@ -1053,17 +916,9 @@ class FsmSleep extends Fsm {
|
|
|
1053
916
|
this.delay = delay;
|
|
1054
917
|
}
|
|
1055
918
|
tick() {
|
|
1056
|
-
|
|
1057
|
-
if (this.done && this.timeoutHandle !== undefined) {
|
|
1058
|
-
clearTimeout(this.timeoutHandle);
|
|
1059
|
-
delete this.timeoutHandle;
|
|
1060
|
-
}
|
|
1061
|
-
else if (this.ready && this.state === exports.FSM_STARTING) {
|
|
919
|
+
if (this.ready && this.state === exports.FSM_STARTING) {
|
|
1062
920
|
this.setState(exports.FSM_PENDING);
|
|
1063
|
-
|
|
1064
|
-
delete this.timeoutHandle;
|
|
1065
|
-
this.setState(exports.FSM_DONE);
|
|
1066
|
-
}, this.delay);
|
|
921
|
+
setTimeout(() => { this.setState(exports.FSM_DONE); }, this.delay);
|
|
1067
922
|
}
|
|
1068
923
|
}
|
|
1069
924
|
}
|
|
@@ -1225,486 +1080,6 @@ class FsmArray extends Fsm {
|
|
|
1225
1080
|
exports.FsmArray = FsmArray;
|
|
1226
1081
|
|
|
1227
1082
|
|
|
1228
|
-
/***/ }),
|
|
1229
|
-
|
|
1230
|
-
/***/ "./lib/geo/all.ts":
|
|
1231
|
-
/*!************************!*\
|
|
1232
|
-
!*** ./lib/geo/all.ts ***!
|
|
1233
|
-
\************************/
|
|
1234
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1238
|
-
if (k2 === undefined) k2 = k;
|
|
1239
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1240
|
-
}) : (function(o, m, k, k2) {
|
|
1241
|
-
if (k2 === undefined) k2 = k;
|
|
1242
|
-
o[k2] = m[k];
|
|
1243
|
-
}));
|
|
1244
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
1245
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1246
|
-
};
|
|
1247
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1248
|
-
__exportStar(__webpack_require__(/*! ./geo */ "./lib/geo/geo.ts"), exports);
|
|
1249
|
-
__exportStar(__webpack_require__(/*! ./vfeature */ "./lib/geo/vfeature.ts"), exports);
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
/***/ }),
|
|
1253
|
-
|
|
1254
|
-
/***/ "./lib/geo/geo.ts":
|
|
1255
|
-
/*!************************!*\
|
|
1256
|
-
!*** ./lib/geo/geo.ts ***!
|
|
1257
|
-
\************************/
|
|
1258
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1262
|
-
if (k2 === undefined) k2 = k;
|
|
1263
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1264
|
-
}) : (function(o, m, k, k2) {
|
|
1265
|
-
if (k2 === undefined) k2 = k;
|
|
1266
|
-
o[k2] = m[k];
|
|
1267
|
-
}));
|
|
1268
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
1269
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1270
|
-
}) : function(o, v) {
|
|
1271
|
-
o["default"] = v;
|
|
1272
|
-
});
|
|
1273
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
1274
|
-
if (mod && mod.__esModule) return mod;
|
|
1275
|
-
var result = {};
|
|
1276
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1277
|
-
__setModuleDefault(result, mod);
|
|
1278
|
-
return result;
|
|
1279
|
-
};
|
|
1280
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1281
|
-
exports.geoIntersect = exports.geoIntersectOptions = exports.GeoMultiCollection = exports.geoMapEqual = exports.geoEqual = exports.geoTopoToCollection = exports.geoCollectionToTopo = exports.geoMapToCollection = exports.geoCollectionToMap = void 0;
|
|
1282
|
-
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
1283
|
-
const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
|
|
1284
|
-
function geoCollectionToMap(col) {
|
|
1285
|
-
if (col == null)
|
|
1286
|
-
return null;
|
|
1287
|
-
let map = {};
|
|
1288
|
-
col.features.forEach((f) => { map[String(f.properties.id)] = f; });
|
|
1289
|
-
return map;
|
|
1290
|
-
}
|
|
1291
|
-
exports.geoCollectionToMap = geoCollectionToMap;
|
|
1292
|
-
function geoMapToCollection(map) {
|
|
1293
|
-
if (map == null || Util.countKeys(map) == 0)
|
|
1294
|
-
return null;
|
|
1295
|
-
let col = { type: 'FeatureCollection', features: [] };
|
|
1296
|
-
Object.keys(map).forEach((geoid) => { col.features.push(map[geoid]); });
|
|
1297
|
-
return col;
|
|
1298
|
-
}
|
|
1299
|
-
exports.geoMapToCollection = geoMapToCollection;
|
|
1300
|
-
function geoCollectionToTopo(col) {
|
|
1301
|
-
let topo = Poly.topoFromCollection(col);
|
|
1302
|
-
Poly.topoPack(topo);
|
|
1303
|
-
return topo;
|
|
1304
|
-
}
|
|
1305
|
-
exports.geoCollectionToTopo = geoCollectionToTopo;
|
|
1306
|
-
function geoTopoToCollection(topo) {
|
|
1307
|
-
let col = Poly.topoToCollection(topo);
|
|
1308
|
-
Poly.featurePack(col);
|
|
1309
|
-
return col;
|
|
1310
|
-
}
|
|
1311
|
-
exports.geoTopoToCollection = geoTopoToCollection;
|
|
1312
|
-
function geoEqual(m1, m2) {
|
|
1313
|
-
let n1 = m1 ? m1.length : 0;
|
|
1314
|
-
let n2 = m2 ? m2.length : 0;
|
|
1315
|
-
if (n1 != n2)
|
|
1316
|
-
return false;
|
|
1317
|
-
if (n1 == 0)
|
|
1318
|
-
return true;
|
|
1319
|
-
let n = 0;
|
|
1320
|
-
let eq = true;
|
|
1321
|
-
m1.forEach(f => { if (eq && !m2.find(f.properties.id))
|
|
1322
|
-
eq = false; });
|
|
1323
|
-
return eq;
|
|
1324
|
-
}
|
|
1325
|
-
exports.geoEqual = geoEqual;
|
|
1326
|
-
function geoMapEqual(m1, m2) {
|
|
1327
|
-
if (m1 == null)
|
|
1328
|
-
return Util.isEmpty(m2);
|
|
1329
|
-
if (m2 == null)
|
|
1330
|
-
return Util.isEmpty(m1);
|
|
1331
|
-
let p;
|
|
1332
|
-
for (p in m1)
|
|
1333
|
-
if (m1.hasOwnProperty(p))
|
|
1334
|
-
if (m1[p] !== m2[p])
|
|
1335
|
-
return false;
|
|
1336
|
-
for (p in m2)
|
|
1337
|
-
if (m2.hasOwnProperty(p))
|
|
1338
|
-
if (m1[p] === undefined)
|
|
1339
|
-
return false;
|
|
1340
|
-
return true;
|
|
1341
|
-
}
|
|
1342
|
-
exports.geoMapEqual = geoMapEqual;
|
|
1343
|
-
class GeoMultiCollection {
|
|
1344
|
-
constructor(tag, topo, col, map) {
|
|
1345
|
-
this.stamp = Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER / 2);
|
|
1346
|
-
this.empty();
|
|
1347
|
-
if (tag)
|
|
1348
|
-
this.add(tag, topo, col, map);
|
|
1349
|
-
}
|
|
1350
|
-
empty() {
|
|
1351
|
-
this.entries = {};
|
|
1352
|
-
this.hidden = {};
|
|
1353
|
-
this._onChange();
|
|
1354
|
-
}
|
|
1355
|
-
get nEntries() { return Util.countKeys(this.entries); }
|
|
1356
|
-
nthEntry(n) {
|
|
1357
|
-
return Util.nthProperty(this.entries, n);
|
|
1358
|
-
}
|
|
1359
|
-
add(tag, topo, col, map) {
|
|
1360
|
-
let entry = this.entries[tag];
|
|
1361
|
-
if (entry === undefined)
|
|
1362
|
-
entry = { tag: tag }, this.entries[tag] = entry;
|
|
1363
|
-
if ((topo && entry.topo !== topo) || (col && entry.col !== col) || (map && entry.map !== map)) {
|
|
1364
|
-
entry.topo = topo;
|
|
1365
|
-
entry.col = col;
|
|
1366
|
-
entry.map = map;
|
|
1367
|
-
this._onChange();
|
|
1368
|
-
}
|
|
1369
|
-
else if (topo == null && col == null && map == null)
|
|
1370
|
-
this.remove(tag);
|
|
1371
|
-
}
|
|
1372
|
-
addMulti(multi) {
|
|
1373
|
-
multi.forEachEntry(e => {
|
|
1374
|
-
this.add(e.tag, e.topo, e.col, e.map);
|
|
1375
|
-
});
|
|
1376
|
-
for (let p in multi.hidden)
|
|
1377
|
-
if (multi.hidden.hasOwnProperty(p)) {
|
|
1378
|
-
this.hidden[p] = true;
|
|
1379
|
-
this._onChange();
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
remove(tag) {
|
|
1383
|
-
let entry = this.entries[tag];
|
|
1384
|
-
if (entry) {
|
|
1385
|
-
if (entry.topo || entry.col || entry.map)
|
|
1386
|
-
this._onChange();
|
|
1387
|
-
delete this.entries[tag];
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
_onChange() {
|
|
1391
|
-
this.all = { tag: 'all' };
|
|
1392
|
-
this.stamp++;
|
|
1393
|
-
}
|
|
1394
|
-
_col(e) {
|
|
1395
|
-
if (e == null)
|
|
1396
|
-
return null;
|
|
1397
|
-
if (!e.col) {
|
|
1398
|
-
if (e.map)
|
|
1399
|
-
e.col = geoMapToCollection(e.map);
|
|
1400
|
-
else if (e.topo)
|
|
1401
|
-
e.col = geoTopoToCollection(e.topo);
|
|
1402
|
-
}
|
|
1403
|
-
return e.col;
|
|
1404
|
-
}
|
|
1405
|
-
_map(e) {
|
|
1406
|
-
if (e == null)
|
|
1407
|
-
return null;
|
|
1408
|
-
if (!e.map) {
|
|
1409
|
-
if (e.col)
|
|
1410
|
-
e.map = geoCollectionToMap(e.col);
|
|
1411
|
-
else if (e.topo) {
|
|
1412
|
-
e.col = geoTopoToCollection(e.topo);
|
|
1413
|
-
e.map = geoCollectionToMap(e.col);
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
return e.map;
|
|
1417
|
-
}
|
|
1418
|
-
_topo(e) {
|
|
1419
|
-
if (e == null)
|
|
1420
|
-
return null;
|
|
1421
|
-
if (!e.topo) {
|
|
1422
|
-
if (e.col)
|
|
1423
|
-
e.topo = geoCollectionToTopo(e.col);
|
|
1424
|
-
else if (e.map) {
|
|
1425
|
-
e.col = geoMapToCollection(e.map);
|
|
1426
|
-
e.topo = geoCollectionToTopo(e.col);
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
return e.topo;
|
|
1430
|
-
}
|
|
1431
|
-
colOf(tag) { return this._col(this.entries[tag]); }
|
|
1432
|
-
mapOf(tag) { return this._map(this.entries[tag]); }
|
|
1433
|
-
topoOf(tag) { return this._topo(this.entries[tag]); }
|
|
1434
|
-
forEachEntry(cb) {
|
|
1435
|
-
Object.values(this.entries).forEach(cb);
|
|
1436
|
-
}
|
|
1437
|
-
allCol() {
|
|
1438
|
-
if (this.nEntries == 0)
|
|
1439
|
-
return null;
|
|
1440
|
-
if (!this.all.col) {
|
|
1441
|
-
// optimise case where one entry
|
|
1442
|
-
let n = this.nEntries;
|
|
1443
|
-
if (n == 1)
|
|
1444
|
-
this.all.col = this._col(this.nthEntry(0));
|
|
1445
|
-
else
|
|
1446
|
-
// Going from map to collection guarantees that any duplicates are removed
|
|
1447
|
-
this.all.col = geoMapToCollection(this.allMap());
|
|
1448
|
-
}
|
|
1449
|
-
return this.all.col;
|
|
1450
|
-
}
|
|
1451
|
-
allMap() {
|
|
1452
|
-
if (this.nEntries == 0)
|
|
1453
|
-
return null;
|
|
1454
|
-
if (!this.all.map) {
|
|
1455
|
-
// optimise case where one entry
|
|
1456
|
-
let n = this.nEntries;
|
|
1457
|
-
if (n == 1)
|
|
1458
|
-
this.all.map = this._map(this.nthEntry(0));
|
|
1459
|
-
else {
|
|
1460
|
-
let map = {};
|
|
1461
|
-
this.all.map = map;
|
|
1462
|
-
this.forEach(f => { map[String(f.properties.id)] = f; });
|
|
1463
|
-
}
|
|
1464
|
-
}
|
|
1465
|
-
return this.all.map;
|
|
1466
|
-
}
|
|
1467
|
-
allTopo() {
|
|
1468
|
-
if (this.nEntries == 0)
|
|
1469
|
-
return null;
|
|
1470
|
-
if (!this.all.topo) {
|
|
1471
|
-
// optimise case where one entry
|
|
1472
|
-
let n = this.nEntries;
|
|
1473
|
-
if (n == 1)
|
|
1474
|
-
this.all.topo = this._topo(this.nthEntry(0));
|
|
1475
|
-
else
|
|
1476
|
-
this.all.topo = geoCollectionToTopo(this.allCol());
|
|
1477
|
-
}
|
|
1478
|
-
return this.all.topo;
|
|
1479
|
-
}
|
|
1480
|
-
hide(id) {
|
|
1481
|
-
if (id) {
|
|
1482
|
-
if (typeof id === 'string')
|
|
1483
|
-
this.hidden[id] = true;
|
|
1484
|
-
else if (Array.isArray(id))
|
|
1485
|
-
id.forEach((i) => { this.hidden[i] = true; });
|
|
1486
|
-
else if (typeof id === 'object')
|
|
1487
|
-
for (let p in id)
|
|
1488
|
-
if (id.hasOwnProperty(p))
|
|
1489
|
-
this.hidden[p] = true;
|
|
1490
|
-
this._onChange();
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1493
|
-
show(id) {
|
|
1494
|
-
if (id) {
|
|
1495
|
-
if (typeof id === 'string')
|
|
1496
|
-
delete this.hidden[id];
|
|
1497
|
-
else if (Array.isArray(id))
|
|
1498
|
-
id.forEach((i) => { delete this.hidden[i]; });
|
|
1499
|
-
else if (typeof id === 'object')
|
|
1500
|
-
for (let p in id)
|
|
1501
|
-
if (id.hasOwnProperty(p))
|
|
1502
|
-
delete this.hidden[p];
|
|
1503
|
-
this._onChange();
|
|
1504
|
-
}
|
|
1505
|
-
}
|
|
1506
|
-
showAll() {
|
|
1507
|
-
if (!Util.isEmpty(this.hidden)) {
|
|
1508
|
-
this.hidden = {};
|
|
1509
|
-
this._onChange();
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
|
-
get length() {
|
|
1513
|
-
let n = 0;
|
|
1514
|
-
this.forEachEntry(e => {
|
|
1515
|
-
if (e.col)
|
|
1516
|
-
n += e.col.features.length;
|
|
1517
|
-
else if (e.map)
|
|
1518
|
-
n += Util.countKeys(e.map);
|
|
1519
|
-
else if (e.topo)
|
|
1520
|
-
n += Util.countKeys(e.topo.objects);
|
|
1521
|
-
});
|
|
1522
|
-
return n;
|
|
1523
|
-
}
|
|
1524
|
-
// Use forEach in preference to iteration using this function
|
|
1525
|
-
nthFeature(n) {
|
|
1526
|
-
let found;
|
|
1527
|
-
if (n >= 0)
|
|
1528
|
-
this.forEachEntry(e => {
|
|
1529
|
-
if (found)
|
|
1530
|
-
return;
|
|
1531
|
-
let col = this._col(e);
|
|
1532
|
-
if (col)
|
|
1533
|
-
if (n > col.features.length)
|
|
1534
|
-
n -= col.features.length;
|
|
1535
|
-
else
|
|
1536
|
-
found = col.features[n];
|
|
1537
|
-
});
|
|
1538
|
-
return found;
|
|
1539
|
-
}
|
|
1540
|
-
nthFilteredFeature(n, cb) {
|
|
1541
|
-
let found;
|
|
1542
|
-
this.forEachEntry(e => {
|
|
1543
|
-
if (found)
|
|
1544
|
-
return;
|
|
1545
|
-
let col = this._col(e);
|
|
1546
|
-
if (col)
|
|
1547
|
-
for (let i = 0; !found && i < col.features.length; i++) {
|
|
1548
|
-
let f = col.features[i];
|
|
1549
|
-
if (this.hidden[f.properties.id] === undefined && cb(f)) {
|
|
1550
|
-
if (n === 0) {
|
|
1551
|
-
found = f;
|
|
1552
|
-
break;
|
|
1553
|
-
}
|
|
1554
|
-
n--;
|
|
1555
|
-
}
|
|
1556
|
-
}
|
|
1557
|
-
});
|
|
1558
|
-
return found;
|
|
1559
|
-
}
|
|
1560
|
-
forEach(cb) {
|
|
1561
|
-
this.forEachEntry(e => {
|
|
1562
|
-
let col = this._col(e);
|
|
1563
|
-
if (e.col)
|
|
1564
|
-
e.col.features.forEach(f => { if (this.hidden[f.properties.id] === undefined)
|
|
1565
|
-
cb(f); });
|
|
1566
|
-
});
|
|
1567
|
-
}
|
|
1568
|
-
map(cb) {
|
|
1569
|
-
let features = [];
|
|
1570
|
-
this.forEach((f) => { features.push(cb(f)); });
|
|
1571
|
-
return features;
|
|
1572
|
-
}
|
|
1573
|
-
isHidden(id) {
|
|
1574
|
-
return this.hidden[id] !== undefined;
|
|
1575
|
-
}
|
|
1576
|
-
find(id) {
|
|
1577
|
-
if (this.hidden[id] !== undefined)
|
|
1578
|
-
return undefined;
|
|
1579
|
-
let entries = Object.values(this.entries);
|
|
1580
|
-
for (let i = 0; i < entries.length; i++) {
|
|
1581
|
-
let map = this._map(entries[i]);
|
|
1582
|
-
if (map[id])
|
|
1583
|
-
return map[id];
|
|
1584
|
-
}
|
|
1585
|
-
return undefined;
|
|
1586
|
-
}
|
|
1587
|
-
filter(test) {
|
|
1588
|
-
let m = new GeoMultiCollection();
|
|
1589
|
-
this.forEachEntry(e => {
|
|
1590
|
-
let col = this._col(e);
|
|
1591
|
-
let features = col ? col.features.filter(test) : null;
|
|
1592
|
-
if (features && features.length)
|
|
1593
|
-
m.add(e.tag, null, { type: 'FeatureCollection', features: features }, null);
|
|
1594
|
-
});
|
|
1595
|
-
return m;
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1598
|
-
exports.GeoMultiCollection = GeoMultiCollection;
|
|
1599
|
-
var geoIntersectOptions;
|
|
1600
|
-
(function (geoIntersectOptions) {
|
|
1601
|
-
geoIntersectOptions[geoIntersectOptions["Intersects"] = 0] = "Intersects";
|
|
1602
|
-
geoIntersectOptions[geoIntersectOptions["Bounds"] = 1] = "Bounds";
|
|
1603
|
-
geoIntersectOptions[geoIntersectOptions["BoundsCenter"] = 2] = "BoundsCenter";
|
|
1604
|
-
})(geoIntersectOptions = exports.geoIntersectOptions || (exports.geoIntersectOptions = {}));
|
|
1605
|
-
;
|
|
1606
|
-
function geoBoxIntersect(x1, x2, opt) {
|
|
1607
|
-
if (x1.left === undefined || x2.left === undefined)
|
|
1608
|
-
return false;
|
|
1609
|
-
let l1 = x1.left;
|
|
1610
|
-
let l2 = x2.left;
|
|
1611
|
-
let r1 = x1.right;
|
|
1612
|
-
let r2 = x2.right;
|
|
1613
|
-
let b1 = x1.top; // flip
|
|
1614
|
-
let b2 = x2.top; // flip
|
|
1615
|
-
let t1 = x1.bottom; // flip
|
|
1616
|
-
let t2 = x2.bottom; // flip
|
|
1617
|
-
let cx2 = l2 + (r2 - l2) / 2;
|
|
1618
|
-
let cy2 = t2 + (b2 - t2) / 2;
|
|
1619
|
-
// Note I flipped top and bottom above when extracting,
|
|
1620
|
-
// in order to make below logic work for normal y axis alignment (0 at top).
|
|
1621
|
-
switch (opt) {
|
|
1622
|
-
case geoIntersectOptions.Intersects:
|
|
1623
|
-
return !(l2 > r1 || r2 < l1 || t2 > b1 || b2 < t1);
|
|
1624
|
-
case geoIntersectOptions.Bounds:
|
|
1625
|
-
return l1 <= l2 && t1 <= t2 && r1 >= r2 && b1 >= b2;
|
|
1626
|
-
case geoIntersectOptions.BoundsCenter:
|
|
1627
|
-
return l1 <= cx2 && t1 <= cy2 && r1 >= cx2 && b1 >= cy2;
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
function geoIntersect(multi, bbox, opt) {
|
|
1631
|
-
let m = {};
|
|
1632
|
-
let bboxPoly = Poly.boundboxPoly(bbox);
|
|
1633
|
-
multi.forEach((f) => {
|
|
1634
|
-
let box = Poly.boundbox(f);
|
|
1635
|
-
if (geoBoxIntersect(bbox, box, opt)) {
|
|
1636
|
-
if (opt !== geoIntersectOptions.Intersects || Poly.polyIntersects(bboxPoly, f))
|
|
1637
|
-
m[f.properties.id] = f;
|
|
1638
|
-
}
|
|
1639
|
-
});
|
|
1640
|
-
let result = new GeoMultiCollection();
|
|
1641
|
-
result.add('result', null, null, m);
|
|
1642
|
-
return result;
|
|
1643
|
-
}
|
|
1644
|
-
exports.geoIntersect = geoIntersect;
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
/***/ }),
|
|
1648
|
-
|
|
1649
|
-
/***/ "./lib/geo/vfeature.ts":
|
|
1650
|
-
/*!*****************************!*\
|
|
1651
|
-
!*** ./lib/geo/vfeature.ts ***!
|
|
1652
|
-
\*****************************/
|
|
1653
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1657
|
-
if (k2 === undefined) k2 = k;
|
|
1658
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1659
|
-
}) : (function(o, m, k, k2) {
|
|
1660
|
-
if (k2 === undefined) k2 = k;
|
|
1661
|
-
o[k2] = m[k];
|
|
1662
|
-
}));
|
|
1663
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
1664
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1665
|
-
}) : function(o, v) {
|
|
1666
|
-
o["default"] = v;
|
|
1667
|
-
});
|
|
1668
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
1669
|
-
if (mod && mod.__esModule) return mod;
|
|
1670
|
-
var result = {};
|
|
1671
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1672
|
-
__setModuleDefault(result, mod);
|
|
1673
|
-
return result;
|
|
1674
|
-
};
|
|
1675
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1676
|
-
exports.computeVFeature = void 0;
|
|
1677
|
-
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
1678
|
-
const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
|
|
1679
|
-
// Given the topology for a precinct, the bintrie mapping and the list of blocks, construct the
|
|
1680
|
-
// feature data for the virtual feature.
|
|
1681
|
-
//
|
|
1682
|
-
function computeVFeature(topoPrecinct, bintrie, blocks) {
|
|
1683
|
-
let contiguity = new Util.IndexedArray();
|
|
1684
|
-
let block_contiguity = new Util.IndexedArray();
|
|
1685
|
-
let f = Poly.topoMerge(topoPrecinct, blocks);
|
|
1686
|
-
f.properties.datasets = {};
|
|
1687
|
-
blocks.forEach(blockid => {
|
|
1688
|
-
let b = topoPrecinct.objects[blockid];
|
|
1689
|
-
if (b.properties.datasets)
|
|
1690
|
-
Util.deepAccum(f.properties.datasets, b.properties.datasets);
|
|
1691
|
-
if (b.properties.contiguity) {
|
|
1692
|
-
b.properties.contiguity.forEach((id) => {
|
|
1693
|
-
contiguity.set(id === 'OUT_OF_STATE' ? id : bintrie.get(id));
|
|
1694
|
-
});
|
|
1695
|
-
b.properties.contiguity.forEach((id) => {
|
|
1696
|
-
block_contiguity.set(id);
|
|
1697
|
-
});
|
|
1698
|
-
}
|
|
1699
|
-
});
|
|
1700
|
-
f.properties.contiguity = contiguity.asArray();
|
|
1701
|
-
f.properties.block_contiguity = block_contiguity.asArray();
|
|
1702
|
-
f.properties.blocks = blocks;
|
|
1703
|
-
return f;
|
|
1704
|
-
}
|
|
1705
|
-
exports.computeVFeature = computeVFeature;
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
1083
|
/***/ }),
|
|
1709
1084
|
|
|
1710
1085
|
/***/ "./lib/logabstract/all.ts":
|
|
@@ -1734,31 +1109,12 @@ __exportStar(__webpack_require__(/*! ./log */ "./lib/logabstract/log.ts"), expor
|
|
|
1734
1109
|
/*!********************************!*\
|
|
1735
1110
|
!*** ./lib/logabstract/log.ts ***!
|
|
1736
1111
|
\********************************/
|
|
1737
|
-
/***/ (
|
|
1112
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1738
1113
|
|
|
1739
1114
|
|
|
1740
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1741
|
-
if (k2 === undefined) k2 = k;
|
|
1742
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1743
|
-
}) : (function(o, m, k, k2) {
|
|
1744
|
-
if (k2 === undefined) k2 = k;
|
|
1745
|
-
o[k2] = m[k];
|
|
1746
|
-
}));
|
|
1747
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
1748
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1749
|
-
}) : function(o, v) {
|
|
1750
|
-
o["default"] = v;
|
|
1751
|
-
});
|
|
1752
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
1753
|
-
if (mod && mod.__esModule) return mod;
|
|
1754
|
-
var result = {};
|
|
1755
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1756
|
-
__setModuleDefault(result, mod);
|
|
1757
|
-
return result;
|
|
1758
|
-
};
|
|
1759
1115
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1760
1116
|
exports.SyncTimer = exports.AsyncTimer = exports.Timer = void 0;
|
|
1761
|
-
const Util =
|
|
1117
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
1762
1118
|
class Timer {
|
|
1763
1119
|
constructor(ilog, kind, o, verbosity = 0) {
|
|
1764
1120
|
this.ilog = ilog;
|
|
@@ -1819,31 +1175,12 @@ __exportStar(__webpack_require__(/*! ./log */ "./lib/logclient/log.ts"), exports
|
|
|
1819
1175
|
/*!******************************!*\
|
|
1820
1176
|
!*** ./lib/logclient/log.ts ***!
|
|
1821
1177
|
\******************************/
|
|
1822
|
-
/***/ (
|
|
1178
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1823
1179
|
|
|
1824
1180
|
|
|
1825
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1826
|
-
if (k2 === undefined) k2 = k;
|
|
1827
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1828
|
-
}) : (function(o, m, k, k2) {
|
|
1829
|
-
if (k2 === undefined) k2 = k;
|
|
1830
|
-
o[k2] = m[k];
|
|
1831
|
-
}));
|
|
1832
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
1833
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1834
|
-
}) : function(o, v) {
|
|
1835
|
-
o["default"] = v;
|
|
1836
|
-
});
|
|
1837
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
1838
|
-
if (mod && mod.__esModule) return mod;
|
|
1839
|
-
var result = {};
|
|
1840
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1841
|
-
__setModuleDefault(result, mod);
|
|
1842
|
-
return result;
|
|
1843
|
-
};
|
|
1844
1181
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1845
1182
|
exports.create = void 0;
|
|
1846
|
-
const Util =
|
|
1183
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
1847
1184
|
class LogManager {
|
|
1848
1185
|
constructor(env) {
|
|
1849
1186
|
this.env = env;
|
|
@@ -1944,32 +1281,13 @@ __exportStar(__webpack_require__(/*! ./otmaputil */ "./lib/ot-editutil/otmaputil
|
|
|
1944
1281
|
/*!***************************************!*\
|
|
1945
1282
|
!*** ./lib/ot-editutil/oteditutil.ts ***!
|
|
1946
1283
|
\***************************************/
|
|
1947
|
-
/***/ (
|
|
1284
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1948
1285
|
|
|
1949
1286
|
|
|
1950
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1951
|
-
if (k2 === undefined) k2 = k;
|
|
1952
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1953
|
-
}) : (function(o, m, k, k2) {
|
|
1954
|
-
if (k2 === undefined) k2 = k;
|
|
1955
|
-
o[k2] = m[k];
|
|
1956
|
-
}));
|
|
1957
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
1958
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1959
|
-
}) : function(o, v) {
|
|
1960
|
-
o["default"] = v;
|
|
1961
|
-
});
|
|
1962
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
1963
|
-
if (mod && mod.__esModule) return mod;
|
|
1964
|
-
var result = {};
|
|
1965
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1966
|
-
__setModuleDefault(result, mod);
|
|
1967
|
-
return result;
|
|
1968
|
-
};
|
|
1969
1287
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1970
1288
|
exports.OTEditUtil = void 0;
|
|
1971
|
-
const OT =
|
|
1972
|
-
const DMP =
|
|
1289
|
+
const OT = __webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts");
|
|
1290
|
+
const DMP = __webpack_require__(/*! diff-match-patch */ "diff-match-patch");
|
|
1973
1291
|
let DiffMatchPatch = new DMP.diff_match_patch();
|
|
1974
1292
|
let DIFF_DELETE = DMP.DIFF_DELETE;
|
|
1975
1293
|
let DIFF_INSERT = DMP.DIFF_INSERT;
|
|
@@ -2129,32 +1447,13 @@ exports.OTEditUtil = OTEditUtil;
|
|
|
2129
1447
|
/*!**************************************!*\
|
|
2130
1448
|
!*** ./lib/ot-editutil/otmaputil.ts ***!
|
|
2131
1449
|
\**************************************/
|
|
2132
|
-
/***/ (
|
|
1450
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2133
1451
|
|
|
2134
1452
|
|
|
2135
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2136
|
-
if (k2 === undefined) k2 = k;
|
|
2137
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
2138
|
-
}) : (function(o, m, k, k2) {
|
|
2139
|
-
if (k2 === undefined) k2 = k;
|
|
2140
|
-
o[k2] = m[k];
|
|
2141
|
-
}));
|
|
2142
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
2143
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
2144
|
-
}) : function(o, v) {
|
|
2145
|
-
o["default"] = v;
|
|
2146
|
-
});
|
|
2147
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
2148
|
-
if (mod && mod.__esModule) return mod;
|
|
2149
|
-
var result = {};
|
|
2150
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
2151
|
-
__setModuleDefault(result, mod);
|
|
2152
|
-
return result;
|
|
2153
|
-
};
|
|
2154
1453
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2155
1454
|
exports.Editor = exports.REPLACE = exports.MERGE = void 0;
|
|
2156
|
-
const OT =
|
|
2157
|
-
const Util =
|
|
1455
|
+
const OT = __webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts");
|
|
1456
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
2158
1457
|
exports.MERGE = 0;
|
|
2159
1458
|
exports.REPLACE = 1;
|
|
2160
1459
|
class Editor {
|
|
@@ -2340,38 +1639,19 @@ __exportStar(__webpack_require__(/*! ./otserverengine */ "./lib/ot-js/otserveren
|
|
|
2340
1639
|
__exportStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"), exports);
|
|
2341
1640
|
__exportStar(__webpack_require__(/*! ./otsession */ "./lib/ot-js/otsession.ts"), exports);
|
|
2342
1641
|
|
|
2343
|
-
|
|
2344
|
-
/***/ }),
|
|
2345
|
-
|
|
2346
|
-
/***/ "./lib/ot-js/otarray.ts":
|
|
2347
|
-
/*!******************************!*\
|
|
2348
|
-
!*** ./lib/ot-js/otarray.ts ***!
|
|
2349
|
-
\******************************/
|
|
2350
|
-
/***/ (
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2354
|
-
if (k2 === undefined) k2 = k;
|
|
2355
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
2356
|
-
}) : (function(o, m, k, k2) {
|
|
2357
|
-
if (k2 === undefined) k2 = k;
|
|
2358
|
-
o[k2] = m[k];
|
|
2359
|
-
}));
|
|
2360
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
2361
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
2362
|
-
}) : function(o, v) {
|
|
2363
|
-
o["default"] = v;
|
|
2364
|
-
});
|
|
2365
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
2366
|
-
if (mod && mod.__esModule) return mod;
|
|
2367
|
-
var result = {};
|
|
2368
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
2369
|
-
__setModuleDefault(result, mod);
|
|
2370
|
-
return result;
|
|
2371
|
-
};
|
|
1642
|
+
|
|
1643
|
+
/***/ }),
|
|
1644
|
+
|
|
1645
|
+
/***/ "./lib/ot-js/otarray.ts":
|
|
1646
|
+
/*!******************************!*\
|
|
1647
|
+
!*** ./lib/ot-js/otarray.ts ***!
|
|
1648
|
+
\******************************/
|
|
1649
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1650
|
+
|
|
1651
|
+
|
|
2372
1652
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2373
1653
|
exports.OTArrayResource = exports.OTStringResource = exports.OTArrayLikeResource = exports.OTArrayOperations = exports.OTStringOperations = exports.OTSingleArrayEditor = exports.OpTmpRetain = exports.OpSet = exports.OpCursor = exports.OpRetain = exports.OpDelete = exports.OpInsert = void 0;
|
|
2374
|
-
const OT =
|
|
1654
|
+
const OT = __webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts");
|
|
2375
1655
|
const TestUnitSize = 4;
|
|
2376
1656
|
let TestCounter = 0;
|
|
2377
1657
|
// Array Ops
|
|
@@ -3303,32 +2583,13 @@ function counterValue(ops, c) {
|
|
|
3303
2583
|
/*!*************************************!*\
|
|
3304
2584
|
!*** ./lib/ot-js/otclientengine.ts ***!
|
|
3305
2585
|
\*************************************/
|
|
3306
|
-
/***/ (
|
|
2586
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3307
2587
|
|
|
3308
2588
|
|
|
3309
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3310
|
-
if (k2 === undefined) k2 = k;
|
|
3311
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
3312
|
-
}) : (function(o, m, k, k2) {
|
|
3313
|
-
if (k2 === undefined) k2 = k;
|
|
3314
|
-
o[k2] = m[k];
|
|
3315
|
-
}));
|
|
3316
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
3317
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3318
|
-
}) : function(o, v) {
|
|
3319
|
-
o["default"] = v;
|
|
3320
|
-
});
|
|
3321
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3322
|
-
if (mod && mod.__esModule) return mod;
|
|
3323
|
-
var result = {};
|
|
3324
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
3325
|
-
__setModuleDefault(result, mod);
|
|
3326
|
-
return result;
|
|
3327
|
-
};
|
|
3328
2589
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3329
2590
|
exports.OTClientEngine = void 0;
|
|
3330
|
-
const OTC =
|
|
3331
|
-
const OTE =
|
|
2591
|
+
const OTC = __webpack_require__(/*! ./otcomposite */ "./lib/ot-js/otcomposite.ts");
|
|
2592
|
+
const OTE = __webpack_require__(/*! ./otengine */ "./lib/ot-js/otengine.ts");
|
|
3332
2593
|
class OTClientEngine extends OTE.OTEngine {
|
|
3333
2594
|
// Constructor
|
|
3334
2595
|
constructor(ilog, rid, cid) {
|
|
@@ -3572,34 +2833,15 @@ exports.OTClientEngine = OTClientEngine;
|
|
|
3572
2833
|
/*!**********************************!*\
|
|
3573
2834
|
!*** ./lib/ot-js/otcomposite.ts ***!
|
|
3574
2835
|
\**********************************/
|
|
3575
|
-
/***/ (
|
|
2836
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3576
2837
|
|
|
3577
2838
|
|
|
3578
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3579
|
-
if (k2 === undefined) k2 = k;
|
|
3580
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
3581
|
-
}) : (function(o, m, k, k2) {
|
|
3582
|
-
if (k2 === undefined) k2 = k;
|
|
3583
|
-
o[k2] = m[k];
|
|
3584
|
-
}));
|
|
3585
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
3586
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3587
|
-
}) : function(o, v) {
|
|
3588
|
-
o["default"] = v;
|
|
3589
|
-
});
|
|
3590
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3591
|
-
if (mod && mod.__esModule) return mod;
|
|
3592
|
-
var result = {};
|
|
3593
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
3594
|
-
__setModuleDefault(result, mod);
|
|
3595
|
-
return result;
|
|
3596
|
-
};
|
|
3597
2839
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3598
2840
|
exports.OTCompositeResource = exports.clockSeenValue = exports.clockUndoValue = exports.clockInitializeValue = exports.clockFailureValue = exports.clockRandomizeValue = exports.clockTerminateValue = exports.clockInitialValue = void 0;
|
|
3599
|
-
const OT =
|
|
3600
|
-
const OTA =
|
|
3601
|
-
const OTM =
|
|
3602
|
-
const OTC =
|
|
2841
|
+
const OT = __webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts");
|
|
2842
|
+
const OTA = __webpack_require__(/*! ./otarray */ "./lib/ot-js/otarray.ts");
|
|
2843
|
+
const OTM = __webpack_require__(/*! ./otmap */ "./lib/ot-js/otmap.ts");
|
|
2844
|
+
const OTC = __webpack_require__(/*! ./otcounter */ "./lib/ot-js/otcounter.ts");
|
|
3603
2845
|
exports.clockInitialValue = -1; // Initial value
|
|
3604
2846
|
exports.clockTerminateValue = -2; // Terminal action from client.
|
|
3605
2847
|
exports.clockRandomizeValue = -3; // Fill in with random data.
|
|
@@ -3790,31 +3032,12 @@ exports.OTCompositeResource = OTCompositeResource;
|
|
|
3790
3032
|
/*!********************************!*\
|
|
3791
3033
|
!*** ./lib/ot-js/otcounter.ts ***!
|
|
3792
3034
|
\********************************/
|
|
3793
|
-
/***/ (
|
|
3035
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3794
3036
|
|
|
3795
3037
|
|
|
3796
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3797
|
-
if (k2 === undefined) k2 = k;
|
|
3798
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
3799
|
-
}) : (function(o, m, k, k2) {
|
|
3800
|
-
if (k2 === undefined) k2 = k;
|
|
3801
|
-
o[k2] = m[k];
|
|
3802
|
-
}));
|
|
3803
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
3804
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3805
|
-
}) : function(o, v) {
|
|
3806
|
-
o["default"] = v;
|
|
3807
|
-
});
|
|
3808
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3809
|
-
if (mod && mod.__esModule) return mod;
|
|
3810
|
-
var result = {};
|
|
3811
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
3812
|
-
__setModuleDefault(result, mod);
|
|
3813
|
-
return result;
|
|
3814
|
-
};
|
|
3815
3038
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3816
3039
|
exports.OTCounterResource = exports.OpCounterDel = exports.OpCounterAdd = void 0;
|
|
3817
|
-
const OT =
|
|
3040
|
+
const OT = __webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts");
|
|
3818
3041
|
// This implements OT for a simple map of counters. Instead of a new value replacing the
|
|
3819
3042
|
// keyed value, values are added together. This allows a simple accumulating counter.
|
|
3820
3043
|
// Possible future additions:
|
|
@@ -3984,32 +3207,13 @@ exports.OTEngine = OTEngine;
|
|
|
3984
3207
|
/*!****************************!*\
|
|
3985
3208
|
!*** ./lib/ot-js/otmap.ts ***!
|
|
3986
3209
|
\****************************/
|
|
3987
|
-
/***/ (
|
|
3210
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3988
3211
|
|
|
3989
3212
|
|
|
3990
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3991
|
-
if (k2 === undefined) k2 = k;
|
|
3992
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
3993
|
-
}) : (function(o, m, k, k2) {
|
|
3994
|
-
if (k2 === undefined) k2 = k;
|
|
3995
|
-
o[k2] = m[k];
|
|
3996
|
-
}));
|
|
3997
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
3998
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3999
|
-
}) : function(o, v) {
|
|
4000
|
-
o["default"] = v;
|
|
4001
|
-
});
|
|
4002
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
4003
|
-
if (mod && mod.__esModule) return mod;
|
|
4004
|
-
var result = {};
|
|
4005
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4006
|
-
__setModuleDefault(result, mod);
|
|
4007
|
-
return result;
|
|
4008
|
-
};
|
|
4009
3213
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4010
3214
|
exports.OTMapResource = exports.OpMapDel = exports.OpMapSet = void 0;
|
|
4011
|
-
const Util =
|
|
4012
|
-
const OT =
|
|
3215
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
3216
|
+
const OT = __webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts");
|
|
4013
3217
|
// This implements OT for a dictionary of objects. OT is pretty trivial for maps - last wins.
|
|
4014
3218
|
exports.OpMapSet = 1;
|
|
4015
3219
|
exports.OpMapDel = 2;
|
|
@@ -4123,33 +3327,14 @@ exports.OTMapResource = OTMapResource;
|
|
|
4123
3327
|
/*!*************************************!*\
|
|
4124
3328
|
!*** ./lib/ot-js/otserverengine.ts ***!
|
|
4125
3329
|
\*************************************/
|
|
4126
|
-
/***/ (
|
|
3330
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4127
3331
|
|
|
4128
3332
|
|
|
4129
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4130
|
-
if (k2 === undefined) k2 = k;
|
|
4131
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
4132
|
-
}) : (function(o, m, k, k2) {
|
|
4133
|
-
if (k2 === undefined) k2 = k;
|
|
4134
|
-
o[k2] = m[k];
|
|
4135
|
-
}));
|
|
4136
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
4137
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
4138
|
-
}) : function(o, v) {
|
|
4139
|
-
o["default"] = v;
|
|
4140
|
-
});
|
|
4141
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
4142
|
-
if (mod && mod.__esModule) return mod;
|
|
4143
|
-
var result = {};
|
|
4144
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4145
|
-
__setModuleDefault(result, mod);
|
|
4146
|
-
return result;
|
|
4147
|
-
};
|
|
4148
3333
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4149
3334
|
exports.OTServerEngine = exports.ClientIDForServer = void 0;
|
|
4150
|
-
const OTC =
|
|
4151
|
-
const OTS =
|
|
4152
|
-
const OTE =
|
|
3335
|
+
const OTC = __webpack_require__(/*! ./otcomposite */ "./lib/ot-js/otcomposite.ts");
|
|
3336
|
+
const OTS = __webpack_require__(/*! ./otsession */ "./lib/ot-js/otsession.ts");
|
|
3337
|
+
const OTE = __webpack_require__(/*! ./otengine */ "./lib/ot-js/otengine.ts");
|
|
4153
3338
|
exports.ClientIDForServer = '-Server-';
|
|
4154
3339
|
class OTServerEngine extends OTE.OTEngine {
|
|
4155
3340
|
// Constructor
|
|
@@ -4387,7 +3572,7 @@ exports.OTServerEngine = OTServerEngine;
|
|
|
4387
3572
|
|
|
4388
3573
|
|
|
4389
3574
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4390
|
-
exports.SessionFilterFunction = exports.accessMapFindUser = exports.accessFindUser = exports.ServerStateMaintenance = exports.ServerStateRunning = exports.PermAll = exports.PermEdit = exports.PermAdmin = exports.PermOwner = exports.PermWrite = exports.PermRead = exports.PermNone = exports.FilterCount = exports.
|
|
3575
|
+
exports.SessionFilterFunction = exports.accessMapFindUser = exports.accessFindUser = exports.ServerStateMaintenance = exports.ServerStateRunning = exports.PermAll = exports.PermEdit = exports.PermAdmin = exports.PermOwner = exports.PermWrite = exports.PermRead = exports.PermNone = exports.FilterCount = exports.FilterOfficial = exports.FilterPublic = exports.FilterTrash = exports.FilterRecent = exports.FilterMyPublic = exports.FilterSharedWithMe = exports.FilterMyMaps = exports.EClockAnomaly = exports.EMaintenance = exports.ENoAccess = exports.ENoPerm = exports.ELoadFailed = exports.EBadRequest = exports.ENoUser = exports.EClockReset = exports.EClockFailure = exports.EClockSeen = exports.ENoSession = exports.ERetry = exports.EFull = exports.EFail = exports.ESuccess = void 0;
|
|
4391
3576
|
// Errors
|
|
4392
3577
|
exports.ESuccess = 0; // Generic success
|
|
4393
3578
|
exports.EFail = 1; // Generic failure
|
|
@@ -4412,8 +3597,7 @@ exports.FilterRecent = 3;
|
|
|
4412
3597
|
exports.FilterTrash = 4;
|
|
4413
3598
|
exports.FilterPublic = 5;
|
|
4414
3599
|
exports.FilterOfficial = 6;
|
|
4415
|
-
exports.
|
|
4416
|
-
exports.FilterCount = 8;
|
|
3600
|
+
exports.FilterCount = 7;
|
|
4417
3601
|
// Permissions
|
|
4418
3602
|
exports.PermNone = 0; // No permissions
|
|
4419
3603
|
exports.PermRead = 1; // Can view
|
|
@@ -4581,32 +3765,13 @@ __exportStar(__webpack_require__(/*! ./shamos */ "./lib/poly/shamos.ts"), export
|
|
|
4581
3765
|
/*!***************************!*\
|
|
4582
3766
|
!*** ./lib/poly/blend.ts ***!
|
|
4583
3767
|
\***************************/
|
|
4584
|
-
/***/ (
|
|
3768
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4585
3769
|
|
|
4586
3770
|
|
|
4587
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4588
|
-
if (k2 === undefined) k2 = k;
|
|
4589
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
4590
|
-
}) : (function(o, m, k, k2) {
|
|
4591
|
-
if (k2 === undefined) k2 = k;
|
|
4592
|
-
o[k2] = m[k];
|
|
4593
|
-
}));
|
|
4594
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
4595
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
4596
|
-
}) : function(o, v) {
|
|
4597
|
-
o["default"] = v;
|
|
4598
|
-
});
|
|
4599
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
4600
|
-
if (mod && mod.__esModule) return mod;
|
|
4601
|
-
var result = {};
|
|
4602
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4603
|
-
__setModuleDefault(result, mod);
|
|
4604
|
-
return result;
|
|
4605
|
-
};
|
|
4606
3771
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4607
3772
|
exports.blend = void 0;
|
|
4608
|
-
const Util =
|
|
4609
|
-
const PP =
|
|
3773
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
3774
|
+
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
4610
3775
|
// Takes array of polygon or multi-polygon coordinate structures and returns a single multi-polygon
|
|
4611
3776
|
// structure. The coordinates may be passed in using packed format.
|
|
4612
3777
|
function blend(polys) {
|
|
@@ -4635,31 +3800,12 @@ exports.blend = blend;
|
|
|
4635
3800
|
/*!******************************!*\
|
|
4636
3801
|
!*** ./lib/poly/boundbox.ts ***!
|
|
4637
3802
|
\******************************/
|
|
4638
|
-
/***/ (
|
|
3803
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4639
3804
|
|
|
4640
3805
|
|
|
4641
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4642
|
-
if (k2 === undefined) k2 = k;
|
|
4643
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
4644
|
-
}) : (function(o, m, k, k2) {
|
|
4645
|
-
if (k2 === undefined) k2 = k;
|
|
4646
|
-
o[k2] = m[k];
|
|
4647
|
-
}));
|
|
4648
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
4649
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
4650
|
-
}) : function(o, v) {
|
|
4651
|
-
o["default"] = v;
|
|
4652
|
-
});
|
|
4653
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
4654
|
-
if (mod && mod.__esModule) return mod;
|
|
4655
|
-
var result = {};
|
|
4656
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4657
|
-
__setModuleDefault(result, mod);
|
|
4658
|
-
return result;
|
|
4659
|
-
};
|
|
4660
3806
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4661
3807
|
exports.boundboxIntersects = exports.boundboxArea = exports.boundboxPoly = exports.boundbox = exports.boundboxExtend = exports.clipLon = exports.boundboxCY = exports.boundboxCX = exports.boundboxHeight = exports.boundboxWidth = void 0;
|
|
4662
|
-
const P =
|
|
3808
|
+
const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
4663
3809
|
function boundboxWidth(bb) { return Math.abs(bb.right - bb.left); }
|
|
4664
3810
|
exports.boundboxWidth = boundboxWidth;
|
|
4665
3811
|
function boundboxHeight(bb) { return Math.abs(bb.bottom - bb.top); }
|
|
@@ -4741,35 +3887,16 @@ exports.boundboxIntersects = boundboxIntersects;
|
|
|
4741
3887
|
/*!*******************************!*\
|
|
4742
3888
|
!*** ./lib/poly/cartesian.ts ***!
|
|
4743
3889
|
\*******************************/
|
|
4744
|
-
/***/ (
|
|
3890
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4745
3891
|
|
|
4746
3892
|
|
|
4747
3893
|
//
|
|
4748
3894
|
// GEO-FEATURES UTILITIES
|
|
4749
3895
|
//
|
|
4750
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4751
|
-
if (k2 === undefined) k2 = k;
|
|
4752
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
4753
|
-
}) : (function(o, m, k, k2) {
|
|
4754
|
-
if (k2 === undefined) k2 = k;
|
|
4755
|
-
o[k2] = m[k];
|
|
4756
|
-
}));
|
|
4757
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
4758
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
4759
|
-
}) : function(o, v) {
|
|
4760
|
-
o["default"] = v;
|
|
4761
|
-
});
|
|
4762
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
4763
|
-
if (mod && mod.__esModule) return mod;
|
|
4764
|
-
var result = {};
|
|
4765
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4766
|
-
__setModuleDefault(result, mod);
|
|
4767
|
-
return result;
|
|
4768
|
-
};
|
|
4769
3896
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4770
3897
|
exports.polyDiameterFlat = exports.polyPerimeterFlat = exports.polyAreaFlat = exports.polyParts = void 0;
|
|
4771
|
-
const P =
|
|
4772
|
-
const PP =
|
|
3898
|
+
const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
3899
|
+
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
4773
3900
|
// HELPER
|
|
4774
3901
|
function bufferToRing(b, s, nPoints) {
|
|
4775
3902
|
let r = [];
|
|
@@ -4874,7 +4001,7 @@ exports.polyDiameterFlat = polyDiameterFlat;
|
|
|
4874
4001
|
/*!*********************************!*\
|
|
4875
4002
|
!*** ./lib/poly/graham-scan.ts ***!
|
|
4876
4003
|
\*********************************/
|
|
4877
|
-
/***/ (
|
|
4004
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4878
4005
|
|
|
4879
4006
|
|
|
4880
4007
|
//
|
|
@@ -4885,29 +4012,10 @@ exports.polyDiameterFlat = polyDiameterFlat;
|
|
|
4885
4012
|
* https://www.tutorialspoint.com/Graham-Scan-Algorithm <<< pseudo code
|
|
4886
4013
|
* http://brian3kb.github.io/graham_scan_js/ <<< basis for this implementation
|
|
4887
4014
|
*/
|
|
4888
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4889
|
-
if (k2 === undefined) k2 = k;
|
|
4890
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
4891
|
-
}) : (function(o, m, k, k2) {
|
|
4892
|
-
if (k2 === undefined) k2 = k;
|
|
4893
|
-
o[k2] = m[k];
|
|
4894
|
-
}));
|
|
4895
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
4896
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
4897
|
-
}) : function(o, v) {
|
|
4898
|
-
o["default"] = v;
|
|
4899
|
-
});
|
|
4900
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
4901
|
-
if (mod && mod.__esModule) return mod;
|
|
4902
|
-
var result = {};
|
|
4903
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4904
|
-
__setModuleDefault(result, mod);
|
|
4905
|
-
return result;
|
|
4906
|
-
};
|
|
4907
4015
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4908
4016
|
exports.makeConvexHullGrahamScan = void 0;
|
|
4909
4017
|
const poly_1 = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
4910
|
-
const PP =
|
|
4018
|
+
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
4911
4019
|
function makeConvexHullGrahamScan(poly, options) {
|
|
4912
4020
|
let points = getExteriorPoints(poly);
|
|
4913
4021
|
if (points == null)
|
|
@@ -5446,31 +4554,12 @@ function protect(condition, message) {
|
|
|
5446
4554
|
/*!******************************!*\
|
|
5447
4555
|
!*** ./lib/poly/minbound.ts ***!
|
|
5448
4556
|
\******************************/
|
|
5449
|
-
/***/ (
|
|
4557
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5450
4558
|
|
|
5451
4559
|
|
|
5452
4560
|
//
|
|
5453
4561
|
// MINIMUM BOUNDING RECTANGLE - aka minimum area rectangle -or- smallest enclosing rectangle
|
|
5454
4562
|
//
|
|
5455
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5456
|
-
if (k2 === undefined) k2 = k;
|
|
5457
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5458
|
-
}) : (function(o, m, k, k2) {
|
|
5459
|
-
if (k2 === undefined) k2 = k;
|
|
5460
|
-
o[k2] = m[k];
|
|
5461
|
-
}));
|
|
5462
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
5463
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
5464
|
-
}) : function(o, v) {
|
|
5465
|
-
o["default"] = v;
|
|
5466
|
-
});
|
|
5467
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
5468
|
-
if (mod && mod.__esModule) return mod;
|
|
5469
|
-
var result = {};
|
|
5470
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
5471
|
-
__setModuleDefault(result, mod);
|
|
5472
|
-
return result;
|
|
5473
|
-
};
|
|
5474
4563
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5475
4564
|
exports.minimumBoundingRectangle = void 0;
|
|
5476
4565
|
//
|
|
@@ -5505,7 +4594,7 @@ MBR <- function(p) {
|
|
|
5505
4594
|
// THIS RE-IMPLEMENTS THE R IN TYPESCRIPT, USING CUSTOM MATRIX OPERATIONS
|
|
5506
4595
|
//
|
|
5507
4596
|
const poly_1 = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
5508
|
-
const M =
|
|
4597
|
+
const M = __webpack_require__(/*! ./matrix */ "./lib/poly/matrix.ts");
|
|
5509
4598
|
// For point addressing
|
|
5510
4599
|
const X = 0, Y = 1;
|
|
5511
4600
|
function minimumBoundingRectangle(poly) {
|
|
@@ -5660,32 +4749,13 @@ export function minimumBoundingRectangle(poly: any): any
|
|
|
5660
4749
|
/*!**************************!*\
|
|
5661
4750
|
!*** ./lib/poly/poly.ts ***!
|
|
5662
4751
|
\**************************/
|
|
5663
|
-
/***/ (
|
|
4752
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5664
4753
|
|
|
5665
4754
|
|
|
5666
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5667
|
-
if (k2 === undefined) k2 = k;
|
|
5668
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5669
|
-
}) : (function(o, m, k, k2) {
|
|
5670
|
-
if (k2 === undefined) k2 = k;
|
|
5671
|
-
o[k2] = m[k];
|
|
5672
|
-
}));
|
|
5673
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
5674
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
5675
|
-
}) : function(o, v) {
|
|
5676
|
-
o["default"] = v;
|
|
5677
|
-
});
|
|
5678
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
5679
|
-
if (mod && mod.__esModule) return mod;
|
|
5680
|
-
var result = {};
|
|
5681
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
5682
|
-
__setModuleDefault(result, mod);
|
|
5683
|
-
return result;
|
|
5684
|
-
};
|
|
5685
4755
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5686
4756
|
exports.polyRewindRings = exports.featureRewind = exports.polyTransform = exports.npoints = exports.polyDescribe = exports.polyCompactness = exports.makeConvexHullMonotoneChain2D = exports.polyConvexHull = exports.polyToExteriorPoints = exports.polyFromCircle = exports.polyToPolsbyPopperCircle = exports.polyToCircle = exports.Circle = exports.polyPerimeter = exports.polyDiameter = exports.polyArea = exports.polyNull = exports.polyNormalize = exports.polySimpleArea = exports.DefaultOptions = exports.EARTH_RADIUS = exports.DefaultTickOptions = void 0;
|
|
5687
|
-
const Util =
|
|
5688
|
-
const PP =
|
|
4757
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
4758
|
+
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
5689
4759
|
const graham_scan_1 = __webpack_require__(/*! ./graham-scan */ "./lib/poly/graham-scan.ts");
|
|
5690
4760
|
exports.DefaultTickOptions = { maxLeafCount: 256, maxDepth: 20, tickStep: 1 };
|
|
5691
4761
|
// Internal utilities
|
|
@@ -6295,33 +5365,14 @@ function twoTimesArea(x2, x1, y2, y1) {
|
|
|
6295
5365
|
/*!*****************************!*\
|
|
6296
5366
|
!*** ./lib/poly/polybin.ts ***!
|
|
6297
5367
|
\*****************************/
|
|
6298
|
-
/***/ (
|
|
5368
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6299
5369
|
|
|
6300
5370
|
|
|
6301
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6302
|
-
if (k2 === undefined) k2 = k;
|
|
6303
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
6304
|
-
}) : (function(o, m, k, k2) {
|
|
6305
|
-
if (k2 === undefined) k2 = k;
|
|
6306
|
-
o[k2] = m[k];
|
|
6307
|
-
}));
|
|
6308
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
6309
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
6310
|
-
}) : function(o, v) {
|
|
6311
|
-
o["default"] = v;
|
|
6312
|
-
});
|
|
6313
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
6314
|
-
if (mod && mod.__esModule) return mod;
|
|
6315
|
-
var result = {};
|
|
6316
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
6317
|
-
__setModuleDefault(result, mod);
|
|
6318
|
-
return result;
|
|
6319
|
-
};
|
|
6320
5371
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6321
5372
|
exports.topoFromBuffer = exports.topoToBuffer = exports.unpackCollection = exports.packCollection = void 0;
|
|
6322
|
-
const Util =
|
|
6323
|
-
const PP =
|
|
6324
|
-
const T =
|
|
5373
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
5374
|
+
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
5375
|
+
const T = __webpack_require__(/*! ./topo */ "./lib/poly/topo.ts");
|
|
6325
5376
|
// Packed Buffer format:
|
|
6326
5377
|
//
|
|
6327
5378
|
// (strings are packed as UTF8 bytes, padded to 4 byte boundary)
|
|
@@ -6519,36 +5570,14 @@ exports.topoFromBuffer = topoFromBuffer;
|
|
|
6519
5570
|
/*!*******************************!*\
|
|
6520
5571
|
!*** ./lib/poly/polylabel.ts ***!
|
|
6521
5572
|
\*******************************/
|
|
6522
|
-
/***/ (
|
|
5573
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6523
5574
|
|
|
6524
5575
|
|
|
6525
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6526
|
-
if (k2 === undefined) k2 = k;
|
|
6527
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
6528
|
-
}) : (function(o, m, k, k2) {
|
|
6529
|
-
if (k2 === undefined) k2 = k;
|
|
6530
|
-
o[k2] = m[k];
|
|
6531
|
-
}));
|
|
6532
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
6533
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
6534
|
-
}) : function(o, v) {
|
|
6535
|
-
o["default"] = v;
|
|
6536
|
-
});
|
|
6537
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
6538
|
-
if (mod && mod.__esModule) return mod;
|
|
6539
|
-
var result = {};
|
|
6540
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
6541
|
-
__setModuleDefault(result, mod);
|
|
6542
|
-
return result;
|
|
6543
|
-
};
|
|
6544
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6545
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6546
|
-
};
|
|
6547
5576
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6548
5577
|
exports.polyLabel = void 0;
|
|
6549
|
-
const tinyqueue_1 =
|
|
6550
|
-
const P =
|
|
6551
|
-
const PP =
|
|
5578
|
+
const tinyqueue_1 = __webpack_require__(/*! tinyqueue */ "tinyqueue");
|
|
5579
|
+
const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
5580
|
+
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
6552
5581
|
//
|
|
6553
5582
|
// polyLabel: given polygon, return contained point furthest from any edge, and that distance
|
|
6554
5583
|
//
|
|
@@ -6714,32 +5743,13 @@ function getSegDistSq(px, py, ax, ay, bx, by) {
|
|
|
6714
5743
|
/*!******************************!*\
|
|
6715
5744
|
!*** ./lib/poly/polypack.ts ***!
|
|
6716
5745
|
\******************************/
|
|
6717
|
-
/***/ (
|
|
5746
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6718
5747
|
|
|
6719
5748
|
|
|
6720
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6721
|
-
if (k2 === undefined) k2 = k;
|
|
6722
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
6723
|
-
}) : (function(o, m, k, k2) {
|
|
6724
|
-
if (k2 === undefined) k2 = k;
|
|
6725
|
-
o[k2] = m[k];
|
|
6726
|
-
}));
|
|
6727
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
6728
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
6729
|
-
}) : function(o, v) {
|
|
6730
|
-
o["default"] = v;
|
|
6731
|
-
});
|
|
6732
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
6733
|
-
if (mod && mod.__esModule) return mod;
|
|
6734
|
-
var result = {};
|
|
6735
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
6736
|
-
__setModuleDefault(result, mod);
|
|
6737
|
-
return result;
|
|
6738
|
-
};
|
|
6739
5749
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6740
5750
|
exports.featureUnpackString = exports.featurePackString = exports.featureRepack = exports.featureUnpackTemporarily = exports.featureUnpack = exports.featurePack = exports.featurePackSize = exports.polyUnpack = exports.polyPackCopy = exports.polyPack = exports.polyPackTopoArcs = exports.countArcPoints = exports.countOneArcPoints = exports.countArcRings = exports.countArcPolygons = exports.normalizeArcs = exports.polyPacked = exports.polyPackCountPoints = exports.polyPackEachPoint = exports.polyPackEachRing = exports.polyPackSize = void 0;
|
|
6741
5751
|
// Shared libraries
|
|
6742
|
-
const Util =
|
|
5752
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
6743
5753
|
function polyPackSize(coords) {
|
|
6744
5754
|
// Null feature?
|
|
6745
5755
|
if (coords == null || (coords.length !== undefined && coords.length == 0))
|
|
@@ -6939,9 +5949,7 @@ function polyPack(coords, prepack) {
|
|
|
6939
5949
|
coords = coords.geometry.coordinates;
|
|
6940
5950
|
// Transparently handle polygon or multi-polygon
|
|
6941
5951
|
let depth = Util.depthof(coords);
|
|
6942
|
-
if (depth ==
|
|
6943
|
-
coords = [[[coords]]];
|
|
6944
|
-
else if (depth == 3)
|
|
5952
|
+
if (depth == 3)
|
|
6945
5953
|
coords = [[coords]];
|
|
6946
5954
|
else if (depth == 4)
|
|
6947
5955
|
coords = [coords];
|
|
@@ -7068,16 +6076,9 @@ exports.featurePack = featurePack;
|
|
|
7068
6076
|
function featureUnpack(f) {
|
|
7069
6077
|
if (f && f.geometry && f.geometry.packed !== undefined) {
|
|
7070
6078
|
f.geometry.coordinates = polyUnpack(f.geometry.packed);
|
|
7071
|
-
let depth = Util.depthof(f.geometry.coordinates);
|
|
7072
6079
|
// Check for oops, optimized away the multipolygon in polyUnpack
|
|
7073
|
-
if (f.geometry.type === 'MultiPolygon' &&
|
|
6080
|
+
if (f.geometry.type === 'MultiPolygon' && Util.depthof(f.geometry.coordinates) === 4)
|
|
7074
6081
|
f.geometry.coordinates = [f.geometry.coordinates];
|
|
7075
|
-
else if (f.geometry.type === 'Point' && depth != 2) {
|
|
7076
|
-
while (depth > 2) {
|
|
7077
|
-
f.geometry.coordinates = f.geometry.coordinates[0];
|
|
7078
|
-
depth = Util.depthof(f.geometry.coordinates);
|
|
7079
|
-
}
|
|
7080
|
-
}
|
|
7081
6082
|
delete f.geometry.packed;
|
|
7082
6083
|
}
|
|
7083
6084
|
else if (f.type && f.type === 'FeatureCollection' && f.features) {
|
|
@@ -7152,32 +6153,13 @@ exports.featureUnpackString = featureUnpackString;
|
|
|
7152
6153
|
/*!*******************************!*\
|
|
7153
6154
|
!*** ./lib/poly/polyround.ts ***!
|
|
7154
6155
|
\*******************************/
|
|
7155
|
-
/***/ (
|
|
6156
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7156
6157
|
|
|
7157
6158
|
|
|
7158
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7159
|
-
if (k2 === undefined) k2 = k;
|
|
7160
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7161
|
-
}) : (function(o, m, k, k2) {
|
|
7162
|
-
if (k2 === undefined) k2 = k;
|
|
7163
|
-
o[k2] = m[k];
|
|
7164
|
-
}));
|
|
7165
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
7166
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
7167
|
-
}) : function(o, v) {
|
|
7168
|
-
o["default"] = v;
|
|
7169
|
-
});
|
|
7170
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7171
|
-
if (mod && mod.__esModule) return mod;
|
|
7172
|
-
var result = {};
|
|
7173
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7174
|
-
__setModuleDefault(result, mod);
|
|
7175
|
-
return result;
|
|
7176
|
-
};
|
|
7177
6159
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7178
6160
|
exports.polyRound = void 0;
|
|
7179
|
-
const Util =
|
|
7180
|
-
const PP =
|
|
6161
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
6162
|
+
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
7181
6163
|
// Round feature geometry to 6 decimal precision
|
|
7182
6164
|
function polyRound(o) {
|
|
7183
6165
|
if (o) {
|
|
@@ -7210,31 +6192,12 @@ exports.polyRound = polyRound;
|
|
|
7210
6192
|
/*!**********************************!*\
|
|
7211
6193
|
!*** ./lib/poly/polysimplify.ts ***!
|
|
7212
6194
|
\**********************************/
|
|
7213
|
-
/***/ (
|
|
6195
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7214
6196
|
|
|
7215
6197
|
|
|
7216
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7217
|
-
if (k2 === undefined) k2 = k;
|
|
7218
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7219
|
-
}) : (function(o, m, k, k2) {
|
|
7220
|
-
if (k2 === undefined) k2 = k;
|
|
7221
|
-
o[k2] = m[k];
|
|
7222
|
-
}));
|
|
7223
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
7224
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
7225
|
-
}) : function(o, v) {
|
|
7226
|
-
o["default"] = v;
|
|
7227
|
-
});
|
|
7228
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7229
|
-
if (mod && mod.__esModule) return mod;
|
|
7230
|
-
var result = {};
|
|
7231
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7232
|
-
__setModuleDefault(result, mod);
|
|
7233
|
-
return result;
|
|
7234
|
-
};
|
|
7235
6198
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7236
6199
|
exports.polySimplify = void 0;
|
|
7237
|
-
const Util =
|
|
6200
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
7238
6201
|
const simplify_1 = __webpack_require__(/*! ./simplify */ "./lib/poly/simplify.ts");
|
|
7239
6202
|
function polySimplify(poly, tolerance = 0.0001) {
|
|
7240
6203
|
if (poly == null)
|
|
@@ -7263,40 +6226,21 @@ exports.polySimplify = polySimplify;
|
|
|
7263
6226
|
/*!**************************!*\
|
|
7264
6227
|
!*** ./lib/poly/quad.ts ***!
|
|
7265
6228
|
\**************************/
|
|
7266
|
-
/***/ (
|
|
6229
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7267
6230
|
|
|
7268
6231
|
|
|
7269
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7270
|
-
if (k2 === undefined) k2 = k;
|
|
7271
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7272
|
-
}) : (function(o, m, k, k2) {
|
|
7273
|
-
if (k2 === undefined) k2 = k;
|
|
7274
|
-
o[k2] = m[k];
|
|
7275
|
-
}));
|
|
7276
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
7277
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
7278
|
-
}) : function(o, v) {
|
|
7279
|
-
o["default"] = v;
|
|
7280
|
-
});
|
|
7281
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7282
|
-
if (mod && mod.__esModule) return mod;
|
|
7283
|
-
var result = {};
|
|
7284
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7285
|
-
__setModuleDefault(result, mod);
|
|
7286
|
-
return result;
|
|
7287
|
-
};
|
|
7288
6232
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7289
6233
|
exports.FsmQuadTree = exports.DefaultQuadOptions = exports.unionPolys = void 0;
|
|
7290
6234
|
// Public libraries
|
|
7291
|
-
const PC =
|
|
6235
|
+
const PC = __webpack_require__(/*! polygon-clipping */ "polygon-clipping");
|
|
7292
6236
|
// Shared libraries
|
|
7293
|
-
const Util =
|
|
7294
|
-
const FSM =
|
|
6237
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
6238
|
+
const FSM = __webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts");
|
|
7295
6239
|
// Local libraries
|
|
7296
|
-
const Poly =
|
|
7297
|
-
const PP =
|
|
7298
|
-
const BB =
|
|
7299
|
-
const PR =
|
|
6240
|
+
const Poly = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
6241
|
+
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
6242
|
+
const BB = __webpack_require__(/*! ./boundbox */ "./lib/poly/boundbox.ts");
|
|
6243
|
+
const PR = __webpack_require__(/*! ./polyround */ "./lib/poly/polyround.ts");
|
|
7300
6244
|
let _union = undefined;
|
|
7301
6245
|
let anyPC = PC;
|
|
7302
6246
|
if (anyPC.union)
|
|
@@ -7491,32 +6435,13 @@ exports.FsmQuadTree = FsmQuadTree;
|
|
|
7491
6435
|
/*!***********************************!*\
|
|
7492
6436
|
!*** ./lib/poly/selfintersect.ts ***!
|
|
7493
6437
|
\***********************************/
|
|
7494
|
-
/***/ (
|
|
6438
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7495
6439
|
|
|
7496
6440
|
|
|
7497
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7498
|
-
if (k2 === undefined) k2 = k;
|
|
7499
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7500
|
-
}) : (function(o, m, k, k2) {
|
|
7501
|
-
if (k2 === undefined) k2 = k;
|
|
7502
|
-
o[k2] = m[k];
|
|
7503
|
-
}));
|
|
7504
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
7505
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
7506
|
-
}) : function(o, v) {
|
|
7507
|
-
o["default"] = v;
|
|
7508
|
-
});
|
|
7509
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7510
|
-
if (mod && mod.__esModule) return mod;
|
|
7511
|
-
var result = {};
|
|
7512
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7513
|
-
__setModuleDefault(result, mod);
|
|
7514
|
-
return result;
|
|
7515
|
-
};
|
|
7516
6441
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7517
6442
|
exports.selfIntersect = void 0;
|
|
7518
|
-
const P =
|
|
7519
|
-
const PP =
|
|
6443
|
+
const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
6444
|
+
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
7520
6445
|
// Given three colinear points p, q, r, the function checks if
|
|
7521
6446
|
// point q lies on line segment 'pr'
|
|
7522
6447
|
function onSegment(px, py, qx, qy, rx, ry) {
|
|
@@ -7598,35 +6523,13 @@ exports.selfIntersect = selfIntersect;
|
|
|
7598
6523
|
/*!****************************!*\
|
|
7599
6524
|
!*** ./lib/poly/shamos.ts ***!
|
|
7600
6525
|
\****************************/
|
|
7601
|
-
/***/ (
|
|
6526
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7602
6527
|
|
|
7603
6528
|
|
|
7604
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7605
|
-
if (k2 === undefined) k2 = k;
|
|
7606
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7607
|
-
}) : (function(o, m, k, k2) {
|
|
7608
|
-
if (k2 === undefined) k2 = k;
|
|
7609
|
-
o[k2] = m[k];
|
|
7610
|
-
}));
|
|
7611
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
7612
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
7613
|
-
}) : function(o, v) {
|
|
7614
|
-
o["default"] = v;
|
|
7615
|
-
});
|
|
7616
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7617
|
-
if (mod && mod.__esModule) return mod;
|
|
7618
|
-
var result = {};
|
|
7619
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7620
|
-
__setModuleDefault(result, mod);
|
|
7621
|
-
return result;
|
|
7622
|
-
};
|
|
7623
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7624
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7625
|
-
};
|
|
7626
6529
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7627
6530
|
exports.selfIntersectFast = void 0;
|
|
7628
|
-
const P =
|
|
7629
|
-
const PP =
|
|
6531
|
+
const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
6532
|
+
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
7630
6533
|
// Adapted from rowanwins/shamos-hoey
|
|
7631
6534
|
/*
|
|
7632
6535
|
MIT License
|
|
@@ -7652,8 +6555,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
7652
6555
|
SOFTWARE.
|
|
7653
6556
|
*/
|
|
7654
6557
|
// External libraries
|
|
7655
|
-
const tinyqueue_1 =
|
|
7656
|
-
const splaytree_1 =
|
|
6558
|
+
const tinyqueue_1 = __webpack_require__(/*! tinyqueue */ "tinyqueue");
|
|
6559
|
+
const splaytree_1 = __webpack_require__(/*! splaytree */ "splaytree");
|
|
7657
6560
|
class Event {
|
|
7658
6561
|
constructor(x, y) {
|
|
7659
6562
|
this.x = x;
|
|
@@ -7950,41 +6853,22 @@ exports.simplify = simplify;
|
|
|
7950
6853
|
/*!**************************!*\
|
|
7951
6854
|
!*** ./lib/poly/topo.ts ***!
|
|
7952
6855
|
\**************************/
|
|
7953
|
-
/***/ (
|
|
6856
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7954
6857
|
|
|
7955
6858
|
|
|
7956
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7957
|
-
if (k2 === undefined) k2 = k;
|
|
7958
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7959
|
-
}) : (function(o, m, k, k2) {
|
|
7960
|
-
if (k2 === undefined) k2 = k;
|
|
7961
|
-
o[k2] = m[k];
|
|
7962
|
-
}));
|
|
7963
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
7964
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
7965
|
-
}) : function(o, v) {
|
|
7966
|
-
o["default"] = v;
|
|
7967
|
-
});
|
|
7968
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7969
|
-
if (mod && mod.__esModule) return mod;
|
|
7970
|
-
var result = {};
|
|
7971
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7972
|
-
__setModuleDefault(result, mod);
|
|
7973
|
-
return result;
|
|
7974
|
-
};
|
|
7975
6859
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7976
6860
|
exports.topoUnpack = exports.topoPack = exports.topoPacked = exports.FsmTopoUnion = exports.topoMergeFeatures = exports.topoMerge = exports.topoSimplifyCollection = exports.topoToCollection = exports.topoToFeature = exports.topoContiguity = exports.topoFromCollection = void 0;
|
|
7977
6861
|
// Forked version that supports packing
|
|
7978
|
-
const TopoClient =
|
|
6862
|
+
const TopoClient = __webpack_require__(/*! @dra2020/topojson-client */ "@dra2020/topojson-client");
|
|
7979
6863
|
// Forked version that fixes self-looping hole problem
|
|
7980
|
-
const TopoServer =
|
|
6864
|
+
const TopoServer = __webpack_require__(/*! @dra2020/topojson-server */ "@dra2020/topojson-server");
|
|
7981
6865
|
// Forked version that fixes performance problem
|
|
7982
|
-
const TopoSimplify =
|
|
7983
|
-
const Util =
|
|
7984
|
-
const FSM =
|
|
7985
|
-
const P =
|
|
7986
|
-
const PP =
|
|
7987
|
-
const PL =
|
|
6866
|
+
const TopoSimplify = __webpack_require__(/*! @dra2020/topojson-simplify */ "@dra2020/topojson-simplify");
|
|
6867
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
6868
|
+
const FSM = __webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts");
|
|
6869
|
+
const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
6870
|
+
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
6871
|
+
const PL = __webpack_require__(/*! ./polylabel */ "./lib/poly/polylabel.ts");
|
|
7988
6872
|
const shamos_1 = __webpack_require__(/*! ./shamos */ "./lib/poly/shamos.ts");
|
|
7989
6873
|
function getGEOID(f) {
|
|
7990
6874
|
if (f.features && f.features.length)
|
|
@@ -8028,14 +6912,24 @@ function ringsCancel(outerPoly, innerRing) {
|
|
|
8028
6912
|
function correctGeometry(f) {
|
|
8029
6913
|
if (f && f.geometry && f.geometry.type === 'MultiPolygon' && f.geometry.coordinates) {
|
|
8030
6914
|
let multiPoly = f.geometry.coordinates;
|
|
6915
|
+
/* Comment this out right now - might have been do to not rewinding merge output
|
|
6916
|
+
// topojson will under certain circumstances return a MultiPolygon with the first Polygon containing holes
|
|
6917
|
+
// that are precisely filled by a subsequent polygon. We make a secondary union pass to try to correct for this.
|
|
6918
|
+
// If we have a really degenerate multipolygon (test above some number of polygons) omit this expensive pass
|
|
6919
|
+
// since cleanup is unlikely.
|
|
6920
|
+
if (multiPoly.length > 1 && multiPoly.length < 50)
|
|
6921
|
+
{
|
|
6922
|
+
let result = Q.unionPolys(multiPoly);
|
|
6923
|
+
if (Util.depthof(result) == 4) result = [ result ];
|
|
6924
|
+
multiPoly = result;
|
|
6925
|
+
}
|
|
6926
|
+
*/
|
|
8031
6927
|
// Convert degenerate MultiPolygon to Polygon
|
|
8032
6928
|
if (multiPoly.length == 1) {
|
|
8033
6929
|
f.geometry.type = 'Polygon';
|
|
8034
6930
|
f.geometry.coordinates = multiPoly[0];
|
|
8035
6931
|
}
|
|
8036
6932
|
}
|
|
8037
|
-
// TopoJSON does not guarantee proper winding order which messes up later processing. Fix it.
|
|
8038
|
-
P.featureRewind(f);
|
|
8039
6933
|
return f;
|
|
8040
6934
|
}
|
|
8041
6935
|
function topoContiguity(topo) {
|
|
@@ -8129,9 +7023,6 @@ function bigTimeString(ms) {
|
|
|
8129
7023
|
return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
|
|
8130
7024
|
}
|
|
8131
7025
|
const DefaultSimplifyOptions = { minArea: 500 };
|
|
8132
|
-
function log(s) {
|
|
8133
|
-
//console.log(s);
|
|
8134
|
-
}
|
|
8135
7026
|
//
|
|
8136
7027
|
// topoSimplifyCollection:
|
|
8137
7028
|
// This implements our simplification strategy for block/precinct level shapes. The basic idea is to
|
|
@@ -8154,10 +7045,10 @@ function topoSimplifyCollection(col, options) {
|
|
|
8154
7045
|
let elapsedTotal = new Util.Elapsed();
|
|
8155
7046
|
let elapsed = new Util.Elapsed();
|
|
8156
7047
|
let topo = topoFromCollection(col);
|
|
8157
|
-
log(`topoSimplifyCollection: fromCollection: ${Math.round(elapsed.ms())}ms`);
|
|
7048
|
+
console.log(`topoSimplifyCollection: fromCollection: ${Math.round(elapsed.ms())}ms`);
|
|
8158
7049
|
elapsed.start();
|
|
8159
7050
|
topo = TopoSimplify.presimplify(topo, TopoSimplify['sphericalTriangleArea']);
|
|
8160
|
-
log(`topoSimplifyCollection: presimplify: ${Math.round(elapsed.ms())}ms`);
|
|
7051
|
+
console.log(`topoSimplifyCollection: presimplify: ${Math.round(elapsed.ms())}ms`);
|
|
8161
7052
|
elapsed.start();
|
|
8162
7053
|
// Keep iterating on removing simplification from degenerate shapes
|
|
8163
7054
|
let nTries = 1;
|
|
@@ -8213,11 +7104,11 @@ function topoSimplifyCollection(col, options) {
|
|
|
8213
7104
|
}
|
|
8214
7105
|
}
|
|
8215
7106
|
});
|
|
8216
|
-
log(`topoSimplifyCollection: pass ${nTries}: ${nBad} (${nTiny} tiny) of ${col.features.length} features are degenerate`);
|
|
7107
|
+
console.log(`topoSimplifyCollection: pass ${nTries}: ${nBad} (${nTiny} tiny) of ${col.features.length} features are degenerate`);
|
|
8217
7108
|
// If not making progress, keep more points
|
|
8218
7109
|
if (nBad >= nBadLast) {
|
|
8219
7110
|
keepweight /= 10;
|
|
8220
|
-
log(`topoSimplifyCollection: pass ${nTries}: reducing weight limit to ${keepweight}`);
|
|
7111
|
+
console.log(`topoSimplifyCollection: pass ${nTries}: reducing weight limit to ${keepweight}`);
|
|
8221
7112
|
}
|
|
8222
7113
|
nBadLast = nBad;
|
|
8223
7114
|
if (nBad && nTries > MAX_TRIES)
|
|
@@ -8229,7 +7120,7 @@ function topoSimplifyCollection(col, options) {
|
|
|
8229
7120
|
}
|
|
8230
7121
|
nTries++;
|
|
8231
7122
|
}
|
|
8232
|
-
log(`topoSimplifyCollection: total elapsed time: ${bigTimeString(elapsedTotal.ms())}`);
|
|
7123
|
+
console.log(`topoSimplifyCollection: total elapsed time: ${bigTimeString(elapsedTotal.ms())}`);
|
|
8233
7124
|
return col;
|
|
8234
7125
|
}
|
|
8235
7126
|
exports.topoSimplifyCollection = topoSimplifyCollection;
|
|
@@ -8238,7 +7129,27 @@ function topoMerge(topo, geoids) {
|
|
|
8238
7129
|
return null;
|
|
8239
7130
|
let objects = [];
|
|
8240
7131
|
geoids.forEach((geoid) => objects.push(topo.objects[geoid]));
|
|
8241
|
-
|
|
7132
|
+
let f = correctGeometry({ type: 'Feature', properties: {}, geometry: TopoClient.merge(topo, objects) });
|
|
7133
|
+
P.featureRewind(f);
|
|
7134
|
+
/* Comment out for now - may be due to merge output needing to be rewound
|
|
7135
|
+
// If I get a bad output from topoMerge, just do more expensive poly union. This can happen if input polygons
|
|
7136
|
+
// are a little funky (in particular, if they double back along the same edge.
|
|
7137
|
+
if (selfIntersectFast(f))
|
|
7138
|
+
{
|
|
7139
|
+
//console.log('topoMerge: patching selfIntersect');
|
|
7140
|
+
let polys: any[] = [];
|
|
7141
|
+
geoids.forEach((geoid) => polys.push(topoToFeature(topo, geoid).geometry.coordinates));
|
|
7142
|
+
let result = Q.unionPolys(polys);
|
|
7143
|
+
let depth = Util.depthof(result);
|
|
7144
|
+
if (depth === 5 && result.length === 1)
|
|
7145
|
+
{
|
|
7146
|
+
depth = 4;
|
|
7147
|
+
result = result[0];
|
|
7148
|
+
}
|
|
7149
|
+
f = { type: 'feature', properties: {}, geometry: { type: depth == 4 ? 'Polygon' : 'MultiPolygon', coordinates: result } };
|
|
7150
|
+
}
|
|
7151
|
+
*/
|
|
7152
|
+
return f;
|
|
8242
7153
|
}
|
|
8243
7154
|
exports.topoMerge = topoMerge;
|
|
8244
7155
|
function topoMergeFeatures(topo, features) {
|
|
@@ -8276,7 +7187,7 @@ class FsmIncrementalUnion extends FSM.Fsm {
|
|
|
8276
7187
|
let values = Object.values(map);
|
|
8277
7188
|
this.work = { nUnion: values.length, nDifference: 0, ms: 0 };
|
|
8278
7189
|
let elapsed = new Util.Elapsed();
|
|
8279
|
-
this.result = topoMergeFeatures(this.key.
|
|
7190
|
+
this.result = topoMergeFeatures(this.key.topo, values);
|
|
8280
7191
|
this.work.ms = elapsed.ms();
|
|
8281
7192
|
this.map = map;
|
|
8282
7193
|
}
|
|
@@ -8379,37 +7290,18 @@ exports.topoUnpack = topoUnpack;
|
|
|
8379
7290
|
/*!***************************!*\
|
|
8380
7291
|
!*** ./lib/poly/union.ts ***!
|
|
8381
7292
|
\***************************/
|
|
8382
|
-
/***/ (
|
|
7293
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8383
7294
|
|
|
8384
7295
|
|
|
8385
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8386
|
-
if (k2 === undefined) k2 = k;
|
|
8387
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
8388
|
-
}) : (function(o, m, k, k2) {
|
|
8389
|
-
if (k2 === undefined) k2 = k;
|
|
8390
|
-
o[k2] = m[k];
|
|
8391
|
-
}));
|
|
8392
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
8393
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
8394
|
-
}) : function(o, v) {
|
|
8395
|
-
o["default"] = v;
|
|
8396
|
-
});
|
|
8397
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
8398
|
-
if (mod && mod.__esModule) return mod;
|
|
8399
|
-
var result = {};
|
|
8400
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
8401
|
-
__setModuleDefault(result, mod);
|
|
8402
|
-
return result;
|
|
8403
|
-
};
|
|
8404
7296
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8405
|
-
exports.FsmUnion = exports.
|
|
8406
|
-
const PC =
|
|
8407
|
-
const Util =
|
|
8408
|
-
const FSM =
|
|
8409
|
-
const Poly =
|
|
8410
|
-
const Q =
|
|
8411
|
-
const PP =
|
|
8412
|
-
const PR =
|
|
7297
|
+
exports.FsmUnion = exports.polyIntersects = void 0;
|
|
7298
|
+
const PC = __webpack_require__(/*! polygon-clipping */ "polygon-clipping");
|
|
7299
|
+
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
7300
|
+
const FSM = __webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts");
|
|
7301
|
+
const Poly = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
7302
|
+
const Q = __webpack_require__(/*! ./quad */ "./lib/poly/quad.ts");
|
|
7303
|
+
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
7304
|
+
const PR = __webpack_require__(/*! ./polyround */ "./lib/poly/polyround.ts");
|
|
8413
7305
|
// Confusion on how polygon-clipping exposes its interface - be flexible
|
|
8414
7306
|
let _union = undefined;
|
|
8415
7307
|
let _difference = undefined;
|
|
@@ -8461,20 +7353,6 @@ function polyIntersects(p1, p2) {
|
|
|
8461
7353
|
return bIntersects;
|
|
8462
7354
|
}
|
|
8463
7355
|
exports.polyIntersects = polyIntersects;
|
|
8464
|
-
function polyDifference(main, parts) {
|
|
8465
|
-
main = PP.polyUnpack(coords(main));
|
|
8466
|
-
// need to explode multipolygon so that "exploded" is a valid multipolygon input to underlying difference routine
|
|
8467
|
-
let exploded = [];
|
|
8468
|
-
parts.forEach((p) => {
|
|
8469
|
-
p = PP.polyUnpack(coords(p));
|
|
8470
|
-
if (Util.depthof(p) == 5)
|
|
8471
|
-
p.forEach((poly) => { exploded.push(poly); });
|
|
8472
|
-
else
|
|
8473
|
-
exploded.push(p);
|
|
8474
|
-
});
|
|
8475
|
-
return PR.polyRound(_difference(main, exploded));
|
|
8476
|
-
}
|
|
8477
|
-
exports.polyDifference = polyDifference;
|
|
8478
7356
|
class FsmDifference extends FSM.Fsm {
|
|
8479
7357
|
constructor(env, accum, polys) {
|
|
8480
7358
|
super(env);
|
|
@@ -10106,7 +8984,7 @@ module.exports = require("tinyqueue");;
|
|
|
10106
8984
|
/******/ // module exports must be returned from runtime so entry inlining is disabled
|
|
10107
8985
|
/******/ // startup
|
|
10108
8986
|
/******/ // Load entry module and return exports
|
|
10109
|
-
/******/ return __webpack_require__("./lib/all/
|
|
8987
|
+
/******/ return __webpack_require__("./lib/all/allclient.ts");
|
|
10110
8988
|
/******/ })()
|
|
10111
8989
|
;
|
|
10112
8990
|
});
|