@theseam/ui-common 1.0.2-beta.67 → 1.0.2-beta.70
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { switchMap, startWith, map, distinctUntilChanged, mapTo, filter, take, pairwise, toArray, tap,
|
|
2
|
-
import { of, merge, interval, from, combineLatest, Observable, isObservable, BehaviorSubject,
|
|
1
|
+
import { switchMap, startWith, map, distinctUntilChanged, mapTo, filter, take, pairwise, toArray, tap, auditTime, share } from 'rxjs/operators';
|
|
2
|
+
import { of, merge, interval, from, combineLatest, Observable, isObservable, Subject, BehaviorSubject, EMPTY } from 'rxjs';
|
|
3
3
|
import area from '@turf/area';
|
|
4
4
|
import { convertArea } from '@turf/helpers';
|
|
5
5
|
import kinks from '@turf/kinks';
|
|
@@ -1173,68 +1173,50 @@ function pollingTicker(action, pollingInterval, ticker, options) {
|
|
|
1173
1173
|
});
|
|
1174
1174
|
}
|
|
1175
1175
|
|
|
1176
|
+
const NO_VALUE = Symbol('refreshable.no-value');
|
|
1176
1177
|
class Refreshable {
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1178
|
+
_refresh$ = new Subject();
|
|
1179
|
+
_cache$ = new BehaviorSubject(NO_VALUE);
|
|
1180
|
+
_loading$ = new BehaviorSubject(false);
|
|
1181
|
+
_dataSubCount = 0;
|
|
1182
|
+
loading$ = this._loading$.pipe(distinctUntilChanged());
|
|
1183
|
+
initialized$ = this._cache$.pipe(map((v) => v !== NO_VALUE), distinctUntilChanged());
|
|
1181
1184
|
data$;
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
const
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
this.
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
* Selects the data observable
|
|
1215
|
-
*/
|
|
1216
|
-
select(refresh) {
|
|
1217
|
-
if (refresh && this._initialized && !this._pending.value) {
|
|
1218
|
-
this._ticker.next();
|
|
1219
|
-
}
|
|
1220
|
-
return this.data$;
|
|
1185
|
+
constructor(opts) {
|
|
1186
|
+
const { action } = opts;
|
|
1187
|
+
const invalidateSig$ = (opts.invalidate$ ?? EMPTY).pipe(tap(() => this._cache$.next(NO_VALUE)));
|
|
1188
|
+
const driver$ = merge(this._refresh$, opts.poll$ ?? EMPTY, invalidateSig$).pipe(startWith(undefined), auditTime(0), tap(() => this._loading$.next(true)), switchMap(() => action()), tap({
|
|
1189
|
+
next: (v) => {
|
|
1190
|
+
this._cache$.next(v);
|
|
1191
|
+
this._loading$.next(false);
|
|
1192
|
+
},
|
|
1193
|
+
error: () => this._loading$.next(false),
|
|
1194
|
+
}), share({
|
|
1195
|
+
resetOnRefCountZero: true,
|
|
1196
|
+
resetOnComplete: true,
|
|
1197
|
+
resetOnError: true,
|
|
1198
|
+
}));
|
|
1199
|
+
this.data$ = new Observable((subscriber) => {
|
|
1200
|
+
this._dataSubCount++;
|
|
1201
|
+
const driverSub = driver$.subscribe({
|
|
1202
|
+
error: (e) => subscriber.error(e),
|
|
1203
|
+
});
|
|
1204
|
+
const cacheSub = this._cache$
|
|
1205
|
+
.pipe(filter((v) => v !== NO_VALUE))
|
|
1206
|
+
.subscribe(subscriber);
|
|
1207
|
+
return () => {
|
|
1208
|
+
cacheSub.unsubscribe();
|
|
1209
|
+
driverSub.unsubscribe();
|
|
1210
|
+
this._dataSubCount--;
|
|
1211
|
+
if (this._dataSubCount === 0) {
|
|
1212
|
+
this._cache$.next(NO_VALUE);
|
|
1213
|
+
this._loading$.next(false);
|
|
1214
|
+
}
|
|
1215
|
+
};
|
|
1216
|
+
});
|
|
1221
1217
|
}
|
|
1222
1218
|
refresh() {
|
|
1223
|
-
|
|
1224
|
-
if (this._initialized) {
|
|
1225
|
-
// TODO: Add a test and maybe refactor this to be more clear. It worked in
|
|
1226
|
-
// my manual tests, but there may be some situations where this doesn't
|
|
1227
|
-
// work, since the ticker isn't the only way to trigger a refresh. Right
|
|
1228
|
-
// now it should be fine, but if an async operator is added to be run
|
|
1229
|
-
// each time `data$` is subscribed to, then this could fail if the data
|
|
1230
|
-
// emits one extra time before the ticker is triggered.
|
|
1231
|
-
let _polled = false;
|
|
1232
|
-
result$ = this.data$.pipe(tap((_) => !_polled && (_polled = true) && this._ticker.next()), skip(1));
|
|
1233
|
-
}
|
|
1234
|
-
else {
|
|
1235
|
-
result$ = this.data$;
|
|
1236
|
-
}
|
|
1237
|
-
return result$.pipe(take(1), mapTo(undefined));
|
|
1219
|
+
this._refresh$.next();
|
|
1238
1220
|
}
|
|
1239
1221
|
}
|
|
1240
1222
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theseam-ui-common-utils.mjs","sources":["../../../projects/ui-common/utils/get-attribute.ts","../../../projects/ui-common/utils/has-attribute.ts","../../../projects/ui-common/utils/cdk/get-closest-widget-cdk-drag.ts","../../../projects/ui-common/utils/form/get-control-name.ts","../../../projects/ui-common/utils/form/get-control-path.ts","../../../projects/ui-common/utils/form/observe-control-value.ts","../../../projects/ui-common/utils/form/observe-control-is-different.ts","../../../projects/ui-common/utils/form/wait-on-non-pending-status.ts","../../../projects/ui-common/utils/form/observe-control-status.ts","../../../projects/ui-common/utils/form/observe-control-valid.ts","../../../projects/ui-common/utils/form/observe-control-value-change.ts","../../../projects/ui-common/utils/has-property.ts","../../../projects/ui-common/utils/form/has-required-control.ts","../../../projects/ui-common/utils/form/is-empty-input-value.ts","../../../projects/ui-common/utils/operators/map-each.ts","../../../projects/ui-common/utils/operators/tap-first.ts","../../../projects/ui-common/utils/router/leaf-child-route.ts","../../../projects/ui-common/utils/router/will-have-data-prop.ts","../../../projects/ui-common/utils/router/operators/activated-routes-with-data-property.ts","../../../projects/ui-common/utils/router/route-snapshot-path-relative.ts","../../../projects/ui-common/utils/router/route-snapshot-path-full.ts","../../../projects/ui-common/utils/router/is-empty-url-route.ts","../../../projects/ui-common/utils/geo-json/coerce-feature-collection.ts","../../../projects/ui-common/utils/geo-json/geo-json-to-area.ts","../../../projects/ui-common/utils/geo-json/is-feature-collection.validator.ts","../../../projects/ui-common/utils/geo-json/is-only-geometry-types.ts","../../../projects/ui-common/utils/geo-json/is-only-geometry-types.validator.ts","../../../projects/ui-common/utils/geo-json/merge-polygons.ts","../../../projects/ui-common/utils/not-null-or-undefined.ts","../../../projects/ui-common/utils/geo-json/min-max-points.validator.ts","../../../projects/ui-common/utils/geo-json/no-empty-feature-collection.validator.ts","../../../projects/ui-common/utils/geo-json/no-inner-rings.validator.ts","../../../projects/ui-common/utils/geo-json/no-kinks.validator.ts","../../../projects/ui-common/utils/file-utils.ts","../../../projects/ui-common/utils/obj-utils.ts","../../../projects/ui-common/utils/geo-json/read-geo-file.ts","../../../projects/ui-common/utils/geo-json/split-multi-polygons.ts","../../../projects/ui-common/utils/geo-json/close-polygons.ts","../../../projects/ui-common/utils/array-move.ts","../../../projects/ui-common/utils/calc-percentage.ts","../../../projects/ui-common/utils/toggle-attribute.ts","../../../projects/ui-common/utils/input-masks.ts","../../../projects/ui-common/utils/is-null-or-undefined.ts","../../../projects/ui-common/utils/is-null-or-undefined-or-empty.ts","../../../projects/ui-common/utils/load-style.ts","../../../projects/ui-common/utils/load-style-sheet.ts","../../../projects/ui-common/utils/not-null-or-undefined-or-empty.ts","../../../projects/ui-common/utils/wait-on-condition-async.ts","../../../projects/ui-common/utils/polling-ticker.ts","../../../projects/ui-common/utils/refreshable.ts","../../../projects/ui-common/utils/wrap-into-observable.ts","../../../projects/ui-common/utils/is-absolute-url.ts","../../../projects/ui-common/utils/subscriber-count.ts","../../../projects/ui-common/utils/observe-query-list.ts","../../../projects/ui-common/utils/create-padding.ts","../../../projects/ui-common/utils/pad-end.ts","../../../projects/ui-common/utils/pad-start.ts","../../../projects/ui-common/utils/is-numeric.ts","../../../projects/ui-common/utils/fractional-digits-count.ts","../../../projects/ui-common/utils/strip-outer.ts","../../../projects/ui-common/utils/trim-repeated.ts","../../../projects/ui-common/utils/sanitize-filename.ts","../../../projects/ui-common/utils/theseam-ui-common-utils.ts"],"sourcesContent":["/**\n *\n */\nexport function getAttribute<E extends HTMLElement>(\n element: E,\n name: string,\n): string | null {\n return element.getAttribute(name)\n}\n","/**\n *\n */\nexport function hasAttribute<E extends HTMLElement>(\n element: E,\n name: string,\n): boolean {\n return element.hasAttribute(name)\n}\n","import { CdkDrag } from '@angular/cdk/drag-drop'\nimport { ElementRef } from '@angular/core'\n\nimport { getAttribute } from '../get-attribute'\nimport { hasAttribute } from '../has-attribute'\n\n/**\n * Finds the closest CdkDrag to an element by looking at the DOM.\n * @param element Element relative to which to look for a cdkDrag.\n * @param openDialogs References to the currently available cdkDrag.\n */\nexport function getClosestWidgetCdkDrag(\n element: ElementRef<HTMLElement>,\n dragDirectives: CdkDrag<any>[],\n) {\n let parent: HTMLElement | null = element.nativeElement.parentElement\n\n while (\n parent &&\n !(\n parent.classList.contains('cdk-drag') &&\n hasAttribute(parent, 'data-widget-id')\n )\n ) {\n parent = parent.parentElement\n }\n\n const parentId = parent ? getAttribute(parent, 'data-widget-id') : null\n return parentId\n ? dragDirectives.find(\n (drag) =>\n getAttribute(drag.getRootElement(), 'data-widget-id') === parentId,\n )\n : null\n}\n","import { AbstractControl } from '@angular/forms'\n\n/**\n * Get the name of the control.\n *\n * Example:\n *\n * ```js\n * const group = new FormGroup({\n * name: new Control(),\n * age: new Control()\n * })\n *\n * for (const c of group.controls) {\n * console.log(getControlName(c))\n * }\n *\n * // Output:\n * // >> 'name'\n * // >> 'age'\n * ```\n */\nexport function getControlName(c: AbstractControl): string | null {\n if (!c.parent) {\n return null\n }\n // NOTE: Typed as 'any' because using string for array index is not valid for\n // array index type, but it works and we actually want the index as a string\n // anyway.\n const controls: any = c.parent.controls\n return Object.keys(controls).find((name) => c === controls[name]) || null\n}\n","import { AbstractControl } from '@angular/forms'\n\nimport { getControlName } from './get-control-name'\n\n/**\n * Get the path to a control.\n *\n * The path is built by walking back the `parent` properties until `parent` is\n * `null`.\n *\n * Example:\n *\n * ```js\n * const group = new FormGroup({\n * name: new FormControl(),\n * address: new FormGroup({\n * city: new FormControl(),\n * state: new FormControl()\n * })\n * })\n *\n * const control = group.get('address.city')\n * console.log(getControlPath(control))\n *\n * // Output:\n * >> 'address.city'\n * ```\n *\n */\nexport function getControlPath(\n c: AbstractControl,\n path: string = '',\n): string | null {\n let _path = path\n _path = getControlName(c) + _path\n\n if (c.parent && getControlName(c.parent)) {\n _path = `.${_path}`\n return getControlPath(c.parent, _path)\n } else {\n return _path\n }\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable, of } from 'rxjs'\nimport { startWith, switchMap } from 'rxjs/operators'\n\n/**\n * Observe the value of a control.\n */\nexport function observeControlValue<T = any>(\n control: AbstractControl,\n): Observable<T> {\n return of(control).pipe(\n switchMap((_control) =>\n _control.valueChanges.pipe(startWith(_control.value)),\n ),\n )\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable } from 'rxjs'\nimport { distinctUntilChanged, map } from 'rxjs/operators'\n\nimport { observeControlValue } from './observe-control-value'\n\n/**\n * Observe the changed state of the input value from the time this function is\n * called.\n *\n * When this function is called the value is stored. Each time the control's\n * value changes the value is compared with the initial value. Currenly the\n * values are compared as stringified objects using `JSON.stringify`.\n *\n * TODO: Allow the value compare implementation to be optionally changed.\n */\nexport function observeControlIsDifferent(\n control: AbstractControl,\n): Observable<boolean> {\n const _initial = JSON.stringify(control.value)\n return observeControlValue(control).pipe(\n map((value) => JSON.stringify(value) !== _initial),\n distinctUntilChanged(),\n )\n}\n","import { AbstractControl } from '@angular/forms'\nimport { interval, merge, Observable } from 'rxjs'\nimport { filter, map, mapTo, startWith, take } from 'rxjs/operators'\n\n/**\n * Wait on the status of a form control to not be `'PENDING'`.\n *\n * NOTE: This function is mainly just a work around for an issue where\n * `statusChanges` sometimes emits `'Pending'` without emitting another state\n * when complete. Seems to happen with async validators if the value changes\n * before completing, even if the validator completes(subscription `complete`\n * if observable).\n */\nexport function waitOnNonPendingStatus(\n control: AbstractControl,\n): Observable<string> {\n return merge(\n control.statusChanges,\n interval(30).pipe(\n mapTo(control),\n map((c) => c.status),\n ),\n )\n .pipe(startWith(control.status))\n .pipe(filter((v) => v !== 'PENDING'))\n .pipe(take(1))\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable, of } from 'rxjs'\nimport { startWith, switchMap } from 'rxjs/operators'\n\nimport { waitOnNonPendingStatus } from './wait-on-non-pending-status'\n\n/**\n * Observe the status of a control using a work around for status not changing\n * after pending.\n */\nexport function observeControlStatus(\n control: AbstractControl,\n): Observable<string> {\n return of(control).pipe(\n switchMap((_control) =>\n _control.statusChanges\n .pipe(startWith(_control.status))\n .pipe(\n switchMap((status) =>\n status === 'PENDING'\n ? waitOnNonPendingStatus(control).pipe(startWith(status))\n : of(status),\n ),\n ),\n ),\n )\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable } from 'rxjs'\nimport { distinctUntilChanged, map, pairwise, startWith } from 'rxjs/operators'\n\nimport { observeControlStatus } from './observe-control-status'\n\n/**\n * Observe the valid state of a control.\n *\n * By default `waitOnPending` is false and the control states map to:\n * 'VALID' => true\n * 'INVALID' => false\n * 'PENDING' => false\n *\n * If `waitOnPending` is true the valid result when 'PENDING' remains the same\n * as it was before 'PENDING' until it is no longer 'PENDING'.\n */\nexport function observeControlValid(\n control: AbstractControl,\n waitOnPending: boolean = false,\n): Observable<boolean> {\n if (waitOnPending) {\n return observeControlStatus(control)\n .pipe(distinctUntilChanged())\n .pipe(startWith(undefined))\n .pipe(pairwise())\n .pipe(map((v) => ({ previous: v[0], current: v[1] })))\n .pipe(map((v) => (v.current === 'PENDING' ? v.previous : v.current)))\n .pipe(map((status) => status === 'VALID'))\n } else {\n return observeControlStatus(control)\n .pipe(distinctUntilChanged())\n .pipe(map((status) => status === 'VALID'))\n }\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable } from 'rxjs'\nimport { map, pairwise, startWith } from 'rxjs/operators'\n\nimport { observeControlValue } from './observe-control-value'\n\n/**\n * Observe the value of a control with the previous.\n */\nexport function observeControlValueChange(\n control: AbstractControl,\n): Observable<{ previous: any; current: any }> {\n return observeControlValue(control).pipe(\n startWith(undefined),\n pairwise(),\n map((v) => ({ previous: v[0], current: v[1] })),\n )\n}\n","// Source: https://stackoverflow.com/a/59361497/7926298\nexport function hasProperty<T extends object, K extends keyof T>(\n style: T,\n prop: K,\n // ): style is T & { [P in K]-?: Exclude<T[K], undefined> } {\n): style is T & Required<Record<K, Exclude<T[K], undefined>>> {\n return (\n Object.prototype.hasOwnProperty.call(style, prop) &&\n style[prop] !== undefined\n )\n}\n","import { AbstractControl } from '@angular/forms'\n\nimport { hasProperty } from '../has-property'\n\n/**\n * Check if control has a required control.\n *\n * ----------------------------------------------------------------------------\n * NOTE: I am not sure about if this should be used or not.\n *\n * From my understanding this assumes that all the validators do not have some\n * unexpected side-effect from being called like this. It could be argued that\n * the validator is flawed and should be fixed if that is the case, but I am not\n * convinced that is correct yet.\n *\n * An example that I think is valid for this argument: A FormControl configured\n * to only check validators when a specific condition happens, because of a\n * reason that it has to do a long process. In that situation should this\n * function be smart enough to consider that or is it up to the validator to\n * consider this function possibly being used.\n *\n * This seems to assume the required validator will always be a synchronous\n * validator. That is a valid assumption if thinking about showing a required\n * state in the UI, but a FormControl does not neccessarily have to be used in\n * UI. So, I think it could be valid to have an async validator that uses the\n * name `required` for it error, but I do not have a good example, so I could be\n * wrong.\n * ----------------------------------------------------------------------------\n *\n * Source: https://gist.github.com/jsdevtom/5589af349a395b37e699b67417ef025b\n * @experimental\n * @ignore\n */\nexport function hasRequiredControl(abstractControl: AbstractControl): boolean {\n if (abstractControl.validator) {\n const validator = abstractControl.validator({} as AbstractControl)\n if (validator && validator.required) {\n return true\n }\n }\n\n const _abstractControl: any = abstractControl\n if (hasProperty(_abstractControl, 'controls')) {\n for (const controlName in _abstractControl.controls) {\n if (_abstractControl.controls[controlName]) {\n if (hasRequiredControl(_abstractControl.controls[controlName])) {\n return true\n }\n }\n }\n }\n\n return false\n}\n","// Source: https://github.com/angular/angular/blob/master/packages/forms/src/validators.ts#L16\nexport function isEmptyInputValue(value: any): boolean {\n // we don't check for string here so it also works with arrays\n return value == null || value.length === 0\n}\n","import { from, Observable } from 'rxjs'\nimport { map, switchMap, toArray } from 'rxjs/operators'\n\nexport function mapEach<T, R>(predicate: (value: T) => R) {\n return (source$: Observable<T[]>): Observable<R[]> =>\n source$.pipe(\n switchMap((v) =>\n from(v).pipe(\n map((m) => predicate(m)),\n toArray(),\n ),\n ),\n )\n}\n","import { Observable } from 'rxjs'\nimport { tap } from 'rxjs/operators'\n\n/**\n * Like tap, but only calls predicate on first emission.\n */\nexport function tapFirst<T>(predicate: (value: T) => void) {\n let _initialized = false\n return (source$: Observable<T>): Observable<T> =>\n source$.pipe(\n tap((v) => {\n if (!_initialized) {\n predicate(v)\n _initialized = true\n }\n }),\n )\n}\n","import { ActivatedRoute } from '@angular/router'\n\nexport function leafChildRoute(activatedRoute: ActivatedRoute): ActivatedRoute {\n let route = activatedRoute\n while (route.firstChild) {\n route = route.firstChild\n }\n return route\n}\n","import { ActivatedRoute } from '@angular/router'\n\nfunction hasRouteConfigDataProp(route: ActivatedRoute, prop: string): boolean {\n return !!(\n route &&\n route.routeConfig &&\n route.routeConfig.data &&\n Object.prototype.hasOwnProperty.call(route.routeConfig.data, prop)\n )\n}\n\nfunction hasRouteConfigResolveProp(\n route: ActivatedRoute,\n prop: string,\n): boolean {\n return !!(\n route &&\n route.routeConfig &&\n route.routeConfig.resolve &&\n Object.prototype.hasOwnProperty.call(route.routeConfig.resolve, prop)\n )\n}\n\nexport function willHaveDataProp(route: ActivatedRoute, prop: string): boolean {\n return (\n hasRouteConfigDataProp(route, prop) ||\n hasRouteConfigResolveProp(route, prop)\n )\n}\n","import { ActivatedRoute, Data } from '@angular/router'\nimport { combineLatest, Observable } from 'rxjs'\nimport { map, switchMap } from 'rxjs/operators'\n\nimport { leafChildRoute } from '../leaf-child-route'\nimport { willHaveDataProp } from '../will-have-data-prop'\n\nexport interface IActivatedRouteWithData {\n route: ActivatedRoute\n data: Data\n}\n\nexport function activatedRoutesWithDataProperty(\n prop: string,\n mustHaveDefined: boolean = false,\n) {\n const _data = (r: ActivatedRoute) =>\n r.data.pipe(map((_d) => ({ route: r, data: _d })))\n return (\n source$: Observable<ActivatedRoute>,\n ): Observable<IActivatedRouteWithData[]> =>\n source$.pipe(\n map((route) => leafChildRoute(route)),\n map((route) => route.pathFromRoot),\n switchMap((routes) => combineLatest(routes.map((r) => _data(r)))),\n map((v) =>\n v.filter((_v) => Object.prototype.hasOwnProperty.call(_v.data, prop)),\n ),\n map((v) =>\n mustHaveDefined\n ? v.filter((_v) => willHaveDataProp(_v.route, prop))\n : v,\n ),\n )\n}\n","import { ActivatedRouteSnapshot } from '@angular/router'\n\nexport function routeSnapshotPathRelative(route: ActivatedRouteSnapshot) {\n return route.url.reduce(\n (path, urlSegment) => `${path}/${urlSegment.path}`,\n '',\n )\n}\n","import { ActivatedRouteSnapshot } from '@angular/router'\n\nimport { routeSnapshotPathRelative } from './route-snapshot-path-relative'\n\nexport function routeSnapshotPathFull(route: ActivatedRouteSnapshot) {\n return route.pathFromRoot.reduce(\n (path, _route) => path + routeSnapshotPathRelative(_route),\n '',\n )\n}\n","import { ActivatedRoute } from '@angular/router'\n\nexport function isEmptyUrlRoute(activatedRoute: ActivatedRoute): boolean {\n return activatedRoute.snapshot.url.length === 0\n}\n","import { FeatureCollection } from 'geojson'\n\n// TODO: Make this more thorough and maybe error on unrecognized.\nexport function coerceFeatureCollection(value: any): FeatureCollection | null {\n return parseValue(value)\n}\n\n/**\n * Parses the value to a FeatureCollection object or null if it is not a\n * FeatureCollection.\n */\nfunction parseValue(value: any): FeatureCollection | null {\n const _value = parseStringValue(value)\n if (isFeatureCollectionValue(_value)) {\n return _value\n }\n return null\n}\n\n/**\n * Tries to parse the value to an object, in case the value is a stringified\n * json.\n */\nfunction parseStringValue(value: any): any {\n if (typeof value === 'string') {\n try {\n return JSON.parse(value)\n } catch {\n return null\n }\n }\n\n return value\n}\n\n/**\n * Checks if the value is a FeatureCollection.\n *\n * NOTE: This is not a thorough FeatureCollection check. It only checks that the\n * value is an object resembling a GeoJSON.FeatureCollection, enough for the\n * validator.\n */\nfunction isFeatureCollectionValue(value: any): value is FeatureCollection {\n if (value === undefined || value === null) {\n return false\n }\n return value.type === 'FeatureCollection' && Array.isArray(value.features)\n}\n","import area from '@turf/area'\nimport { AreaUnits, convertArea } from '@turf/helpers'\nimport {\n GeoJSON,\n Feature,\n FeatureCollection,\n Geometry,\n GeoJsonProperties,\n} from 'geojson'\n\n/**\n *\n */\nexport function geoJsonToArea(\n geoJson:\n | GeoJSON\n | Feature<any, GeoJsonProperties>\n | FeatureCollection<any, GeoJsonProperties>\n | Geometry,\n units: AreaUnits = 'acres',\n): number {\n const areaMSqr = area(geoJson as any)\n const acres = convertArea(areaMSqr, 'meters', units)\n return acres\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport { isEmptyInputValue } from '../form/is-empty-input-value'\nimport { coerceFeatureCollection } from './coerce-feature-collection'\n\nexport const IS_FEATURE_COLLECTION_VALIDATOR_NAME = 'is-feature-collection'\n\nexport function isFeatureCollectionValidator(): ValidatorFn {\n return (control: AbstractControl) => {\n // Don't need to validate if there isn't a value. Use `Validators.required` for that.\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const value = coerceFeatureCollection(control.value)\n\n if (value === null) {\n return {\n [IS_FEATURE_COLLECTION_VALIDATOR_NAME]: {\n reason: `Must be a FeatureCollection.`,\n },\n }\n }\n\n return null\n }\n}\n","import { FeatureCollection, Geometry } from 'geojson'\n\n/**\n * Returns true if the GeoJSON is only specifies geometries.\n */\nexport function isOnlyGeometryTypes(\n featureCollection: FeatureCollection,\n types: Geometry['type'][],\n): boolean {\n if (types.length === 0) {\n if (featureCollection.features.length > 0) {\n // If no types are specified then there can't be any specified types found.\n return false\n } else {\n // If no types are specified and there are no features then there is\n // nothing to say a specified type isn't found.\n return true\n }\n }\n\n for (const f of featureCollection.features) {\n if (types.indexOf(f.geometry.type) === -1) {\n return false\n }\n }\n\n return true\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport { Geometry } from 'geojson'\n\nimport { isEmptyInputValue } from '../form/is-empty-input-value'\nimport { coerceFeatureCollection } from './coerce-feature-collection'\nimport { isOnlyGeometryTypes } from './is-only-geometry-types'\n\nexport const IS_ONLY_GEOMETRY_TYPES_VALIDATOR_NAME = 'is-only-geometry-types'\n\nexport function isOnlyGeometryTypesValidator(\n types: Geometry['type'][],\n): ValidatorFn {\n return (control: AbstractControl) => {\n // Don't need to validate if there isn't a value. Use `Validators.required` for that.\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const value = coerceFeatureCollection(control.value)\n\n if (value === null) {\n // If there isn't a FeatureCollection then there is nothing to validate.\n // Use 'isFeatureCollection' to validate the value is a FeatureCollection.\n return null\n }\n\n if (!isOnlyGeometryTypes(value, types)) {\n const typesNotAllowed = value.features\n .map((f) => f.geometry.type)\n .filter((t) => types.indexOf(t) === -1)\n const distinctTypesNotAllowed = Array.from(new Set(typesNotAllowed))\n return {\n [IS_ONLY_GEOMETRY_TYPES_VALIDATOR_NAME]: {\n reason: `Only geometry type${types.length === 1 ? '' : 's'} ${types.join(', ')} allowed.`,\n notAllowedGeometryTypesFound: distinctTypesNotAllowed,\n },\n }\n }\n\n return null\n }\n}\n","import { Feature, FeatureCollection, MultiPolygon } from 'geojson'\n\n/**\n * Merge Polygon and MultiPolygon geometries into a single MultiPolygon. Any\n * properties, other than 'coordinates', of the Polygons and MultiPolygons will\n * be lost.\n *\n * NOTE: Polygons and MultPolygons in a GeometryCollection will not be merged.\n */\nexport function mergePolygons(featureCollection: FeatureCollection): void {\n const multiPolygon: MultiPolygon = {\n type: 'MultiPolygon',\n coordinates: [],\n }\n\n for (let i = 0; i < featureCollection.features.length; i++) {\n const f = featureCollection.features[i]\n if (f.geometry.type === 'Polygon') {\n multiPolygon.coordinates.push(f.geometry.coordinates)\n featureCollection.features.splice(i, 1)\n i--\n } else if (f.geometry.type === 'MultiPolygon') {\n multiPolygon.coordinates.push(...f.geometry.coordinates)\n featureCollection.features.splice(i, 1)\n i--\n }\n }\n\n if (multiPolygon.coordinates.length > 0) {\n const feature: Feature = {\n type: 'Feature',\n geometry: multiPolygon,\n properties: {},\n }\n featureCollection.features.push(feature)\n }\n}\n","export function notNullOrUndefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport { FeatureCollection } from 'geojson'\n\nimport { isEmptyInputValue } from '../form/is-empty-input-value'\nimport { notNullOrUndefined } from '../not-null-or-undefined'\nimport { coerceFeatureCollection } from './coerce-feature-collection'\n\nexport const MIN_MAX_POINTS_VALIDATOR_NAME = 'min-max-points'\n\nexport function minMaxPointsValidator(\n min: number | undefined = 3,\n max?: number | undefined,\n): ValidatorFn {\n return (control: AbstractControl) => {\n // Don't need to validate if there isn't a value. Use `Validators.required` for that.\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const value = coerceFeatureCollection(control.value)\n\n if (value === null) {\n return null\n }\n\n if (collectionViolatesMinMax(value, min, max)) {\n const reason = notNullOrUndefined(max)\n ? `A polygon must have between ${min} and ${max} points.`\n : `A polygon must have at least ${min} points.`\n return {\n [MIN_MAX_POINTS_VALIDATOR_NAME]: {\n reason,\n },\n }\n }\n return null\n }\n}\n\n/**\n * Checks if a FeatureCollection contains any geometries with an incomplete polygon.\n *\n * NOTE: Does not consider GeometryCollection.\n */\nfunction collectionViolatesMinMax(\n featureCollection: FeatureCollection,\n min: number,\n max: number | undefined,\n): boolean {\n for (const f of featureCollection.features) {\n if (f.geometry.type === 'Polygon') {\n if (polygonViolatesMinMax(f.geometry.coordinates[0].length, min, max)) {\n return true\n }\n } else if (f.geometry.type === 'MultiPolygon') {\n for (const coords of f.geometry.coordinates) {\n if (polygonViolatesMinMax(coords[0].length, min, max)) {\n return true\n }\n }\n }\n }\n\n return false\n}\n\nfunction polygonViolatesMinMax(\n coordinateLength: number,\n min: number,\n max: number | undefined,\n): boolean {\n if (\n coordinateLength < min ||\n (notNullOrUndefined(max) && max > min && coordinateLength > max)\n ) {\n return true\n }\n\n return false\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport { isEmptyInputValue } from '../form/is-empty-input-value'\nimport { coerceFeatureCollection } from './coerce-feature-collection'\n\nexport const NO_EMPTY_FEATURE_COLLECTION_VALIDATOR_NAME =\n 'no-empty-feature-collection'\n\nexport function noEmptyFeatureCollectionValidator(): ValidatorFn {\n return (control: AbstractControl) => {\n // Don't need to validate if there isn't a value. Use `Validators.required` for that.\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const value = coerceFeatureCollection(control.value)\n\n if (value === null) {\n return null\n }\n\n if (value.features.length === 0) {\n return {\n [NO_EMPTY_FEATURE_COLLECTION_VALIDATOR_NAME]: {\n reason: `FeatureCollection must have a value.`,\n },\n }\n }\n\n return null\n }\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport { FeatureCollection } from 'geojson'\n\nimport { isEmptyInputValue } from '../form/is-empty-input-value'\nimport { coerceFeatureCollection } from './coerce-feature-collection'\n\nexport const NO_INNER_RINGS_VALIDATOR_NAME = 'no-inner-rings'\n\n/**\n * Validates that a FeatureCollection does not contain any Polygon with inner\n * rings(\"holes\").\n *\n * NOTE: Only considers Polygon and MultiPolygon. Does not consider\n * GeometryCollection.\n */\nexport function noInnerRingsValidator(): ValidatorFn {\n return (control: AbstractControl) => {\n // Don't need to validate if there isn't a value. Use `Validators.required` for that.\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const value = coerceFeatureCollection(control.value)\n\n if (value === null) {\n // If there isn't a FeatureCollection then there is nothing to validate.\n // Use 'isFeatureCollection' to validate the value is a FeatureCollection.\n return null\n }\n\n if (hasInnerRing(value)) {\n return {\n [NO_INNER_RINGS_VALIDATOR_NAME]: {\n reason: `A shape cannot have an inner ring.`,\n },\n }\n }\n\n return null\n }\n}\n\n/**\n * Checks if a FeatureCollection contains any geometries with an inner\n * ring(\"hole\").\n *\n * NOTE: Does not consider GeometryCollection.\n */\nfunction hasInnerRing(featureCollection: FeatureCollection): boolean {\n for (const f of featureCollection.features) {\n // The spec says the right-hand rule must be followed, but also specifies\n // that tools should not reject polygons that do not follow the right-hand\n // rule. It does specify that the first ring must be the exterior ring and\n // the others must be the interior. So, this should be safe to just check\n // if there are multiple rings, instead of checking their winding orders.\n //\n // Polygon spec: https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6\n if (f.geometry.type === 'Polygon') {\n if (f.geometry.coordinates.length > 1) {\n return true\n }\n } else if (f.geometry.type === 'MultiPolygon') {\n for (const coords of f.geometry.coordinates) {\n if (coords.length > 1) {\n return true\n }\n }\n }\n }\n\n return false\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport kinks from '@turf/kinks'\nimport { Feature, FeatureCollection } from 'geojson'\n\nimport { isEmptyInputValue } from '../form/is-empty-input-value'\nimport { coerceFeatureCollection } from './coerce-feature-collection'\n\nconst kinkableGeometryTypes = [\n 'LineString',\n 'MultiLineString',\n 'MultiPolygon',\n 'Polygon',\n]\n\nexport const NO_KINKS_VALIDATOR_NAME = 'no-kinks'\n\nexport function noKinksValidator(): ValidatorFn {\n return (control: AbstractControl) => {\n // Don't need to validate if there isn't a value. Use `Validators.required` for that.\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const value = coerceFeatureCollection(control.value)\n\n if (value === null) {\n return null\n }\n\n const kinksFound: { feature: Feature; kinks: FeatureCollection }[] = []\n for (const f of value.features) {\n if (kinkableGeometryTypes.indexOf(f.geometry.type) !== -1) {\n const _kinks = kinks(f as any)\n if (_kinks.features.length > 0) {\n kinksFound.push({\n feature: f,\n kinks: _kinks,\n })\n }\n }\n }\n\n if (kinksFound.length > 0) {\n return {\n [NO_KINKS_VALIDATOR_NAME]: {\n reason: 'Paths should not intersect themselves.',\n featuresWithKink: kinksFound,\n },\n }\n }\n\n return null\n }\n}\n","import { fileTypeFromBuffer } from 'file-type'\n\nexport function readFileAsync(file: Blob): Promise<ArrayBuffer | null> {\n return new Promise<ArrayBuffer | null>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as ArrayBuffer | null)\n }\n reader.readAsArrayBuffer(file)\n })\n}\n\nexport async function readFileAsDataUrlAsync(\n file: Blob,\n): Promise<string | null> {\n return new Promise<string | null>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as string | null)\n }\n reader.readAsDataURL(file)\n })\n}\n\n/** Coerce a buffer to an ArrayBuffer suitable for use as a BlobPart. */\nfunction toArrayBuffer(buffer: Uint8Array | ArrayBuffer): ArrayBuffer {\n if (buffer instanceof ArrayBuffer) {\n return buffer\n }\n // Slice to get an owned ArrayBuffer, avoiding SharedArrayBuffer TS issues with BlobPart.\n return buffer.buffer.slice(\n buffer.byteOffset,\n buffer.byteOffset + buffer.byteLength,\n ) as ArrayBuffer\n}\n\nexport async function fileBufferToBlob(\n buffer: Uint8Array | ArrayBuffer,\n defaultMime: string = 'application/octet-stream',\n): Promise<Blob> {\n const fType = await fileTypeFromBuffer(buffer)\n const mime = fType ? fType.mime : defaultMime\n return new Blob([toArrayBuffer(buffer)], { type: mime })\n}\n\nexport async function fileBufferToObjectUrl(\n buffer: Uint8Array | ArrayBuffer,\n defaultMime: string = 'application/octet-stream',\n): Promise<string> {\n const file = await fileBufferToBlob(buffer, defaultMime)\n return URL.createObjectURL(file)\n}\n\nexport interface IFileData {\n ext?: string\n mime?: string\n blob: Blob\n}\n\nexport async function fileDataFromBuffer(\n buffer: Uint8Array | ArrayBuffer,\n defaultMime: string = 'application/octet-stream',\n): Promise<IFileData> {\n const fType = await fileTypeFromBuffer(buffer)\n const ext = fType?.ext\n const mime = fType ? fType.mime : defaultMime\n const blob = new Blob([toArrayBuffer(buffer)], { type: mime })\n return { ext, mime, blob }\n}\n\nexport function openBlob(blob: Blob, target?: string, filename?: string) {\n const url = URL.createObjectURL(blob)\n const win = window.open(url, target)\n // TODO: Consider if always setting opener to null is to restrictive\n // if (win && target && target.toLowerCase() === '_blank') {\n // win.opener = null\n // }\n}\n","/** Returns object without property */\nexport function withoutProperty<T, K extends keyof T>(\n obj: T,\n propName: K,\n): Pick<T, Exclude<keyof T, K>> {\n const { [propName]: _, ...without } = obj\n return without\n}\n\n/** Returns object without properties */\nexport function withoutProperties<T, K extends keyof T>(\n obj: T,\n propNames: K[],\n): Pick<T, Exclude<keyof T, K>> {\n let without: any = obj\n for (const propName of propNames) {\n without = withoutProperty(without, propName)\n }\n return without\n}\n\n/** Delete property of object */\nexport function deleteProperty<T extends object, K extends keyof T>(\n obj: T,\n propName: K,\n): void {\n if (Object.prototype.hasOwnProperty.call(obj, propName)) {\n delete obj[propName]\n }\n}\n\n/** Delete properties of object */\nexport function deleteProperties<T extends object, K extends keyof T>(\n obj: T,\n propNames: K[],\n): void {\n for (const propName of propNames) {\n deleteProperty(obj, propName)\n }\n}\n","import { fileTypeFromBuffer } from 'file-type'\nimport { FeatureCollection } from 'geojson'\nimport shp from 'shpjs'\n\nimport { readFileAsync } from '../file-utils'\nimport { withoutProperty } from '../obj-utils'\n\n/**\n * Reads a File, or buffer of file content, in GeoJSON or ESRI Shapefile format\n * and returns a GeoJSON `FeatureCollection`.\n */\nexport async function readGeoFile(\n fileOrBuffer: File | ArrayBuffer,\n): Promise<FeatureCollection> {\n const buffer = await coerceToArrayBuffer(fileOrBuffer)\n const fType = await fileTypeFromBuffer(buffer)\n\n if (fType?.ext === 'shp') {\n return parseShpFile(buffer)\n } else if (fType?.mime === 'application/zip') {\n return parseShpZip(buffer)\n }\n\n return parseGeoJson(buffer)\n}\n\nasync function coerceToArrayBuffer(\n fileOrBuffer: File | ArrayBuffer,\n): Promise<ArrayBuffer> {\n if (fileOrBuffer instanceof File) {\n const arrBuf = await readFileAsync(fileOrBuffer)\n if (arrBuf === null) {\n throw new Error('Could not read file.')\n }\n return arrBuf\n }\n\n return fileOrBuffer\n}\n\nasync function parseShpFile(buffer: ArrayBuffer): Promise<FeatureCollection> {\n const geometries = await shp.parseShp(buffer, undefined as any)\n const featCollection: FeatureCollection = {\n type: 'FeatureCollection',\n features: geometries.map((geom) => ({\n type: 'Feature',\n geometry: geom,\n properties: {},\n })),\n }\n return featCollection\n}\n\nasync function parseShpZip(buffer: ArrayBuffer): Promise<FeatureCollection> {\n let featCollection = await shp.parseZip(buffer, undefined as any)\n if (Array.isArray(featCollection)) {\n if (featCollection.length === 0) {\n throw Error(`Shape data not found.`)\n } else if (featCollection.length > 1) {\n throw Error(`Multiple shape files not supported.`)\n }\n featCollection = featCollection[0]\n }\n return withoutProperty(featCollection, 'fileName')\n}\n\nfunction parseGeoJson(buffer: ArrayBuffer): FeatureCollection {\n const json = JSON.parse(new TextDecoder().decode(buffer))\n\n if (json?.type === 'FeatureCollection' && Array.isArray(json?.features)) {\n return json as FeatureCollection\n }\n\n throw Error(`Unable to parse as GeoJSON.`)\n}\n","import { Feature, FeatureCollection, MultiPolygon, Polygon } from 'geojson'\n\n/**\n * Split all MultiPolygon into Polygon. Any properties, other than\n * 'coordinates', of the MultiPolygons will be lost.\n *\n * NOTE: MultiPolygons in a GeometryCollection will not be split.\n */\nexport function splitMultiPolygons(featureCollection: FeatureCollection): void {\n for (let i = 0; i < featureCollection.features.length; i++) {\n if (featureCollection.features[i]) {\n const geometry = featureCollection.features[i].geometry\n if (geometry.type === 'MultiPolygon') {\n const features = splitMultPolygon(geometry).map(\n (p) =>\n ({\n type: 'Feature',\n geometry: p,\n properties: {},\n }) as Feature,\n )\n featureCollection.features.splice(i, 1, ...features)\n i += Math.max(features.length - 1, 0)\n }\n }\n }\n}\n\nfunction splitMultPolygon(multiPolygon: MultiPolygon): Polygon[] {\n return multiPolygon.coordinates.map((c) => ({\n type: 'Polygon',\n coordinates: c,\n }))\n}\n","import { Feature, FeatureCollection, MultiPolygon, Polygon } from 'geojson'\n\n/**\n * Close all polygons in the GeoJSON.\n *\n * Google Maps requires that polygons be closed, but not all libraries have that\n * requirement. This may add redundent points to the GeoJSON, but it will ensure\n * that the GeoJSON is valid for Google Maps.\n */\nexport function closePolygons(\n geoJson: FeatureCollection | Feature | Polygon | MultiPolygon,\n) {\n if (geoJson.type === 'FeatureCollection') {\n for (const f of geoJson.features) {\n closePolygonsFeature(f)\n }\n } else if (geoJson.type === 'Feature') {\n closePolygonsFeature(geoJson)\n }\n}\n\nfunction closePolygonsFeature(feature: Feature): void {\n if (feature.geometry.type === 'Polygon') {\n closePolygon(feature.geometry)\n } else if (feature.geometry.type === 'MultiPolygon') {\n closeMultiPolygon(feature.geometry)\n }\n}\n\nfunction closePolygon(polygon: Polygon): void {\n for (const c of polygon.coordinates) {\n c.push(c[0])\n }\n}\n\nfunction closeMultiPolygon(multiPolygon: MultiPolygon): void {\n for (const p of multiPolygon.coordinates) {\n for (const c of p) {\n c.push(c[0])\n }\n }\n}\n","// Based on source: https://github.com/sindresorhus/array-move/blob/main/index.js\n\n/**\n Moves the item to the new position in the input array. Useful for huge arrays\n where absolute performance is needed.\n\n @param array - The array to modify.\n @param fromIndex - The index of item to move. If negative, it will begin that\n many elements from the end.\n @param toIndex - The index of where to move the item. If negative, it will\n begin that many elements from the end.\n @example\n ```\n import { arrayMoveMutable } from '@theseam/ui-common/utils';\n\n const input = ['a', 'b', 'c'];\n arrayMoveMutable(input, 1, 2);\n console.log(input);\n //=> ['a', 'c', 'b']\n ```\n*/\nexport function arrayMoveMutable(\n array: unknown[],\n fromIndex: number,\n toIndex: number,\n): void {\n const startIndex = fromIndex < 0 ? array.length + fromIndex : fromIndex\n\n if (startIndex >= 0 && startIndex < array.length) {\n const endIndex = toIndex < 0 ? array.length + toIndex : toIndex\n\n const [item] = array.splice(fromIndex, 1)\n array.splice(endIndex, 0, item)\n }\n}\n\n/**\n Clones the given `array`, moves the item to a new position in the new array,\n and then returns the new array. The given `array` is not mutated.\n\n @param array - The array with the item to move.\n @param fromIndex - The index of item to move. If negative, it will begin that\n many elements from the end.\n @param toIndex - The index of where to move the item. If negative, it will\n begin that many elements from the end.\n @returns A new array with the item moved to the new position.\n @example\n ```\n import { arrayMoveImmutable } from '@theseam/ui-common/utils';\n\n const input = ['a', 'b', 'c'];\n const array1 = arrayMoveImmutable(input, 1, 2);\n console.log(array1);\n //=> ['a', 'c', 'b']\n\n const array2 = arrayMoveImmutable(input, -1, 0);\n console.log(array2);\n //=> ['c', 'a', 'b']\n\n const array3 = arrayMoveImmutable(input, -2, -3);\n console.log(array3);\n //=> ['b', 'a', 'c']\n ```\n*/\nexport function arrayMoveImmutable<ValueType>(\n array: readonly ValueType[],\n fromIndex: number,\n toIndex: number,\n): ValueType[] {\n const newArray = [...array]\n arrayMoveMutable(newArray, fromIndex, toIndex)\n return newArray\n}\n","export function calcPercentage(total: number, n: number) {\n return total && total > 0 ? (n / total) * 100 : 0\n}\n","/**\n * Polyfil for `Element.toggleAttribute`\n *\n * Toggles a value without a value. Useful for attributes, such as `disabled`,\n * `readonly`, and `hidden`, that only needs to exist on the `Element` without\n * requiring a value.\n *\n * Most browsers natively support this feature, but IE, which we still try to\n * support for at least the main parts of the app, has \"Unknown\" support of this\n * feature. Until IE support is dropped this polyfil should be used to toggle an\n * attribute.\n *\n * Source:\n * https://developer.mozilla.org/en-US/docs/Web/API/Element/toggleAttribute#Polyfill\n */\nexport function toggleAttribute(\n element: HTMLElement,\n name: string,\n force: boolean,\n): boolean {\n let _force = force\n if (_force !== void 0) {\n _force = !!_force\n }\n\n if (element.getAttribute(name) !== null) {\n if (_force) {\n return true\n }\n\n element.removeAttribute(name)\n return false\n } else {\n if (_force === false) {\n return false\n }\n\n element.setAttribute(name, '')\n return true\n }\n}\n","export const phoneNumberMask = [\n '(',\n /[1-9]/,\n /\\d/,\n /\\d/,\n ')',\n ' ',\n /\\d/,\n /\\d/,\n /\\d/,\n '-',\n /\\d/,\n /\\d/,\n /\\d/,\n /\\d/,\n]\n","export function isNullOrUndefined<T>(\n value: T | null | undefined,\n): value is null | undefined {\n return value === undefined || value === null\n}\n","export function isNullOrUndefinedOrEmpty(\n value: string | null | undefined,\n trim: boolean = true,\n): value is string | null | undefined {\n return (\n value === undefined ||\n value === null ||\n (trim ? value.trim() : value).length === 0\n )\n}\n","export function loadStyle(content: string): Promise<HTMLStyleElement> {\n return new Promise((resolve, reject) => {\n const s = document.createElement('style')\n s.onload = () => resolve(s)\n s.onerror = (e) => {\n document.head.removeChild(s)\n reject(e)\n }\n s.innerHTML = content\n document.head.appendChild(s)\n })\n}\n","export function loadStyleSheet(path: string): Promise<HTMLLinkElement> {\n return new Promise((resolve, reject) => {\n const s = document.createElement('link')\n s.onload = () => resolve(s)\n s.onerror = (e) => {\n document.head.removeChild(s)\n reject(e)\n }\n s.rel = 'stylesheet'\n s.href = path\n document.head.appendChild(s)\n })\n}\n","export function notNullOrUndefinedOrEmpty(\n value: string | null | undefined,\n trim: boolean = true,\n): value is string {\n return (\n value !== null &&\n value !== undefined &&\n (trim ? value.trim() : value).length > 0\n )\n}\n","export async function waitOnConditionAsync(\n condition: () => boolean,\n timeoutDuration: number = -1,\n throwOnTimeout: boolean = true,\n): Promise<any> {\n const timeStart: any = new Date()\n\n const _waitFunc = (callbackFn: (boolean: boolean) => any) => {\n let conditionSuccess = false\n\n if (condition()) {\n callbackFn(true)\n conditionSuccess = true\n }\n\n if (!conditionSuccess) {\n const timeNow: any = new Date()\n const duration = timeNow - timeStart\n if (timeoutDuration > -1 && duration > timeoutDuration) {\n if (throwOnTimeout) {\n throw new Error('Timed out waiting on condition.')\n } else {\n callbackFn(false)\n }\n }\n\n setTimeout(() => {\n _waitFunc(callbackFn)\n }, 30)\n }\n }\n\n return new Promise((resolve, reject) => {\n const fn = (b: boolean) => {\n resolve(b)\n }\n _waitFunc(fn)\n })\n}\n","import { isObservable, Observable, Subscriber, Subscription } from 'rxjs'\n\nclass IntervalTimer {\n private _intervalTime: number\n private _intervalId: number | null = null\n\n constructor(\n private _callback: () => void,\n intervalTime: number,\n startOnInit: boolean = true,\n ) {\n this._intervalTime = intervalTime\n if (startOnInit) {\n this.start()\n }\n }\n\n set intervalTime(time: number) {\n this._intervalTime = time\n }\n\n public start(): void {\n if (this._intervalId === null) {\n this._intervalId = window.setInterval(() => {\n this._callback()\n }, this._intervalTime)\n }\n }\n\n public stop(): void {\n if (this._intervalId !== null) {\n clearInterval(this._intervalId)\n this._intervalId = null\n }\n }\n\n public reset(newIntervalTime?: number): void {\n if (newIntervalTime) {\n this.intervalTime = newIntervalTime\n }\n this.stop()\n this.start()\n }\n}\n\nexport type PollingActionFn<R> = () => R | Observable<R>\n\nexport class PollingTickerOptions {\n emitOnInit?: boolean = true\n}\n\n// TODO: Simplify complexity.\n\n/**\n * Call an action and emits the result to its subscriber on an interval or when\n * ticker emits. When the ticker emits, the interval time will reset.\n *\n * When subscribed to, the action will be called and emitted right away unless\n * the `emitOnInit` option is set to false.\n */\nexport function pollingTicker<R>(\n action: PollingActionFn<R>,\n pollingInterval?: number,\n ticker?: Observable<number | void>,\n options?: PollingTickerOptions,\n): Observable<R> {\n return new Observable((subscriber: Subscriber<R>) => {\n const _opts = { ...new PollingTickerOptions(), ...(options || {}) }\n\n let timer: IntervalTimer | null = null\n let actionSub: Subscription | null = null\n let tickerSub: Subscription | null = null\n\n try {\n const handleAction = () => {\n if (timer) {\n timer.stop()\n }\n\n const actionResult = action()\n\n if (isObservable(actionResult)) {\n if (actionSub) {\n actionSub.unsubscribe()\n }\n actionSub = actionResult.subscribe(\n (v: R) => {\n subscriber.next(v)\n if (timer) {\n timer.reset()\n }\n },\n (err) => {\n subscriber.error(err)\n },\n () => {\n actionSub = null\n if (timer) {\n timer.start()\n }\n },\n )\n } else {\n subscriber.next(actionResult)\n }\n if (timer) {\n timer.start()\n }\n }\n\n if (_opts.emitOnInit) {\n handleAction()\n }\n\n if (pollingInterval) {\n timer = new IntervalTimer(() => {\n handleAction()\n }, pollingInterval)\n }\n\n if (ticker) {\n tickerSub = ticker.subscribe((newPollingInterval) => {\n if (newPollingInterval && timer) {\n timer.stop()\n if (newPollingInterval) {\n timer.intervalTime = newPollingInterval\n }\n }\n handleAction()\n if (timer) {\n timer.reset()\n }\n })\n }\n } catch (err) {\n subscriber.error(err)\n }\n\n return () => {\n if (timer) {\n timer.stop()\n }\n if (actionSub) {\n actionSub.unsubscribe()\n }\n if (tickerSub) {\n tickerSub.unsubscribe()\n }\n }\n })\n}\n","import { BehaviorSubject, isObservable, Observable, Subject } from 'rxjs'\nimport {\n distinctUntilChanged,\n mapTo,\n publishReplay,\n refCount,\n shareReplay,\n skip,\n take,\n tap,\n} from 'rxjs/operators'\n\nimport { tapFirst } from './operators/tap-first'\nimport { pollingTicker } from './polling-ticker'\n\nexport class Refreshable<T> {\n private _initialized = false\n private _pollingInterval = new BehaviorSubject<number>(0)\n private _ticker = new Subject<void>()\n private _pending = new BehaviorSubject<boolean>(false)\n\n public data$: Observable<T>\n public pending$: Observable<boolean>\n\n constructor(action: () => T | Observable<T>, pollingInterval?: number) {\n if (pollingInterval !== null && pollingInterval !== undefined) {\n this._pollingInterval.next(pollingInterval)\n }\n\n this.pending$ = this._pending\n .asObservable()\n .pipe(distinctUntilChanged(), shareReplay(1))\n\n this.data$ = pollingTicker(\n this._actionHandler(action),\n pollingInterval,\n this._ticker,\n ).pipe(\n tapFirst(() => (this._initialized = true)),\n publishReplay(),\n refCount(),\n )\n }\n\n get initialized(): boolean {\n return this._initialized\n }\n\n /**\n * Intercepts the action call to monitor pending state\n */\n private _actionHandler = (action: () => T | Observable<T>) => {\n return () => {\n this._pending.next(true)\n\n const actionResult = action()\n if (isObservable(actionResult)) {\n return actionResult.pipe(\n tap(() => {\n this._pending.next(false)\n }),\n )\n } else {\n this._pending.next(true)\n return actionResult\n }\n }\n }\n\n /**\n * Selects the data observable\n */\n public select(refresh?: boolean): Observable<T> {\n if (refresh && this._initialized && !this._pending.value) {\n this._ticker.next()\n }\n return this.data$\n }\n\n public refresh(): Observable<void> {\n let result$: Observable<any>\n\n if (this._initialized) {\n // TODO: Add a test and maybe refactor this to be more clear. It worked in\n // my manual tests, but there may be some situations where this doesn't\n // work, since the ticker isn't the only way to trigger a refresh. Right\n // now it should be fine, but if an async operator is added to be run\n // each time `data$` is subscribed to, then this could fail if the data\n // emits one extra time before the ticker is triggered.\n let _polled = false\n result$ = this.data$.pipe(\n tap((_) => !_polled && (_polled = true) && this._ticker.next()),\n skip(1),\n )\n } else {\n result$ = this.data$\n }\n\n return result$.pipe(take(1), mapTo(undefined))\n }\n}\n","import { from, isObservable, Observable } from 'rxjs'\n\nexport function wrapIntoObservable<T>(\n value: T | Promise<T> | Observable<T>,\n): Observable<T> {\n if (isObservable(value)) {\n return value\n }\n\n return from(Promise.resolve(value))\n}\n","/**\n * Explaination:\n * ^ - beginning of the string\n * (?: - beginning of a non-captured group\n * [a-z]+ - any character of 'a' to 'z' 1 or more times\n * : - string (colon character)\n * )? - end of the non-captured group. Group appearing 0 or 1 times\n * // - string (two forward slash characters)\n * 'i' - non case-sensitive flag\n *\n * source: https://stackoverflow.com/a/19709846\n */\nconst IS_ABSOLUTE_URL_REGEX = new RegExp('^(?:[a-z]+:)?//', 'i')\n\nexport function isAbsoluteUrl(url: string): boolean {\n return IS_ABSOLUTE_URL_REGEX.test(url)\n}\n","import { Observable, Subscriber } from 'rxjs'\n\nexport type SubscriberCountChangedFn = (\n description: string,\n count: number,\n reason: 'subscribed' | 'unsubscribed',\n) => void\n\n/**\n * This is just for helping debug observables that aren't being unsubscribed\n * from correctly.\n *\n * If description is 'foo' then you can check the how many observers are\n * subscribed with the expression `__subscriberCounts['foo']`. In a debugger you\n * can add the expression to the \"Watch\" expressions or in Chrome Devtools\n * Console you can add it to the live expressions(Add live expressions by\n * clicking the eye the the left of the Console filter input).\n */\nexport function subscriberCount<T>(\n sourceObservable: Observable<T>,\n description: string,\n countChangedFn: SubscriberCountChangedFn | undefined | null = logOnChange,\n) {\n let counter = 0\n return new Observable((subscriber: Subscriber<T>) => {\n const subscription = sourceObservable.subscribe(subscriber)\n counter++\n if (countChangedFn !== undefined && countChangedFn !== null) {\n countChangedFn(description, counter, 'subscribed')\n }\n setGlobalSubscriberCount(description, counter)\n\n return () => {\n subscription.unsubscribe()\n counter--\n if (countChangedFn !== undefined && countChangedFn !== null) {\n countChangedFn(description, counter, 'unsubscribed')\n }\n setGlobalSubscriberCount(description, counter)\n }\n })\n}\n\nconst logOnChange: SubscriberCountChangedFn = (\n description: string,\n count: number,\n reason: 'subscribed' | 'unsubscribed',\n) => {\n // eslint-disable-next-line no-console\n console.log(`${description} subscriptions: ${count} [${reason}]`)\n}\n\nfunction getGlobalSubscriberCounts(): { [description: string]: number } {\n const w = window as any\n if (w.__subscriberCounts === undefined || w.__subscriberCounts === null) {\n w.__subscriberCounts = {}\n }\n return w.__subscriberCounts\n}\n\nfunction setGlobalSubscriberCount(description: string, count: number): void {\n getGlobalSubscriberCounts()[description] = count\n}\n","import { QueryList } from '@angular/core'\nimport { Observable } from 'rxjs'\nimport { map, startWith } from 'rxjs/operators'\n\nexport function observeQueryList<T>(\n queryList: QueryList<T>,\n emitCurrentValue = true,\n): Observable<T[]> {\n return queryList.changes.pipe(\n startWith(queryList),\n map((v) => v.toArray() as T[]),\n )\n}\n","export function createPadding(len: number, chars: string): string {\n // if (chars.length <= len) {\n // return chars\n // }\n\n if (chars.length === 0) {\n throw Error(`Padding characters must be at least 1 char length.`)\n }\n\n let str = chars\n while (str.length < len) {\n str += chars\n }\n\n if (str.length > len) {\n str = str.slice(0, len)\n }\n\n return str\n}\n","import { createPadding } from './create-padding'\n\nexport function padEnd(\n stringToPad: string,\n paddingLength: number | undefined = 0,\n paddingChars: string | undefined = ' ',\n): string {\n const strLength = paddingLength ? stringToPad.length : 0\n\n if (!paddingLength || strLength >= paddingLength) {\n return stringToPad\n }\n\n return stringToPad + createPadding(paddingLength - strLength, paddingChars)\n}\n","import { createPadding } from './create-padding'\n\nexport function padStart(\n stringToPad: string,\n paddingLength: number | undefined = 0,\n paddingChars: string | undefined = ' ',\n): string {\n const strLength = paddingLength ? stringToPad.length : 0\n\n if (!paddingLength || strLength >= paddingLength) {\n return stringToPad\n }\n\n return createPadding(paddingLength - strLength, paddingChars) + stringToPad\n}\n","export function isNumeric(value: any): boolean {\n return !isNaN(Number(value) - parseFloat(value))\n}\n","import { isNumeric } from './is-numeric'\n\n/**\n * Returns the number of fractional digits.\n *\n * NOTE: This is intended for input validation, so trailing 0's will be included\n * in the total. Also, localization is not considered, so '.' is assumed to be\n * the fractional separator.\n */\nexport function fractionalDigitsCount(value: string): number | null {\n if (!isNumeric(value)) {\n return null\n }\n\n const a = value.split('.')\n if (a.length !== 2) {\n return null\n }\n\n return a[1].length\n}\n","// NOTE: Based on https://www.npmjs.com/package/strip-outer\n\nconst escapeRegExp = (s: string) =>\n s.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d')\n\n/**\n * Strip a substring from the start/end of a string.\n */\nexport function stripOuter(input: string, substring: string): string {\n const escaped = escapeRegExp(substring)\n return input.replace(new RegExp(`^${escaped}|${escaped}$`, 'g'), '')\n}\n","// NOTE: Based on https://www.npmjs.com/package/trim-repeated\n\nconst escapeRegExp = (s: string) =>\n s.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d')\n\n/**\n * Trim a consecutively repeated substring: foo--bar---baz → foo-bar-baz.\n */\nexport function trimRepeated(str: string, target: string): string {\n return str.replace(new RegExp(`(?:${escapeRegExp(target)}){2,}`, 'g'), target)\n}\n","import { stripOuter } from './strip-outer'\nimport { trimRepeated } from './trim-repeated'\n\n// NOTE: Mostly based on https://www.npmjs.com/package/filenamify\n\nconst MAX_FILENAME_LENGTH = 100\n\n// eslint-disable-next-line no-control-regex\nconst reReserved = /[<>:\"/\\\\|?*\\x00-\\x1F]/g\nconst reWindowsNames = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])$/i\nconst reControlChars = /[\\u0000-\\u001f\\u0080-\\u009f]/g // eslint-disable-line no-control-regex\nconst reRelativePath = /^\\.+/\n\nexport interface SanitizeFilenameOptions {\n /**\n * Replacement string.\n *\n * @default '_'\n */\n replacement?: string\n /**\n * Max file length.\n *\n * @default 100\n */\n maxLength?: number\n}\n\nconst defaultOptions: SanitizeFilenameOptions = {\n replacement: '_',\n maxLength: MAX_FILENAME_LENGTH,\n}\n\nexport function sanitizeFilename(\n filename: string,\n options?: SanitizeFilenameOptions,\n): string {\n const opts = {\n ...defaultOptions,\n ...(options || {}),\n }\n\n const replacement = opts.replacement === undefined ? '!' : opts.replacement\n\n if (reReserved.test(replacement) && reControlChars.test(replacement)) {\n throw new Error(\n 'Replacement string cannot contain reserved filename characters',\n )\n }\n\n let s = filename\n\n s = s.replace(reReserved, replacement)\n s = s.replace(reControlChars, replacement)\n s = s.replace(reRelativePath, replacement)\n\n if (replacement.length > 0) {\n s = trimRepeated(s, replacement)\n s = s.length > 1 ? stripOuter(s, replacement) : s\n }\n\n s = reWindowsNames.test(s) ? s + replacement : s\n s = s.slice(0, opts.maxLength)\n\n return s\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["escapeRegExp"],"mappings":";;;;;;;;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,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC;IACnD;AAEA,IAAA,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,WAAW,GAAG,CAAC;IAChD,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC;AAE9B,IAAA,OAAO,CAAC;AACV;;ACjEA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"theseam-ui-common-utils.mjs","sources":["../../../projects/ui-common/utils/get-attribute.ts","../../../projects/ui-common/utils/has-attribute.ts","../../../projects/ui-common/utils/cdk/get-closest-widget-cdk-drag.ts","../../../projects/ui-common/utils/form/get-control-name.ts","../../../projects/ui-common/utils/form/get-control-path.ts","../../../projects/ui-common/utils/form/observe-control-value.ts","../../../projects/ui-common/utils/form/observe-control-is-different.ts","../../../projects/ui-common/utils/form/wait-on-non-pending-status.ts","../../../projects/ui-common/utils/form/observe-control-status.ts","../../../projects/ui-common/utils/form/observe-control-valid.ts","../../../projects/ui-common/utils/form/observe-control-value-change.ts","../../../projects/ui-common/utils/has-property.ts","../../../projects/ui-common/utils/form/has-required-control.ts","../../../projects/ui-common/utils/form/is-empty-input-value.ts","../../../projects/ui-common/utils/operators/map-each.ts","../../../projects/ui-common/utils/operators/tap-first.ts","../../../projects/ui-common/utils/router/leaf-child-route.ts","../../../projects/ui-common/utils/router/will-have-data-prop.ts","../../../projects/ui-common/utils/router/operators/activated-routes-with-data-property.ts","../../../projects/ui-common/utils/router/route-snapshot-path-relative.ts","../../../projects/ui-common/utils/router/route-snapshot-path-full.ts","../../../projects/ui-common/utils/router/is-empty-url-route.ts","../../../projects/ui-common/utils/geo-json/coerce-feature-collection.ts","../../../projects/ui-common/utils/geo-json/geo-json-to-area.ts","../../../projects/ui-common/utils/geo-json/is-feature-collection.validator.ts","../../../projects/ui-common/utils/geo-json/is-only-geometry-types.ts","../../../projects/ui-common/utils/geo-json/is-only-geometry-types.validator.ts","../../../projects/ui-common/utils/geo-json/merge-polygons.ts","../../../projects/ui-common/utils/not-null-or-undefined.ts","../../../projects/ui-common/utils/geo-json/min-max-points.validator.ts","../../../projects/ui-common/utils/geo-json/no-empty-feature-collection.validator.ts","../../../projects/ui-common/utils/geo-json/no-inner-rings.validator.ts","../../../projects/ui-common/utils/geo-json/no-kinks.validator.ts","../../../projects/ui-common/utils/file-utils.ts","../../../projects/ui-common/utils/obj-utils.ts","../../../projects/ui-common/utils/geo-json/read-geo-file.ts","../../../projects/ui-common/utils/geo-json/split-multi-polygons.ts","../../../projects/ui-common/utils/geo-json/close-polygons.ts","../../../projects/ui-common/utils/array-move.ts","../../../projects/ui-common/utils/calc-percentage.ts","../../../projects/ui-common/utils/toggle-attribute.ts","../../../projects/ui-common/utils/input-masks.ts","../../../projects/ui-common/utils/is-null-or-undefined.ts","../../../projects/ui-common/utils/is-null-or-undefined-or-empty.ts","../../../projects/ui-common/utils/load-style.ts","../../../projects/ui-common/utils/load-style-sheet.ts","../../../projects/ui-common/utils/not-null-or-undefined-or-empty.ts","../../../projects/ui-common/utils/wait-on-condition-async.ts","../../../projects/ui-common/utils/polling-ticker.ts","../../../projects/ui-common/utils/refreshable.ts","../../../projects/ui-common/utils/wrap-into-observable.ts","../../../projects/ui-common/utils/is-absolute-url.ts","../../../projects/ui-common/utils/subscriber-count.ts","../../../projects/ui-common/utils/observe-query-list.ts","../../../projects/ui-common/utils/create-padding.ts","../../../projects/ui-common/utils/pad-end.ts","../../../projects/ui-common/utils/pad-start.ts","../../../projects/ui-common/utils/is-numeric.ts","../../../projects/ui-common/utils/fractional-digits-count.ts","../../../projects/ui-common/utils/strip-outer.ts","../../../projects/ui-common/utils/trim-repeated.ts","../../../projects/ui-common/utils/sanitize-filename.ts","../../../projects/ui-common/utils/theseam-ui-common-utils.ts"],"sourcesContent":["/**\n *\n */\nexport function getAttribute<E extends HTMLElement>(\n element: E,\n name: string,\n): string | null {\n return element.getAttribute(name)\n}\n","/**\n *\n */\nexport function hasAttribute<E extends HTMLElement>(\n element: E,\n name: string,\n): boolean {\n return element.hasAttribute(name)\n}\n","import { CdkDrag } from '@angular/cdk/drag-drop'\nimport { ElementRef } from '@angular/core'\n\nimport { getAttribute } from '../get-attribute'\nimport { hasAttribute } from '../has-attribute'\n\n/**\n * Finds the closest CdkDrag to an element by looking at the DOM.\n * @param element Element relative to which to look for a cdkDrag.\n * @param openDialogs References to the currently available cdkDrag.\n */\nexport function getClosestWidgetCdkDrag(\n element: ElementRef<HTMLElement>,\n dragDirectives: CdkDrag<any>[],\n) {\n let parent: HTMLElement | null = element.nativeElement.parentElement\n\n while (\n parent &&\n !(\n parent.classList.contains('cdk-drag') &&\n hasAttribute(parent, 'data-widget-id')\n )\n ) {\n parent = parent.parentElement\n }\n\n const parentId = parent ? getAttribute(parent, 'data-widget-id') : null\n return parentId\n ? dragDirectives.find(\n (drag) =>\n getAttribute(drag.getRootElement(), 'data-widget-id') === parentId,\n )\n : null\n}\n","import { AbstractControl } from '@angular/forms'\n\n/**\n * Get the name of the control.\n *\n * Example:\n *\n * ```js\n * const group = new FormGroup({\n * name: new Control(),\n * age: new Control()\n * })\n *\n * for (const c of group.controls) {\n * console.log(getControlName(c))\n * }\n *\n * // Output:\n * // >> 'name'\n * // >> 'age'\n * ```\n */\nexport function getControlName(c: AbstractControl): string | null {\n if (!c.parent) {\n return null\n }\n // NOTE: Typed as 'any' because using string for array index is not valid for\n // array index type, but it works and we actually want the index as a string\n // anyway.\n const controls: any = c.parent.controls\n return Object.keys(controls).find((name) => c === controls[name]) || null\n}\n","import { AbstractControl } from '@angular/forms'\n\nimport { getControlName } from './get-control-name'\n\n/**\n * Get the path to a control.\n *\n * The path is built by walking back the `parent` properties until `parent` is\n * `null`.\n *\n * Example:\n *\n * ```js\n * const group = new FormGroup({\n * name: new FormControl(),\n * address: new FormGroup({\n * city: new FormControl(),\n * state: new FormControl()\n * })\n * })\n *\n * const control = group.get('address.city')\n * console.log(getControlPath(control))\n *\n * // Output:\n * >> 'address.city'\n * ```\n *\n */\nexport function getControlPath(\n c: AbstractControl,\n path: string = '',\n): string | null {\n let _path = path\n _path = getControlName(c) + _path\n\n if (c.parent && getControlName(c.parent)) {\n _path = `.${_path}`\n return getControlPath(c.parent, _path)\n } else {\n return _path\n }\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable, of } from 'rxjs'\nimport { startWith, switchMap } from 'rxjs/operators'\n\n/**\n * Observe the value of a control.\n */\nexport function observeControlValue<T = any>(\n control: AbstractControl,\n): Observable<T> {\n return of(control).pipe(\n switchMap((_control) =>\n _control.valueChanges.pipe(startWith(_control.value)),\n ),\n )\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable } from 'rxjs'\nimport { distinctUntilChanged, map } from 'rxjs/operators'\n\nimport { observeControlValue } from './observe-control-value'\n\n/**\n * Observe the changed state of the input value from the time this function is\n * called.\n *\n * When this function is called the value is stored. Each time the control's\n * value changes the value is compared with the initial value. Currenly the\n * values are compared as stringified objects using `JSON.stringify`.\n *\n * TODO: Allow the value compare implementation to be optionally changed.\n */\nexport function observeControlIsDifferent(\n control: AbstractControl,\n): Observable<boolean> {\n const _initial = JSON.stringify(control.value)\n return observeControlValue(control).pipe(\n map((value) => JSON.stringify(value) !== _initial),\n distinctUntilChanged(),\n )\n}\n","import { AbstractControl } from '@angular/forms'\nimport { interval, merge, Observable } from 'rxjs'\nimport { filter, map, mapTo, startWith, take } from 'rxjs/operators'\n\n/**\n * Wait on the status of a form control to not be `'PENDING'`.\n *\n * NOTE: This function is mainly just a work around for an issue where\n * `statusChanges` sometimes emits `'Pending'` without emitting another state\n * when complete. Seems to happen with async validators if the value changes\n * before completing, even if the validator completes(subscription `complete`\n * if observable).\n */\nexport function waitOnNonPendingStatus(\n control: AbstractControl,\n): Observable<string> {\n return merge(\n control.statusChanges,\n interval(30).pipe(\n mapTo(control),\n map((c) => c.status),\n ),\n )\n .pipe(startWith(control.status))\n .pipe(filter((v) => v !== 'PENDING'))\n .pipe(take(1))\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable, of } from 'rxjs'\nimport { startWith, switchMap } from 'rxjs/operators'\n\nimport { waitOnNonPendingStatus } from './wait-on-non-pending-status'\n\n/**\n * Observe the status of a control using a work around for status not changing\n * after pending.\n */\nexport function observeControlStatus(\n control: AbstractControl,\n): Observable<string> {\n return of(control).pipe(\n switchMap((_control) =>\n _control.statusChanges\n .pipe(startWith(_control.status))\n .pipe(\n switchMap((status) =>\n status === 'PENDING'\n ? waitOnNonPendingStatus(control).pipe(startWith(status))\n : of(status),\n ),\n ),\n ),\n )\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable } from 'rxjs'\nimport { distinctUntilChanged, map, pairwise, startWith } from 'rxjs/operators'\n\nimport { observeControlStatus } from './observe-control-status'\n\n/**\n * Observe the valid state of a control.\n *\n * By default `waitOnPending` is false and the control states map to:\n * 'VALID' => true\n * 'INVALID' => false\n * 'PENDING' => false\n *\n * If `waitOnPending` is true the valid result when 'PENDING' remains the same\n * as it was before 'PENDING' until it is no longer 'PENDING'.\n */\nexport function observeControlValid(\n control: AbstractControl,\n waitOnPending: boolean = false,\n): Observable<boolean> {\n if (waitOnPending) {\n return observeControlStatus(control)\n .pipe(distinctUntilChanged())\n .pipe(startWith(undefined))\n .pipe(pairwise())\n .pipe(map((v) => ({ previous: v[0], current: v[1] })))\n .pipe(map((v) => (v.current === 'PENDING' ? v.previous : v.current)))\n .pipe(map((status) => status === 'VALID'))\n } else {\n return observeControlStatus(control)\n .pipe(distinctUntilChanged())\n .pipe(map((status) => status === 'VALID'))\n }\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable } from 'rxjs'\nimport { map, pairwise, startWith } from 'rxjs/operators'\n\nimport { observeControlValue } from './observe-control-value'\n\n/**\n * Observe the value of a control with the previous.\n */\nexport function observeControlValueChange(\n control: AbstractControl,\n): Observable<{ previous: any; current: any }> {\n return observeControlValue(control).pipe(\n startWith(undefined),\n pairwise(),\n map((v) => ({ previous: v[0], current: v[1] })),\n )\n}\n","// Source: https://stackoverflow.com/a/59361497/7926298\nexport function hasProperty<T extends object, K extends keyof T>(\n style: T,\n prop: K,\n // ): style is T & { [P in K]-?: Exclude<T[K], undefined> } {\n): style is T & Required<Record<K, Exclude<T[K], undefined>>> {\n return (\n Object.prototype.hasOwnProperty.call(style, prop) &&\n style[prop] !== undefined\n )\n}\n","import { AbstractControl } from '@angular/forms'\n\nimport { hasProperty } from '../has-property'\n\n/**\n * Check if control has a required control.\n *\n * ----------------------------------------------------------------------------\n * NOTE: I am not sure about if this should be used or not.\n *\n * From my understanding this assumes that all the validators do not have some\n * unexpected side-effect from being called like this. It could be argued that\n * the validator is flawed and should be fixed if that is the case, but I am not\n * convinced that is correct yet.\n *\n * An example that I think is valid for this argument: A FormControl configured\n * to only check validators when a specific condition happens, because of a\n * reason that it has to do a long process. In that situation should this\n * function be smart enough to consider that or is it up to the validator to\n * consider this function possibly being used.\n *\n * This seems to assume the required validator will always be a synchronous\n * validator. That is a valid assumption if thinking about showing a required\n * state in the UI, but a FormControl does not neccessarily have to be used in\n * UI. So, I think it could be valid to have an async validator that uses the\n * name `required` for it error, but I do not have a good example, so I could be\n * wrong.\n * ----------------------------------------------------------------------------\n *\n * Source: https://gist.github.com/jsdevtom/5589af349a395b37e699b67417ef025b\n * @experimental\n * @ignore\n */\nexport function hasRequiredControl(abstractControl: AbstractControl): boolean {\n if (abstractControl.validator) {\n const validator = abstractControl.validator({} as AbstractControl)\n if (validator && validator.required) {\n return true\n }\n }\n\n const _abstractControl: any = abstractControl\n if (hasProperty(_abstractControl, 'controls')) {\n for (const controlName in _abstractControl.controls) {\n if (_abstractControl.controls[controlName]) {\n if (hasRequiredControl(_abstractControl.controls[controlName])) {\n return true\n }\n }\n }\n }\n\n return false\n}\n","// Source: https://github.com/angular/angular/blob/master/packages/forms/src/validators.ts#L16\nexport function isEmptyInputValue(value: any): boolean {\n // we don't check for string here so it also works with arrays\n return value == null || value.length === 0\n}\n","import { from, Observable } from 'rxjs'\nimport { map, switchMap, toArray } from 'rxjs/operators'\n\nexport function mapEach<T, R>(predicate: (value: T) => R) {\n return (source$: Observable<T[]>): Observable<R[]> =>\n source$.pipe(\n switchMap((v) =>\n from(v).pipe(\n map((m) => predicate(m)),\n toArray(),\n ),\n ),\n )\n}\n","import { Observable } from 'rxjs'\nimport { tap } from 'rxjs/operators'\n\n/**\n * Like tap, but only calls predicate on first emission.\n */\nexport function tapFirst<T>(predicate: (value: T) => void) {\n let _initialized = false\n return (source$: Observable<T>): Observable<T> =>\n source$.pipe(\n tap((v) => {\n if (!_initialized) {\n predicate(v)\n _initialized = true\n }\n }),\n )\n}\n","import { ActivatedRoute } from '@angular/router'\n\nexport function leafChildRoute(activatedRoute: ActivatedRoute): ActivatedRoute {\n let route = activatedRoute\n while (route.firstChild) {\n route = route.firstChild\n }\n return route\n}\n","import { ActivatedRoute } from '@angular/router'\n\nfunction hasRouteConfigDataProp(route: ActivatedRoute, prop: string): boolean {\n return !!(\n route &&\n route.routeConfig &&\n route.routeConfig.data &&\n Object.prototype.hasOwnProperty.call(route.routeConfig.data, prop)\n )\n}\n\nfunction hasRouteConfigResolveProp(\n route: ActivatedRoute,\n prop: string,\n): boolean {\n return !!(\n route &&\n route.routeConfig &&\n route.routeConfig.resolve &&\n Object.prototype.hasOwnProperty.call(route.routeConfig.resolve, prop)\n )\n}\n\nexport function willHaveDataProp(route: ActivatedRoute, prop: string): boolean {\n return (\n hasRouteConfigDataProp(route, prop) ||\n hasRouteConfigResolveProp(route, prop)\n )\n}\n","import { ActivatedRoute, Data } from '@angular/router'\nimport { combineLatest, Observable } from 'rxjs'\nimport { map, switchMap } from 'rxjs/operators'\n\nimport { leafChildRoute } from '../leaf-child-route'\nimport { willHaveDataProp } from '../will-have-data-prop'\n\nexport interface IActivatedRouteWithData {\n route: ActivatedRoute\n data: Data\n}\n\nexport function activatedRoutesWithDataProperty(\n prop: string,\n mustHaveDefined: boolean = false,\n) {\n const _data = (r: ActivatedRoute) =>\n r.data.pipe(map((_d) => ({ route: r, data: _d })))\n return (\n source$: Observable<ActivatedRoute>,\n ): Observable<IActivatedRouteWithData[]> =>\n source$.pipe(\n map((route) => leafChildRoute(route)),\n map((route) => route.pathFromRoot),\n switchMap((routes) => combineLatest(routes.map((r) => _data(r)))),\n map((v) =>\n v.filter((_v) => Object.prototype.hasOwnProperty.call(_v.data, prop)),\n ),\n map((v) =>\n mustHaveDefined\n ? v.filter((_v) => willHaveDataProp(_v.route, prop))\n : v,\n ),\n )\n}\n","import { ActivatedRouteSnapshot } from '@angular/router'\n\nexport function routeSnapshotPathRelative(route: ActivatedRouteSnapshot) {\n return route.url.reduce(\n (path, urlSegment) => `${path}/${urlSegment.path}`,\n '',\n )\n}\n","import { ActivatedRouteSnapshot } from '@angular/router'\n\nimport { routeSnapshotPathRelative } from './route-snapshot-path-relative'\n\nexport function routeSnapshotPathFull(route: ActivatedRouteSnapshot) {\n return route.pathFromRoot.reduce(\n (path, _route) => path + routeSnapshotPathRelative(_route),\n '',\n )\n}\n","import { ActivatedRoute } from '@angular/router'\n\nexport function isEmptyUrlRoute(activatedRoute: ActivatedRoute): boolean {\n return activatedRoute.snapshot.url.length === 0\n}\n","import { FeatureCollection } from 'geojson'\n\n// TODO: Make this more thorough and maybe error on unrecognized.\nexport function coerceFeatureCollection(value: any): FeatureCollection | null {\n return parseValue(value)\n}\n\n/**\n * Parses the value to a FeatureCollection object or null if it is not a\n * FeatureCollection.\n */\nfunction parseValue(value: any): FeatureCollection | null {\n const _value = parseStringValue(value)\n if (isFeatureCollectionValue(_value)) {\n return _value\n }\n return null\n}\n\n/**\n * Tries to parse the value to an object, in case the value is a stringified\n * json.\n */\nfunction parseStringValue(value: any): any {\n if (typeof value === 'string') {\n try {\n return JSON.parse(value)\n } catch {\n return null\n }\n }\n\n return value\n}\n\n/**\n * Checks if the value is a FeatureCollection.\n *\n * NOTE: This is not a thorough FeatureCollection check. It only checks that the\n * value is an object resembling a GeoJSON.FeatureCollection, enough for the\n * validator.\n */\nfunction isFeatureCollectionValue(value: any): value is FeatureCollection {\n if (value === undefined || value === null) {\n return false\n }\n return value.type === 'FeatureCollection' && Array.isArray(value.features)\n}\n","import area from '@turf/area'\nimport { AreaUnits, convertArea } from '@turf/helpers'\nimport {\n GeoJSON,\n Feature,\n FeatureCollection,\n Geometry,\n GeoJsonProperties,\n} from 'geojson'\n\n/**\n *\n */\nexport function geoJsonToArea(\n geoJson:\n | GeoJSON\n | Feature<any, GeoJsonProperties>\n | FeatureCollection<any, GeoJsonProperties>\n | Geometry,\n units: AreaUnits = 'acres',\n): number {\n const areaMSqr = area(geoJson as any)\n const acres = convertArea(areaMSqr, 'meters', units)\n return acres\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport { isEmptyInputValue } from '../form/is-empty-input-value'\nimport { coerceFeatureCollection } from './coerce-feature-collection'\n\nexport const IS_FEATURE_COLLECTION_VALIDATOR_NAME = 'is-feature-collection'\n\nexport function isFeatureCollectionValidator(): ValidatorFn {\n return (control: AbstractControl) => {\n // Don't need to validate if there isn't a value. Use `Validators.required` for that.\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const value = coerceFeatureCollection(control.value)\n\n if (value === null) {\n return {\n [IS_FEATURE_COLLECTION_VALIDATOR_NAME]: {\n reason: `Must be a FeatureCollection.`,\n },\n }\n }\n\n return null\n }\n}\n","import { FeatureCollection, Geometry } from 'geojson'\n\n/**\n * Returns true if the GeoJSON is only specifies geometries.\n */\nexport function isOnlyGeometryTypes(\n featureCollection: FeatureCollection,\n types: Geometry['type'][],\n): boolean {\n if (types.length === 0) {\n if (featureCollection.features.length > 0) {\n // If no types are specified then there can't be any specified types found.\n return false\n } else {\n // If no types are specified and there are no features then there is\n // nothing to say a specified type isn't found.\n return true\n }\n }\n\n for (const f of featureCollection.features) {\n if (types.indexOf(f.geometry.type) === -1) {\n return false\n }\n }\n\n return true\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport { Geometry } from 'geojson'\n\nimport { isEmptyInputValue } from '../form/is-empty-input-value'\nimport { coerceFeatureCollection } from './coerce-feature-collection'\nimport { isOnlyGeometryTypes } from './is-only-geometry-types'\n\nexport const IS_ONLY_GEOMETRY_TYPES_VALIDATOR_NAME = 'is-only-geometry-types'\n\nexport function isOnlyGeometryTypesValidator(\n types: Geometry['type'][],\n): ValidatorFn {\n return (control: AbstractControl) => {\n // Don't need to validate if there isn't a value. Use `Validators.required` for that.\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const value = coerceFeatureCollection(control.value)\n\n if (value === null) {\n // If there isn't a FeatureCollection then there is nothing to validate.\n // Use 'isFeatureCollection' to validate the value is a FeatureCollection.\n return null\n }\n\n if (!isOnlyGeometryTypes(value, types)) {\n const typesNotAllowed = value.features\n .map((f) => f.geometry.type)\n .filter((t) => types.indexOf(t) === -1)\n const distinctTypesNotAllowed = Array.from(new Set(typesNotAllowed))\n return {\n [IS_ONLY_GEOMETRY_TYPES_VALIDATOR_NAME]: {\n reason: `Only geometry type${types.length === 1 ? '' : 's'} ${types.join(', ')} allowed.`,\n notAllowedGeometryTypesFound: distinctTypesNotAllowed,\n },\n }\n }\n\n return null\n }\n}\n","import { Feature, FeatureCollection, MultiPolygon } from 'geojson'\n\n/**\n * Merge Polygon and MultiPolygon geometries into a single MultiPolygon. Any\n * properties, other than 'coordinates', of the Polygons and MultiPolygons will\n * be lost.\n *\n * NOTE: Polygons and MultPolygons in a GeometryCollection will not be merged.\n */\nexport function mergePolygons(featureCollection: FeatureCollection): void {\n const multiPolygon: MultiPolygon = {\n type: 'MultiPolygon',\n coordinates: [],\n }\n\n for (let i = 0; i < featureCollection.features.length; i++) {\n const f = featureCollection.features[i]\n if (f.geometry.type === 'Polygon') {\n multiPolygon.coordinates.push(f.geometry.coordinates)\n featureCollection.features.splice(i, 1)\n i--\n } else if (f.geometry.type === 'MultiPolygon') {\n multiPolygon.coordinates.push(...f.geometry.coordinates)\n featureCollection.features.splice(i, 1)\n i--\n }\n }\n\n if (multiPolygon.coordinates.length > 0) {\n const feature: Feature = {\n type: 'Feature',\n geometry: multiPolygon,\n properties: {},\n }\n featureCollection.features.push(feature)\n }\n}\n","export function notNullOrUndefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport { FeatureCollection } from 'geojson'\n\nimport { isEmptyInputValue } from '../form/is-empty-input-value'\nimport { notNullOrUndefined } from '../not-null-or-undefined'\nimport { coerceFeatureCollection } from './coerce-feature-collection'\n\nexport const MIN_MAX_POINTS_VALIDATOR_NAME = 'min-max-points'\n\nexport function minMaxPointsValidator(\n min: number | undefined = 3,\n max?: number | undefined,\n): ValidatorFn {\n return (control: AbstractControl) => {\n // Don't need to validate if there isn't a value. Use `Validators.required` for that.\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const value = coerceFeatureCollection(control.value)\n\n if (value === null) {\n return null\n }\n\n if (collectionViolatesMinMax(value, min, max)) {\n const reason = notNullOrUndefined(max)\n ? `A polygon must have between ${min} and ${max} points.`\n : `A polygon must have at least ${min} points.`\n return {\n [MIN_MAX_POINTS_VALIDATOR_NAME]: {\n reason,\n },\n }\n }\n return null\n }\n}\n\n/**\n * Checks if a FeatureCollection contains any geometries with an incomplete polygon.\n *\n * NOTE: Does not consider GeometryCollection.\n */\nfunction collectionViolatesMinMax(\n featureCollection: FeatureCollection,\n min: number,\n max: number | undefined,\n): boolean {\n for (const f of featureCollection.features) {\n if (f.geometry.type === 'Polygon') {\n if (polygonViolatesMinMax(f.geometry.coordinates[0].length, min, max)) {\n return true\n }\n } else if (f.geometry.type === 'MultiPolygon') {\n for (const coords of f.geometry.coordinates) {\n if (polygonViolatesMinMax(coords[0].length, min, max)) {\n return true\n }\n }\n }\n }\n\n return false\n}\n\nfunction polygonViolatesMinMax(\n coordinateLength: number,\n min: number,\n max: number | undefined,\n): boolean {\n if (\n coordinateLength < min ||\n (notNullOrUndefined(max) && max > min && coordinateLength > max)\n ) {\n return true\n }\n\n return false\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport { isEmptyInputValue } from '../form/is-empty-input-value'\nimport { coerceFeatureCollection } from './coerce-feature-collection'\n\nexport const NO_EMPTY_FEATURE_COLLECTION_VALIDATOR_NAME =\n 'no-empty-feature-collection'\n\nexport function noEmptyFeatureCollectionValidator(): ValidatorFn {\n return (control: AbstractControl) => {\n // Don't need to validate if there isn't a value. Use `Validators.required` for that.\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const value = coerceFeatureCollection(control.value)\n\n if (value === null) {\n return null\n }\n\n if (value.features.length === 0) {\n return {\n [NO_EMPTY_FEATURE_COLLECTION_VALIDATOR_NAME]: {\n reason: `FeatureCollection must have a value.`,\n },\n }\n }\n\n return null\n }\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport { FeatureCollection } from 'geojson'\n\nimport { isEmptyInputValue } from '../form/is-empty-input-value'\nimport { coerceFeatureCollection } from './coerce-feature-collection'\n\nexport const NO_INNER_RINGS_VALIDATOR_NAME = 'no-inner-rings'\n\n/**\n * Validates that a FeatureCollection does not contain any Polygon with inner\n * rings(\"holes\").\n *\n * NOTE: Only considers Polygon and MultiPolygon. Does not consider\n * GeometryCollection.\n */\nexport function noInnerRingsValidator(): ValidatorFn {\n return (control: AbstractControl) => {\n // Don't need to validate if there isn't a value. Use `Validators.required` for that.\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const value = coerceFeatureCollection(control.value)\n\n if (value === null) {\n // If there isn't a FeatureCollection then there is nothing to validate.\n // Use 'isFeatureCollection' to validate the value is a FeatureCollection.\n return null\n }\n\n if (hasInnerRing(value)) {\n return {\n [NO_INNER_RINGS_VALIDATOR_NAME]: {\n reason: `A shape cannot have an inner ring.`,\n },\n }\n }\n\n return null\n }\n}\n\n/**\n * Checks if a FeatureCollection contains any geometries with an inner\n * ring(\"hole\").\n *\n * NOTE: Does not consider GeometryCollection.\n */\nfunction hasInnerRing(featureCollection: FeatureCollection): boolean {\n for (const f of featureCollection.features) {\n // The spec says the right-hand rule must be followed, but also specifies\n // that tools should not reject polygons that do not follow the right-hand\n // rule. It does specify that the first ring must be the exterior ring and\n // the others must be the interior. So, this should be safe to just check\n // if there are multiple rings, instead of checking their winding orders.\n //\n // Polygon spec: https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6\n if (f.geometry.type === 'Polygon') {\n if (f.geometry.coordinates.length > 1) {\n return true\n }\n } else if (f.geometry.type === 'MultiPolygon') {\n for (const coords of f.geometry.coordinates) {\n if (coords.length > 1) {\n return true\n }\n }\n }\n }\n\n return false\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport kinks from '@turf/kinks'\nimport { Feature, FeatureCollection } from 'geojson'\n\nimport { isEmptyInputValue } from '../form/is-empty-input-value'\nimport { coerceFeatureCollection } from './coerce-feature-collection'\n\nconst kinkableGeometryTypes = [\n 'LineString',\n 'MultiLineString',\n 'MultiPolygon',\n 'Polygon',\n]\n\nexport const NO_KINKS_VALIDATOR_NAME = 'no-kinks'\n\nexport function noKinksValidator(): ValidatorFn {\n return (control: AbstractControl) => {\n // Don't need to validate if there isn't a value. Use `Validators.required` for that.\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const value = coerceFeatureCollection(control.value)\n\n if (value === null) {\n return null\n }\n\n const kinksFound: { feature: Feature; kinks: FeatureCollection }[] = []\n for (const f of value.features) {\n if (kinkableGeometryTypes.indexOf(f.geometry.type) !== -1) {\n const _kinks = kinks(f as any)\n if (_kinks.features.length > 0) {\n kinksFound.push({\n feature: f,\n kinks: _kinks,\n })\n }\n }\n }\n\n if (kinksFound.length > 0) {\n return {\n [NO_KINKS_VALIDATOR_NAME]: {\n reason: 'Paths should not intersect themselves.',\n featuresWithKink: kinksFound,\n },\n }\n }\n\n return null\n }\n}\n","import { fileTypeFromBuffer } from 'file-type'\n\nexport function readFileAsync(file: Blob): Promise<ArrayBuffer | null> {\n return new Promise<ArrayBuffer | null>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as ArrayBuffer | null)\n }\n reader.readAsArrayBuffer(file)\n })\n}\n\nexport async function readFileAsDataUrlAsync(\n file: Blob,\n): Promise<string | null> {\n return new Promise<string | null>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as string | null)\n }\n reader.readAsDataURL(file)\n })\n}\n\n/** Coerce a buffer to an ArrayBuffer suitable for use as a BlobPart. */\nfunction toArrayBuffer(buffer: Uint8Array | ArrayBuffer): ArrayBuffer {\n if (buffer instanceof ArrayBuffer) {\n return buffer\n }\n // Slice to get an owned ArrayBuffer, avoiding SharedArrayBuffer TS issues with BlobPart.\n return buffer.buffer.slice(\n buffer.byteOffset,\n buffer.byteOffset + buffer.byteLength,\n ) as ArrayBuffer\n}\n\nexport async function fileBufferToBlob(\n buffer: Uint8Array | ArrayBuffer,\n defaultMime: string = 'application/octet-stream',\n): Promise<Blob> {\n const fType = await fileTypeFromBuffer(buffer)\n const mime = fType ? fType.mime : defaultMime\n return new Blob([toArrayBuffer(buffer)], { type: mime })\n}\n\nexport async function fileBufferToObjectUrl(\n buffer: Uint8Array | ArrayBuffer,\n defaultMime: string = 'application/octet-stream',\n): Promise<string> {\n const file = await fileBufferToBlob(buffer, defaultMime)\n return URL.createObjectURL(file)\n}\n\nexport interface IFileData {\n ext?: string\n mime?: string\n blob: Blob\n}\n\nexport async function fileDataFromBuffer(\n buffer: Uint8Array | ArrayBuffer,\n defaultMime: string = 'application/octet-stream',\n): Promise<IFileData> {\n const fType = await fileTypeFromBuffer(buffer)\n const ext = fType?.ext\n const mime = fType ? fType.mime : defaultMime\n const blob = new Blob([toArrayBuffer(buffer)], { type: mime })\n return { ext, mime, blob }\n}\n\nexport function openBlob(blob: Blob, target?: string, filename?: string) {\n const url = URL.createObjectURL(blob)\n const win = window.open(url, target)\n // TODO: Consider if always setting opener to null is to restrictive\n // if (win && target && target.toLowerCase() === '_blank') {\n // win.opener = null\n // }\n}\n","/** Returns object without property */\nexport function withoutProperty<T, K extends keyof T>(\n obj: T,\n propName: K,\n): Pick<T, Exclude<keyof T, K>> {\n const { [propName]: _, ...without } = obj\n return without\n}\n\n/** Returns object without properties */\nexport function withoutProperties<T, K extends keyof T>(\n obj: T,\n propNames: K[],\n): Pick<T, Exclude<keyof T, K>> {\n let without: any = obj\n for (const propName of propNames) {\n without = withoutProperty(without, propName)\n }\n return without\n}\n\n/** Delete property of object */\nexport function deleteProperty<T extends object, K extends keyof T>(\n obj: T,\n propName: K,\n): void {\n if (Object.prototype.hasOwnProperty.call(obj, propName)) {\n delete obj[propName]\n }\n}\n\n/** Delete properties of object */\nexport function deleteProperties<T extends object, K extends keyof T>(\n obj: T,\n propNames: K[],\n): void {\n for (const propName of propNames) {\n deleteProperty(obj, propName)\n }\n}\n","import { fileTypeFromBuffer } from 'file-type'\nimport { FeatureCollection } from 'geojson'\nimport shp from 'shpjs'\n\nimport { readFileAsync } from '../file-utils'\nimport { withoutProperty } from '../obj-utils'\n\n/**\n * Reads a File, or buffer of file content, in GeoJSON or ESRI Shapefile format\n * and returns a GeoJSON `FeatureCollection`.\n */\nexport async function readGeoFile(\n fileOrBuffer: File | ArrayBuffer,\n): Promise<FeatureCollection> {\n const buffer = await coerceToArrayBuffer(fileOrBuffer)\n const fType = await fileTypeFromBuffer(buffer)\n\n if (fType?.ext === 'shp') {\n return parseShpFile(buffer)\n } else if (fType?.mime === 'application/zip') {\n return parseShpZip(buffer)\n }\n\n return parseGeoJson(buffer)\n}\n\nasync function coerceToArrayBuffer(\n fileOrBuffer: File | ArrayBuffer,\n): Promise<ArrayBuffer> {\n if (fileOrBuffer instanceof File) {\n const arrBuf = await readFileAsync(fileOrBuffer)\n if (arrBuf === null) {\n throw new Error('Could not read file.')\n }\n return arrBuf\n }\n\n return fileOrBuffer\n}\n\nasync function parseShpFile(buffer: ArrayBuffer): Promise<FeatureCollection> {\n const geometries = await shp.parseShp(buffer, undefined as any)\n const featCollection: FeatureCollection = {\n type: 'FeatureCollection',\n features: geometries.map((geom) => ({\n type: 'Feature',\n geometry: geom,\n properties: {},\n })),\n }\n return featCollection\n}\n\nasync function parseShpZip(buffer: ArrayBuffer): Promise<FeatureCollection> {\n let featCollection = await shp.parseZip(buffer, undefined as any)\n if (Array.isArray(featCollection)) {\n if (featCollection.length === 0) {\n throw Error(`Shape data not found.`)\n } else if (featCollection.length > 1) {\n throw Error(`Multiple shape files not supported.`)\n }\n featCollection = featCollection[0]\n }\n return withoutProperty(featCollection, 'fileName')\n}\n\nfunction parseGeoJson(buffer: ArrayBuffer): FeatureCollection {\n const json = JSON.parse(new TextDecoder().decode(buffer))\n\n if (json?.type === 'FeatureCollection' && Array.isArray(json?.features)) {\n return json as FeatureCollection\n }\n\n throw Error(`Unable to parse as GeoJSON.`)\n}\n","import { Feature, FeatureCollection, MultiPolygon, Polygon } from 'geojson'\n\n/**\n * Split all MultiPolygon into Polygon. Any properties, other than\n * 'coordinates', of the MultiPolygons will be lost.\n *\n * NOTE: MultiPolygons in a GeometryCollection will not be split.\n */\nexport function splitMultiPolygons(featureCollection: FeatureCollection): void {\n for (let i = 0; i < featureCollection.features.length; i++) {\n if (featureCollection.features[i]) {\n const geometry = featureCollection.features[i].geometry\n if (geometry.type === 'MultiPolygon') {\n const features = splitMultPolygon(geometry).map(\n (p) =>\n ({\n type: 'Feature',\n geometry: p,\n properties: {},\n }) as Feature,\n )\n featureCollection.features.splice(i, 1, ...features)\n i += Math.max(features.length - 1, 0)\n }\n }\n }\n}\n\nfunction splitMultPolygon(multiPolygon: MultiPolygon): Polygon[] {\n return multiPolygon.coordinates.map((c) => ({\n type: 'Polygon',\n coordinates: c,\n }))\n}\n","import { Feature, FeatureCollection, MultiPolygon, Polygon } from 'geojson'\n\n/**\n * Close all polygons in the GeoJSON.\n *\n * Google Maps requires that polygons be closed, but not all libraries have that\n * requirement. This may add redundent points to the GeoJSON, but it will ensure\n * that the GeoJSON is valid for Google Maps.\n */\nexport function closePolygons(\n geoJson: FeatureCollection | Feature | Polygon | MultiPolygon,\n) {\n if (geoJson.type === 'FeatureCollection') {\n for (const f of geoJson.features) {\n closePolygonsFeature(f)\n }\n } else if (geoJson.type === 'Feature') {\n closePolygonsFeature(geoJson)\n }\n}\n\nfunction closePolygonsFeature(feature: Feature): void {\n if (feature.geometry.type === 'Polygon') {\n closePolygon(feature.geometry)\n } else if (feature.geometry.type === 'MultiPolygon') {\n closeMultiPolygon(feature.geometry)\n }\n}\n\nfunction closePolygon(polygon: Polygon): void {\n for (const c of polygon.coordinates) {\n c.push(c[0])\n }\n}\n\nfunction closeMultiPolygon(multiPolygon: MultiPolygon): void {\n for (const p of multiPolygon.coordinates) {\n for (const c of p) {\n c.push(c[0])\n }\n }\n}\n","// Based on source: https://github.com/sindresorhus/array-move/blob/main/index.js\n\n/**\n Moves the item to the new position in the input array. Useful for huge arrays\n where absolute performance is needed.\n\n @param array - The array to modify.\n @param fromIndex - The index of item to move. If negative, it will begin that\n many elements from the end.\n @param toIndex - The index of where to move the item. If negative, it will\n begin that many elements from the end.\n @example\n ```\n import { arrayMoveMutable } from '@theseam/ui-common/utils';\n\n const input = ['a', 'b', 'c'];\n arrayMoveMutable(input, 1, 2);\n console.log(input);\n //=> ['a', 'c', 'b']\n ```\n*/\nexport function arrayMoveMutable(\n array: unknown[],\n fromIndex: number,\n toIndex: number,\n): void {\n const startIndex = fromIndex < 0 ? array.length + fromIndex : fromIndex\n\n if (startIndex >= 0 && startIndex < array.length) {\n const endIndex = toIndex < 0 ? array.length + toIndex : toIndex\n\n const [item] = array.splice(fromIndex, 1)\n array.splice(endIndex, 0, item)\n }\n}\n\n/**\n Clones the given `array`, moves the item to a new position in the new array,\n and then returns the new array. The given `array` is not mutated.\n\n @param array - The array with the item to move.\n @param fromIndex - The index of item to move. If negative, it will begin that\n many elements from the end.\n @param toIndex - The index of where to move the item. If negative, it will\n begin that many elements from the end.\n @returns A new array with the item moved to the new position.\n @example\n ```\n import { arrayMoveImmutable } from '@theseam/ui-common/utils';\n\n const input = ['a', 'b', 'c'];\n const array1 = arrayMoveImmutable(input, 1, 2);\n console.log(array1);\n //=> ['a', 'c', 'b']\n\n const array2 = arrayMoveImmutable(input, -1, 0);\n console.log(array2);\n //=> ['c', 'a', 'b']\n\n const array3 = arrayMoveImmutable(input, -2, -3);\n console.log(array3);\n //=> ['b', 'a', 'c']\n ```\n*/\nexport function arrayMoveImmutable<ValueType>(\n array: readonly ValueType[],\n fromIndex: number,\n toIndex: number,\n): ValueType[] {\n const newArray = [...array]\n arrayMoveMutable(newArray, fromIndex, toIndex)\n return newArray\n}\n","export function calcPercentage(total: number, n: number) {\n return total && total > 0 ? (n / total) * 100 : 0\n}\n","/**\n * Polyfil for `Element.toggleAttribute`\n *\n * Toggles a value without a value. Useful for attributes, such as `disabled`,\n * `readonly`, and `hidden`, that only needs to exist on the `Element` without\n * requiring a value.\n *\n * Most browsers natively support this feature, but IE, which we still try to\n * support for at least the main parts of the app, has \"Unknown\" support of this\n * feature. Until IE support is dropped this polyfil should be used to toggle an\n * attribute.\n *\n * Source:\n * https://developer.mozilla.org/en-US/docs/Web/API/Element/toggleAttribute#Polyfill\n */\nexport function toggleAttribute(\n element: HTMLElement,\n name: string,\n force: boolean,\n): boolean {\n let _force = force\n if (_force !== void 0) {\n _force = !!_force\n }\n\n if (element.getAttribute(name) !== null) {\n if (_force) {\n return true\n }\n\n element.removeAttribute(name)\n return false\n } else {\n if (_force === false) {\n return false\n }\n\n element.setAttribute(name, '')\n return true\n }\n}\n","export const phoneNumberMask = [\n '(',\n /[1-9]/,\n /\\d/,\n /\\d/,\n ')',\n ' ',\n /\\d/,\n /\\d/,\n /\\d/,\n '-',\n /\\d/,\n /\\d/,\n /\\d/,\n /\\d/,\n]\n","export function isNullOrUndefined<T>(\n value: T | null | undefined,\n): value is null | undefined {\n return value === undefined || value === null\n}\n","export function isNullOrUndefinedOrEmpty(\n value: string | null | undefined,\n trim: boolean = true,\n): value is string | null | undefined {\n return (\n value === undefined ||\n value === null ||\n (trim ? value.trim() : value).length === 0\n )\n}\n","export function loadStyle(content: string): Promise<HTMLStyleElement> {\n return new Promise((resolve, reject) => {\n const s = document.createElement('style')\n s.onload = () => resolve(s)\n s.onerror = (e) => {\n document.head.removeChild(s)\n reject(e)\n }\n s.innerHTML = content\n document.head.appendChild(s)\n })\n}\n","export function loadStyleSheet(path: string): Promise<HTMLLinkElement> {\n return new Promise((resolve, reject) => {\n const s = document.createElement('link')\n s.onload = () => resolve(s)\n s.onerror = (e) => {\n document.head.removeChild(s)\n reject(e)\n }\n s.rel = 'stylesheet'\n s.href = path\n document.head.appendChild(s)\n })\n}\n","export function notNullOrUndefinedOrEmpty(\n value: string | null | undefined,\n trim: boolean = true,\n): value is string {\n return (\n value !== null &&\n value !== undefined &&\n (trim ? value.trim() : value).length > 0\n )\n}\n","export async function waitOnConditionAsync(\n condition: () => boolean,\n timeoutDuration: number = -1,\n throwOnTimeout: boolean = true,\n): Promise<any> {\n const timeStart: any = new Date()\n\n const _waitFunc = (callbackFn: (boolean: boolean) => any) => {\n let conditionSuccess = false\n\n if (condition()) {\n callbackFn(true)\n conditionSuccess = true\n }\n\n if (!conditionSuccess) {\n const timeNow: any = new Date()\n const duration = timeNow - timeStart\n if (timeoutDuration > -1 && duration > timeoutDuration) {\n if (throwOnTimeout) {\n throw new Error('Timed out waiting on condition.')\n } else {\n callbackFn(false)\n }\n }\n\n setTimeout(() => {\n _waitFunc(callbackFn)\n }, 30)\n }\n }\n\n return new Promise((resolve, reject) => {\n const fn = (b: boolean) => {\n resolve(b)\n }\n _waitFunc(fn)\n })\n}\n","import { isObservable, Observable, Subscriber, Subscription } from 'rxjs'\n\nclass IntervalTimer {\n private _intervalTime: number\n private _intervalId: number | null = null\n\n constructor(\n private _callback: () => void,\n intervalTime: number,\n startOnInit: boolean = true,\n ) {\n this._intervalTime = intervalTime\n if (startOnInit) {\n this.start()\n }\n }\n\n set intervalTime(time: number) {\n this._intervalTime = time\n }\n\n public start(): void {\n if (this._intervalId === null) {\n this._intervalId = window.setInterval(() => {\n this._callback()\n }, this._intervalTime)\n }\n }\n\n public stop(): void {\n if (this._intervalId !== null) {\n clearInterval(this._intervalId)\n this._intervalId = null\n }\n }\n\n public reset(newIntervalTime?: number): void {\n if (newIntervalTime) {\n this.intervalTime = newIntervalTime\n }\n this.stop()\n this.start()\n }\n}\n\nexport type PollingActionFn<R> = () => R | Observable<R>\n\nexport class PollingTickerOptions {\n emitOnInit?: boolean = true\n}\n\n// TODO: Simplify complexity.\n\n/**\n * Call an action and emits the result to its subscriber on an interval or when\n * ticker emits. When the ticker emits, the interval time will reset.\n *\n * When subscribed to, the action will be called and emitted right away unless\n * the `emitOnInit` option is set to false.\n */\nexport function pollingTicker<R>(\n action: PollingActionFn<R>,\n pollingInterval?: number,\n ticker?: Observable<number | void>,\n options?: PollingTickerOptions,\n): Observable<R> {\n return new Observable((subscriber: Subscriber<R>) => {\n const _opts = { ...new PollingTickerOptions(), ...(options || {}) }\n\n let timer: IntervalTimer | null = null\n let actionSub: Subscription | null = null\n let tickerSub: Subscription | null = null\n\n try {\n const handleAction = () => {\n if (timer) {\n timer.stop()\n }\n\n const actionResult = action()\n\n if (isObservable(actionResult)) {\n if (actionSub) {\n actionSub.unsubscribe()\n }\n actionSub = actionResult.subscribe(\n (v: R) => {\n subscriber.next(v)\n if (timer) {\n timer.reset()\n }\n },\n (err) => {\n subscriber.error(err)\n },\n () => {\n actionSub = null\n if (timer) {\n timer.start()\n }\n },\n )\n } else {\n subscriber.next(actionResult)\n }\n if (timer) {\n timer.start()\n }\n }\n\n if (_opts.emitOnInit) {\n handleAction()\n }\n\n if (pollingInterval) {\n timer = new IntervalTimer(() => {\n handleAction()\n }, pollingInterval)\n }\n\n if (ticker) {\n tickerSub = ticker.subscribe((newPollingInterval) => {\n if (newPollingInterval && timer) {\n timer.stop()\n if (newPollingInterval) {\n timer.intervalTime = newPollingInterval\n }\n }\n handleAction()\n if (timer) {\n timer.reset()\n }\n })\n }\n } catch (err) {\n subscriber.error(err)\n }\n\n return () => {\n if (timer) {\n timer.stop()\n }\n if (actionSub) {\n actionSub.unsubscribe()\n }\n if (tickerSub) {\n tickerSub.unsubscribe()\n }\n }\n })\n}\n","import { BehaviorSubject, EMPTY, merge, Observable, Subject } from 'rxjs'\nimport {\n auditTime,\n distinctUntilChanged,\n filter,\n map,\n share,\n startWith,\n switchMap,\n tap,\n} from 'rxjs/operators'\n\nexport interface RefreshableOptions<T> {\n action: () => Observable<T>\n invalidate$?: Observable<unknown>\n poll$?: Observable<unknown>\n}\n\nconst NO_VALUE: unique symbol = Symbol('refreshable.no-value')\ntype Cached<T> = T | typeof NO_VALUE\n\nexport class Refreshable<T> {\n private readonly _refresh$ = new Subject<void>()\n private readonly _cache$ = new BehaviorSubject<Cached<T>>(NO_VALUE)\n private readonly _loading$ = new BehaviorSubject<boolean>(false)\n private _dataSubCount = 0\n\n public readonly loading$: Observable<boolean> = this._loading$.pipe(\n distinctUntilChanged(),\n )\n\n public readonly initialized$: Observable<boolean> = this._cache$.pipe(\n map((v) => v !== NO_VALUE),\n distinctUntilChanged(),\n )\n\n public readonly data$: Observable<T>\n\n constructor(opts: RefreshableOptions<T>) {\n const { action } = opts\n\n const invalidateSig$ = (opts.invalidate$ ?? EMPTY).pipe(\n tap(() => this._cache$.next(NO_VALUE)),\n )\n\n const driver$ = merge(\n this._refresh$,\n opts.poll$ ?? EMPTY,\n invalidateSig$,\n ).pipe(\n startWith(undefined as unknown),\n auditTime(0),\n tap(() => this._loading$.next(true)),\n switchMap(() => action()),\n tap({\n next: (v) => {\n this._cache$.next(v)\n this._loading$.next(false)\n },\n error: () => this._loading$.next(false),\n }),\n share({\n resetOnRefCountZero: true,\n resetOnComplete: true,\n resetOnError: true,\n }),\n )\n\n this.data$ = new Observable<T>((subscriber) => {\n this._dataSubCount++\n const driverSub = driver$.subscribe({\n error: (e) => subscriber.error(e),\n })\n const cacheSub = this._cache$\n .pipe(filter((v): v is T => v !== NO_VALUE))\n .subscribe(subscriber)\n return () => {\n cacheSub.unsubscribe()\n driverSub.unsubscribe()\n this._dataSubCount--\n if (this._dataSubCount === 0) {\n this._cache$.next(NO_VALUE)\n this._loading$.next(false)\n }\n }\n })\n }\n\n public refresh(): void {\n this._refresh$.next()\n }\n}\n","import { from, isObservable, Observable } from 'rxjs'\n\nexport function wrapIntoObservable<T>(\n value: T | Promise<T> | Observable<T>,\n): Observable<T> {\n if (isObservable(value)) {\n return value\n }\n\n return from(Promise.resolve(value))\n}\n","/**\n * Explaination:\n * ^ - beginning of the string\n * (?: - beginning of a non-captured group\n * [a-z]+ - any character of 'a' to 'z' 1 or more times\n * : - string (colon character)\n * )? - end of the non-captured group. Group appearing 0 or 1 times\n * // - string (two forward slash characters)\n * 'i' - non case-sensitive flag\n *\n * source: https://stackoverflow.com/a/19709846\n */\nconst IS_ABSOLUTE_URL_REGEX = new RegExp('^(?:[a-z]+:)?//', 'i')\n\nexport function isAbsoluteUrl(url: string): boolean {\n return IS_ABSOLUTE_URL_REGEX.test(url)\n}\n","import { Observable, Subscriber } from 'rxjs'\n\nexport type SubscriberCountChangedFn = (\n description: string,\n count: number,\n reason: 'subscribed' | 'unsubscribed',\n) => void\n\n/**\n * This is just for helping debug observables that aren't being unsubscribed\n * from correctly.\n *\n * If description is 'foo' then you can check the how many observers are\n * subscribed with the expression `__subscriberCounts['foo']`. In a debugger you\n * can add the expression to the \"Watch\" expressions or in Chrome Devtools\n * Console you can add it to the live expressions(Add live expressions by\n * clicking the eye the the left of the Console filter input).\n */\nexport function subscriberCount<T>(\n sourceObservable: Observable<T>,\n description: string,\n countChangedFn: SubscriberCountChangedFn | undefined | null = logOnChange,\n) {\n let counter = 0\n return new Observable((subscriber: Subscriber<T>) => {\n const subscription = sourceObservable.subscribe(subscriber)\n counter++\n if (countChangedFn !== undefined && countChangedFn !== null) {\n countChangedFn(description, counter, 'subscribed')\n }\n setGlobalSubscriberCount(description, counter)\n\n return () => {\n subscription.unsubscribe()\n counter--\n if (countChangedFn !== undefined && countChangedFn !== null) {\n countChangedFn(description, counter, 'unsubscribed')\n }\n setGlobalSubscriberCount(description, counter)\n }\n })\n}\n\nconst logOnChange: SubscriberCountChangedFn = (\n description: string,\n count: number,\n reason: 'subscribed' | 'unsubscribed',\n) => {\n // eslint-disable-next-line no-console\n console.log(`${description} subscriptions: ${count} [${reason}]`)\n}\n\nfunction getGlobalSubscriberCounts(): { [description: string]: number } {\n const w = window as any\n if (w.__subscriberCounts === undefined || w.__subscriberCounts === null) {\n w.__subscriberCounts = {}\n }\n return w.__subscriberCounts\n}\n\nfunction setGlobalSubscriberCount(description: string, count: number): void {\n getGlobalSubscriberCounts()[description] = count\n}\n","import { QueryList } from '@angular/core'\nimport { Observable } from 'rxjs'\nimport { map, startWith } from 'rxjs/operators'\n\nexport function observeQueryList<T>(\n queryList: QueryList<T>,\n emitCurrentValue = true,\n): Observable<T[]> {\n return queryList.changes.pipe(\n startWith(queryList),\n map((v) => v.toArray() as T[]),\n )\n}\n","export function createPadding(len: number, chars: string): string {\n // if (chars.length <= len) {\n // return chars\n // }\n\n if (chars.length === 0) {\n throw Error(`Padding characters must be at least 1 char length.`)\n }\n\n let str = chars\n while (str.length < len) {\n str += chars\n }\n\n if (str.length > len) {\n str = str.slice(0, len)\n }\n\n return str\n}\n","import { createPadding } from './create-padding'\n\nexport function padEnd(\n stringToPad: string,\n paddingLength: number | undefined = 0,\n paddingChars: string | undefined = ' ',\n): string {\n const strLength = paddingLength ? stringToPad.length : 0\n\n if (!paddingLength || strLength >= paddingLength) {\n return stringToPad\n }\n\n return stringToPad + createPadding(paddingLength - strLength, paddingChars)\n}\n","import { createPadding } from './create-padding'\n\nexport function padStart(\n stringToPad: string,\n paddingLength: number | undefined = 0,\n paddingChars: string | undefined = ' ',\n): string {\n const strLength = paddingLength ? stringToPad.length : 0\n\n if (!paddingLength || strLength >= paddingLength) {\n return stringToPad\n }\n\n return createPadding(paddingLength - strLength, paddingChars) + stringToPad\n}\n","export function isNumeric(value: any): boolean {\n return !isNaN(Number(value) - parseFloat(value))\n}\n","import { isNumeric } from './is-numeric'\n\n/**\n * Returns the number of fractional digits.\n *\n * NOTE: This is intended for input validation, so trailing 0's will be included\n * in the total. Also, localization is not considered, so '.' is assumed to be\n * the fractional separator.\n */\nexport function fractionalDigitsCount(value: string): number | null {\n if (!isNumeric(value)) {\n return null\n }\n\n const a = value.split('.')\n if (a.length !== 2) {\n return null\n }\n\n return a[1].length\n}\n","// NOTE: Based on https://www.npmjs.com/package/strip-outer\n\nconst escapeRegExp = (s: string) =>\n s.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d')\n\n/**\n * Strip a substring from the start/end of a string.\n */\nexport function stripOuter(input: string, substring: string): string {\n const escaped = escapeRegExp(substring)\n return input.replace(new RegExp(`^${escaped}|${escaped}$`, 'g'), '')\n}\n","// NOTE: Based on https://www.npmjs.com/package/trim-repeated\n\nconst escapeRegExp = (s: string) =>\n s.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d')\n\n/**\n * Trim a consecutively repeated substring: foo--bar---baz → foo-bar-baz.\n */\nexport function trimRepeated(str: string, target: string): string {\n return str.replace(new RegExp(`(?:${escapeRegExp(target)}){2,}`, 'g'), target)\n}\n","import { stripOuter } from './strip-outer'\nimport { trimRepeated } from './trim-repeated'\n\n// NOTE: Mostly based on https://www.npmjs.com/package/filenamify\n\nconst MAX_FILENAME_LENGTH = 100\n\n// eslint-disable-next-line no-control-regex\nconst reReserved = /[<>:\"/\\\\|?*\\x00-\\x1F]/g\nconst reWindowsNames = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])$/i\nconst reControlChars = /[\\u0000-\\u001f\\u0080-\\u009f]/g // eslint-disable-line no-control-regex\nconst reRelativePath = /^\\.+/\n\nexport interface SanitizeFilenameOptions {\n /**\n * Replacement string.\n *\n * @default '_'\n */\n replacement?: string\n /**\n * Max file length.\n *\n * @default 100\n */\n maxLength?: number\n}\n\nconst defaultOptions: SanitizeFilenameOptions = {\n replacement: '_',\n maxLength: MAX_FILENAME_LENGTH,\n}\n\nexport function sanitizeFilename(\n filename: string,\n options?: SanitizeFilenameOptions,\n): string {\n const opts = {\n ...defaultOptions,\n ...(options || {}),\n }\n\n const replacement = opts.replacement === undefined ? '!' : opts.replacement\n\n if (reReserved.test(replacement) && reControlChars.test(replacement)) {\n throw new Error(\n 'Replacement string cannot contain reserved filename characters',\n )\n }\n\n let s = filename\n\n s = s.replace(reReserved, replacement)\n s = s.replace(reControlChars, replacement)\n s = s.replace(reRelativePath, replacement)\n\n if (replacement.length > 0) {\n s = trimRepeated(s, replacement)\n s = s.length > 1 ? stripOuter(s, replacement) : s\n }\n\n s = reWindowsNames.test(s) ? s + replacement : s\n s = s.slice(0, opts.maxLength)\n\n return s\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["escapeRegExp"],"mappings":";;;;;;;;AAAA;;AAEG;AACG,SAAU,YAAY,CAC1B,OAAU,EACV,IAAY,EAAA;AAEZ,IAAA,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC;AACnC;;ACRA;;AAEG;AACG,SAAU,YAAY,CAC1B,OAAU,EACV,IAAY,EAAA;AAEZ,IAAA,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC;AACnC;;ACFA;;;;AAIG;AACG,SAAU,uBAAuB,CACrC,OAAgC,EAChC,cAA8B,EAAA;AAE9B,IAAA,IAAI,MAAM,GAAuB,OAAO,CAAC,aAAa,CAAC,aAAa;AAEpE,IAAA,OACE,MAAM;QACN,EACE,MAAM,CAAC,SAAS,CAAC,Q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ACV;;ACjEA;;AAEG;;;;"}
|
package/package.json
CHANGED
package/utils/index.d.ts
CHANGED
|
@@ -366,24 +366,21 @@ declare class PollingTickerOptions {
|
|
|
366
366
|
*/
|
|
367
367
|
declare function pollingTicker<R>(action: PollingActionFn<R>, pollingInterval?: number, ticker?: Observable<number | void>, options?: PollingTickerOptions): Observable<R>;
|
|
368
368
|
|
|
369
|
+
interface RefreshableOptions<T> {
|
|
370
|
+
action: () => Observable<T>;
|
|
371
|
+
invalidate$?: Observable<unknown>;
|
|
372
|
+
poll$?: Observable<unknown>;
|
|
373
|
+
}
|
|
369
374
|
declare class Refreshable<T> {
|
|
370
|
-
private
|
|
371
|
-
private
|
|
372
|
-
private
|
|
373
|
-
private
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
* Intercepts the action call to monitor pending state
|
|
380
|
-
*/
|
|
381
|
-
private _actionHandler;
|
|
382
|
-
/**
|
|
383
|
-
* Selects the data observable
|
|
384
|
-
*/
|
|
385
|
-
select(refresh?: boolean): Observable<T>;
|
|
386
|
-
refresh(): Observable<void>;
|
|
375
|
+
private readonly _refresh$;
|
|
376
|
+
private readonly _cache$;
|
|
377
|
+
private readonly _loading$;
|
|
378
|
+
private _dataSubCount;
|
|
379
|
+
readonly loading$: Observable<boolean>;
|
|
380
|
+
readonly initialized$: Observable<boolean>;
|
|
381
|
+
readonly data$: Observable<T>;
|
|
382
|
+
constructor(opts: RefreshableOptions<T>);
|
|
383
|
+
refresh(): void;
|
|
387
384
|
}
|
|
388
385
|
|
|
389
386
|
declare function wrapIntoObservable<T>(value: T | Promise<T> | Observable<T>): Observable<T>;
|
|
@@ -456,4 +453,4 @@ interface SanitizeFilenameOptions {
|
|
|
456
453
|
declare function sanitizeFilename(filename: string, options?: SanitizeFilenameOptions): string;
|
|
457
454
|
|
|
458
455
|
export { IS_FEATURE_COLLECTION_VALIDATOR_NAME, IS_ONLY_GEOMETRY_TYPES_VALIDATOR_NAME, MIN_MAX_POINTS_VALIDATOR_NAME, NO_EMPTY_FEATURE_COLLECTION_VALIDATOR_NAME, NO_INNER_RINGS_VALIDATOR_NAME, NO_KINKS_VALIDATOR_NAME, PollingTickerOptions, Refreshable, activatedRoutesWithDataProperty, arrayMoveImmutable, arrayMoveMutable, calcPercentage, closePolygons, coerceFeatureCollection, createPadding, deleteProperties, deleteProperty, fileBufferToBlob, fileBufferToObjectUrl, fileDataFromBuffer, fractionalDigitsCount, geoJsonToArea, getAttribute, getClosestWidgetCdkDrag, getControlName, getControlPath, hasAttribute, hasProperty, hasRequiredControl, isAbsoluteUrl, isEmptyInputValue, isEmptyUrlRoute, isFeatureCollectionValidator, isNullOrUndefined, isNullOrUndefinedOrEmpty, isNumeric, isOnlyGeometryTypes, isOnlyGeometryTypesValidator, leafChildRoute, loadStyle, loadStyleSheet, mapEach, mergePolygons, minMaxPointsValidator, noEmptyFeatureCollectionValidator, noInnerRingsValidator, noKinksValidator, notNullOrUndefined, notNullOrUndefinedOrEmpty, observeControlIsDifferent, observeControlStatus, observeControlValid, observeControlValue, observeControlValueChange, observeQueryList, openBlob, padEnd, padStart, phoneNumberMask, pollingTicker, readFileAsDataUrlAsync, readFileAsync, readGeoFile, routeSnapshotPathFull, routeSnapshotPathRelative, sanitizeFilename, splitMultiPolygons, stripOuter, subscriberCount, tapFirst, toggleAttribute, trimRepeated, waitOnConditionAsync, waitOnNonPendingStatus, willHaveDataProp, withoutProperties, withoutProperty, wrapIntoObservable };
|
|
459
|
-
export type { IActivatedRouteWithData, IFileData, PollingActionFn, SanitizeFilenameOptions, SubscriberCountChangedFn };
|
|
456
|
+
export type { IActivatedRouteWithData, IFileData, PollingActionFn, RefreshableOptions, SanitizeFilenameOptions, SubscriberCountChangedFn };
|