@itwin/rpcinterface-full-stack-tests 4.6.0-dev.1 → 4.6.0-dev.13

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.
@@ -3223,6 +3223,467 @@ __exportStar(__webpack_require__(/*! ./TestFrontendAuthorizationClient */ "../..
3223
3223
  __exportStar(__webpack_require__(/*! ./certa/certaCommon */ "../../common/temp/node_modules/.pnpm/@itwin+oidc-signin-tool@3.6.0_mdtbcqczpmeuv6yjzfaigjndwi/node_modules/@itwin/oidc-signin-tool/lib/cjs/certa/certaCommon.js"), exports);
3224
3224
  //# sourceMappingURL=frontend.js.map
3225
3225
 
3226
+ /***/ }),
3227
+
3228
+ /***/ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection.js":
3229
+ /*!**********************************************************************************************************************************************!*\
3230
+ !*** ../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection.js ***!
3231
+ \**********************************************************************************************************************************************/
3232
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3233
+
3234
+ "use strict";
3235
+ __webpack_require__.r(__webpack_exports__);
3236
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3237
+ /* harmony export */ "Selectable": () => (/* reexport safe */ _unified_selection_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectable),
3238
+ /* harmony export */ "Selectables": () => (/* reexport safe */ _unified_selection_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables),
3239
+ /* harmony export */ "createStorage": () => (/* reexport safe */ _unified_selection_SelectionStorage__WEBPACK_IMPORTED_MODULE_1__.createStorage)
3240
+ /* harmony export */ });
3241
+ /* harmony import */ var _unified_selection_Selectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./unified-selection/Selectable */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/Selectable.js");
3242
+ /* harmony import */ var _unified_selection_SelectionStorage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unified-selection/SelectionStorage */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionStorage.js");
3243
+ /*---------------------------------------------------------------------------------------------
3244
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3245
+ * See LICENSE.md in the project root for license terms and full copyright notice.
3246
+ *--------------------------------------------------------------------------------------------*/
3247
+ /**
3248
+ * @module UnifiedSelection
3249
+ *
3250
+ * @docs-group-description UnifiedSelection
3251
+ * API for working with unified selection.
3252
+ */
3253
+
3254
+
3255
+
3256
+
3257
+ /***/ }),
3258
+
3259
+ /***/ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/Selectable.js":
3260
+ /*!*********************************************************************************************************************************************************!*\
3261
+ !*** ../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/Selectable.js ***!
3262
+ \*********************************************************************************************************************************************************/
3263
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3264
+
3265
+ "use strict";
3266
+ __webpack_require__.r(__webpack_exports__);
3267
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3268
+ /* harmony export */ "Selectable": () => (/* binding */ Selectable),
3269
+ /* harmony export */ "Selectables": () => (/* binding */ Selectables)
3270
+ /* harmony export */ });
3271
+ /*---------------------------------------------------------------------------------------------
3272
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3273
+ * See LICENSE.md in the project root for license terms and full copyright notice.
3274
+ *--------------------------------------------------------------------------------------------*/
3275
+ /** @beta */
3276
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
3277
+ var Selectable;
3278
+ (function (Selectable) {
3279
+ /** Check if the supplied selectable is a `SelectableInstanceKey` */
3280
+ function isInstanceKey(selectable) {
3281
+ const instanceKey = selectable;
3282
+ return !!instanceKey.className && !!instanceKey.id;
3283
+ }
3284
+ Selectable.isInstanceKey = isInstanceKey;
3285
+ /** Check if the supplied selectable is a `CustomSelectable` */
3286
+ function isCustom(selectable) {
3287
+ return !!selectable.identifier;
3288
+ }
3289
+ Selectable.isCustom = isCustom;
3290
+ })(Selectable || (Selectable = {}));
3291
+ /** @beta */
3292
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
3293
+ var Selectables;
3294
+ (function (Selectables) {
3295
+ /**
3296
+ * Creates `Selectables` from array of selectable
3297
+ * @param source Source to create selectables from
3298
+ * @beta
3299
+ */
3300
+ function create(source) {
3301
+ const newSelectables = {
3302
+ instanceKeys: new Map(),
3303
+ custom: new Map(),
3304
+ };
3305
+ Selectables.add(newSelectables, source);
3306
+ return newSelectables;
3307
+ }
3308
+ Selectables.create = create;
3309
+ /**
3310
+ * Get the number of selectables stored in a `Selectables` object.
3311
+ * @param selectables `Selectables` object to get size for
3312
+ * @beta
3313
+ */
3314
+ function size(selectables) {
3315
+ let insatanceCount = 0;
3316
+ selectables.instanceKeys.forEach((set) => (insatanceCount += set.size));
3317
+ return insatanceCount + selectables.custom.size;
3318
+ }
3319
+ Selectables.size = size;
3320
+ /**
3321
+ * Is a `Selectables` object currently empty.
3322
+ * @param selectables `Selectables` object to check
3323
+ * @beta
3324
+ */
3325
+ function isEmpty(selectables) {
3326
+ return Selectables.size(selectables) === 0;
3327
+ }
3328
+ Selectables.isEmpty = isEmpty;
3329
+ /**
3330
+ * Check if a `Selectables` object contains the specified selectable.
3331
+ * @param selectables `Selectables` object to check
3332
+ * @param value The selectable to check for.
3333
+ * @beta
3334
+ */
3335
+ function has(selectables, value) {
3336
+ if (Selectable.isInstanceKey(value)) {
3337
+ const normalizedClassName = normalizeClassName(value.className);
3338
+ const set = selectables.instanceKeys.get(normalizedClassName);
3339
+ return !!(set && set.has(value.id));
3340
+ }
3341
+ return selectables.custom.has(value.identifier);
3342
+ }
3343
+ Selectables.has = has;
3344
+ /**
3345
+ * Check if a `Selectables` object contains all the specified selectables.
3346
+ * @param selectables `Selectables` object to check
3347
+ * @param values The selectables to check for.
3348
+ * @beta
3349
+ */
3350
+ function hasAll(selectables, values) {
3351
+ if (Selectables.size(selectables) < values.length) {
3352
+ return false;
3353
+ }
3354
+ for (const selectable of values) {
3355
+ if (!Selectables.has(selectables, selectable)) {
3356
+ return false;
3357
+ }
3358
+ }
3359
+ return true;
3360
+ }
3361
+ Selectables.hasAll = hasAll;
3362
+ /**
3363
+ * Check if a `Selectables` object contains any of the specified selectables.
3364
+ * @param selectables `Selectables` object to check
3365
+ * @param values The selectables to check for.
3366
+ * @beta
3367
+ */
3368
+ function hasAny(selectables, values) {
3369
+ for (const selectable of values) {
3370
+ if (Selectables.has(selectables, selectable)) {
3371
+ return true;
3372
+ }
3373
+ }
3374
+ return false;
3375
+ }
3376
+ Selectables.hasAny = hasAny;
3377
+ /**
3378
+ * Add a one or more selectables to a `Selectables`
3379
+ * @param selectables `Selectables` object to add selectables for
3380
+ * @param values Selectables to add.
3381
+ * @beta
3382
+ */
3383
+ function add(selectables, values) {
3384
+ let hasChanged = false;
3385
+ for (const selectable of values) {
3386
+ if (Selectable.isInstanceKey(selectable)) {
3387
+ const normalizedClassName = normalizeClassName(selectable.className);
3388
+ let set = selectables.instanceKeys.get(normalizedClassName);
3389
+ if (!set) {
3390
+ set = new Set();
3391
+ }
3392
+ if (!set.has(selectable.id)) {
3393
+ set.add(selectable.id);
3394
+ selectables.instanceKeys.set(normalizedClassName, set);
3395
+ hasChanged = true;
3396
+ }
3397
+ }
3398
+ else if (!selectables.custom.has(selectable.identifier)) {
3399
+ selectables.custom.set(selectable.identifier, selectable);
3400
+ hasChanged = true;
3401
+ }
3402
+ }
3403
+ return hasChanged;
3404
+ }
3405
+ Selectables.add = add;
3406
+ /**
3407
+ * Removes one or more selectables from a `Selectables` object.
3408
+ * @param selectables `Selectables` object to remove selectables for
3409
+ * @param values Selectables to remove.
3410
+ * @beta
3411
+ */
3412
+ function remove(selectables, values) {
3413
+ let hasChanged = false;
3414
+ for (const selectable of values) {
3415
+ if (Selectable.isInstanceKey(selectable)) {
3416
+ const normalizedClassName = normalizeClassName(selectable.className);
3417
+ const set = selectables.instanceKeys.get(normalizedClassName);
3418
+ if (set && set.has(selectable.id)) {
3419
+ set.delete(selectable.id);
3420
+ hasChanged = true;
3421
+ if (set.size === 0) {
3422
+ selectables.instanceKeys.delete(normalizedClassName);
3423
+ }
3424
+ }
3425
+ }
3426
+ else if (selectables.custom.has(selectable.identifier)) {
3427
+ selectables.custom.delete(selectable.identifier);
3428
+ hasChanged = true;
3429
+ }
3430
+ }
3431
+ return hasChanged;
3432
+ }
3433
+ Selectables.remove = remove;
3434
+ /**
3435
+ * Clear a `Selectables` object.
3436
+ * @param selectables `Selectables` object to clear selectables for
3437
+ * @beta
3438
+ */
3439
+ function clear(selectables) {
3440
+ if (Selectables.size(selectables) === 0) {
3441
+ return false;
3442
+ }
3443
+ selectables.instanceKeys = new Map();
3444
+ selectables.custom = new Map();
3445
+ return true;
3446
+ }
3447
+ Selectables.clear = clear;
3448
+ /**
3449
+ * Check whether at least one selectable passes a condition in a `Selectables` object.
3450
+ * @param selectables `Selectables` object to check
3451
+ * @beta
3452
+ */
3453
+ function some(selectables, callback) {
3454
+ for (const entry of selectables.instanceKeys) {
3455
+ for (const item of entry[1]) {
3456
+ if (callback({ className: entry[0], id: item })) {
3457
+ return true;
3458
+ }
3459
+ }
3460
+ }
3461
+ for (const entry of selectables.custom) {
3462
+ if (callback(entry[1])) {
3463
+ return true;
3464
+ }
3465
+ }
3466
+ return false;
3467
+ }
3468
+ Selectables.some = some;
3469
+ /**
3470
+ * Iterate over all keys in a `Selectables` object.
3471
+ * @param selectables `Selectables` object to iterate over
3472
+ * @beta
3473
+ */
3474
+ function forEach(selectables, callback) {
3475
+ let index = 0;
3476
+ selectables.instanceKeys.forEach((ids, className) => {
3477
+ ids.forEach((id) => callback({ className, id }, index++));
3478
+ });
3479
+ selectables.custom.forEach((data) => {
3480
+ callback(data, index++);
3481
+ });
3482
+ }
3483
+ Selectables.forEach = forEach;
3484
+ function normalizeClassName(className) {
3485
+ return className.replace(".", ":");
3486
+ }
3487
+ })(Selectables || (Selectables = {}));
3488
+
3489
+
3490
+ /***/ }),
3491
+
3492
+ /***/ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionChangeEvent.js":
3493
+ /*!*******************************************************************************************************************************************************************!*\
3494
+ !*** ../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionChangeEvent.js ***!
3495
+ \*******************************************************************************************************************************************************************/
3496
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3497
+
3498
+ "use strict";
3499
+ __webpack_require__.r(__webpack_exports__);
3500
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3501
+ /* harmony export */ "SelectionChangeEventImpl": () => (/* binding */ SelectionChangeEventImpl)
3502
+ /* harmony export */ });
3503
+ /*---------------------------------------------------------------------------------------------
3504
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3505
+ * See LICENSE.md in the project root for license terms and full copyright notice.
3506
+ *--------------------------------------------------------------------------------------------*/
3507
+ /**
3508
+ * An event broadcasted on selection changes
3509
+ * @internal
3510
+ */
3511
+ class SelectionChangeEventImpl {
3512
+ _listeners = [];
3513
+ /**
3514
+ * Registers a Listener to be executed whenever this event is raised
3515
+ * @param listener The function to be executed when the event is raised
3516
+ * @returns A function that will remove this event listener
3517
+ * @beta
3518
+ */
3519
+ addListener(listener) {
3520
+ this._listeners.push(listener);
3521
+ return () => this.removeListener(listener);
3522
+ }
3523
+ /**
3524
+ * Un-register a previously registered listener
3525
+ * @param listener The listener to be unregistered
3526
+ * @beta
3527
+ */
3528
+ removeListener(listener) {
3529
+ this._listeners = this._listeners.filter((x) => x !== listener);
3530
+ }
3531
+ /**
3532
+ * Raises the event by calling each registered listener with the supplied arguments
3533
+ * @param args Event arguments
3534
+ * @param storage Storage that the selection changed in
3535
+ * @beta
3536
+ */
3537
+ raiseEvent(args, storage) {
3538
+ this._listeners.forEach((listener) => listener(args, storage));
3539
+ }
3540
+ }
3541
+
3542
+
3543
+ /***/ }),
3544
+
3545
+ /***/ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionStorage.js":
3546
+ /*!***************************************************************************************************************************************************************!*\
3547
+ !*** ../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionStorage.js ***!
3548
+ \***************************************************************************************************************************************************************/
3549
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3550
+
3551
+ "use strict";
3552
+ __webpack_require__.r(__webpack_exports__);
3553
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3554
+ /* harmony export */ "createStorage": () => (/* binding */ createStorage)
3555
+ /* harmony export */ });
3556
+ /* harmony import */ var _Selectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Selectable */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/Selectable.js");
3557
+ /* harmony import */ var _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SelectionChangeEvent */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionChangeEvent.js");
3558
+ /*---------------------------------------------------------------------------------------------
3559
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3560
+ * See LICENSE.md in the project root for license terms and full copyright notice.
3561
+ *--------------------------------------------------------------------------------------------*/
3562
+ /** @packageDocumentation
3563
+ * @module UnifiedSelection
3564
+ */
3565
+
3566
+
3567
+ /**
3568
+ * Creates a selection storage. When an iModel is closed `SelectionStorage.clearSelection` function should be called.
3569
+ * @beta
3570
+ */
3571
+ function createStorage() {
3572
+ return new SelectionStorageImpl();
3573
+ }
3574
+ class SelectionStorageImpl {
3575
+ _storage = new Map();
3576
+ selectionChangeEvent;
3577
+ constructor() {
3578
+ this.selectionChangeEvent = new _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_1__.SelectionChangeEventImpl();
3579
+ }
3580
+ getSelectionLevels({ iModelKey }) {
3581
+ return this.getContainer(iModelKey).getSelectionLevels();
3582
+ }
3583
+ getSelection(props) {
3584
+ const { iModelKey, level } = props;
3585
+ return this.getContainer(iModelKey).getSelection(level ?? 0);
3586
+ }
3587
+ addToSelection(props) {
3588
+ this.handleChange({ ...props, changeType: "add" });
3589
+ }
3590
+ removeFromSelection(props) {
3591
+ this.handleChange({ ...props, changeType: "remove" });
3592
+ }
3593
+ replaceSelection(props) {
3594
+ this.handleChange({ ...props, changeType: "replace" });
3595
+ }
3596
+ clearSelection(props) {
3597
+ this.handleChange({ ...props, changeType: "clear", selectables: [] });
3598
+ }
3599
+ clearStorage({ iModelKey }) {
3600
+ this.clearSelection({ source: "Clear iModel storage", iModelKey });
3601
+ this._storage.delete(iModelKey);
3602
+ }
3603
+ getContainer(iModelKey) {
3604
+ let selectionContainer = this._storage.get(iModelKey);
3605
+ if (!selectionContainer) {
3606
+ selectionContainer = new MultiLevelSelectablesContainer();
3607
+ this._storage.set(iModelKey, selectionContainer);
3608
+ }
3609
+ return selectionContainer;
3610
+ }
3611
+ handleChange(props) {
3612
+ const { iModelKey, source, level: inLevel, changeType, selectables: change } = props;
3613
+ const container = this.getContainer(iModelKey);
3614
+ const level = inLevel ?? 0;
3615
+ const selectables = container.getSelection(level);
3616
+ const selected = _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.create(change);
3617
+ switch (changeType) {
3618
+ case "add":
3619
+ if (!_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.add(selectables, change)) {
3620
+ return;
3621
+ }
3622
+ break;
3623
+ case "remove":
3624
+ if (!_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.remove(selectables, change)) {
3625
+ return;
3626
+ }
3627
+ break;
3628
+ case "replace":
3629
+ if (_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.size(selectables) === _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.size(selected) && _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.hasAll(selectables, change)) {
3630
+ return;
3631
+ }
3632
+ _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.clear(selectables);
3633
+ _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.add(selectables, change);
3634
+ break;
3635
+ case "clear":
3636
+ if (!_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.clear(selectables)) {
3637
+ return;
3638
+ }
3639
+ break;
3640
+ }
3641
+ container.clear(level + 1);
3642
+ const event = {
3643
+ source,
3644
+ level,
3645
+ iModelKey,
3646
+ changeType,
3647
+ selectables: selected,
3648
+ timestamp: new Date(),
3649
+ };
3650
+ this.selectionChangeEvent.raiseEvent(event, this);
3651
+ }
3652
+ }
3653
+ class MultiLevelSelectablesContainer {
3654
+ _selectablesContainers;
3655
+ constructor() {
3656
+ this._selectablesContainers = new Map();
3657
+ }
3658
+ getSelection(level) {
3659
+ let selectables = this._selectablesContainers.get(level);
3660
+ if (!selectables) {
3661
+ selectables = _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.create([]);
3662
+ this._selectablesContainers.set(level, selectables);
3663
+ }
3664
+ return selectables;
3665
+ }
3666
+ getSelectionLevels() {
3667
+ const levels = new Array();
3668
+ for (const entry of this._selectablesContainers.entries()) {
3669
+ if (!_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.isEmpty(entry[1])) {
3670
+ levels.push(entry[0]);
3671
+ }
3672
+ }
3673
+ return levels.sort();
3674
+ }
3675
+ clear(level) {
3676
+ const storedLevels = this._selectablesContainers.keys();
3677
+ for (const storedLevel of storedLevels) {
3678
+ if (storedLevel >= level) {
3679
+ const selectables = this._selectablesContainers.get(storedLevel);
3680
+ _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.clear(selectables);
3681
+ }
3682
+ }
3683
+ }
3684
+ }
3685
+
3686
+
3226
3687
  /***/ }),
3227
3688
 
3228
3689
  /***/ "../../common/temp/node_modules/.pnpm/almost-equal@1.1.0/node_modules/almost-equal/almost_equal.js":
@@ -25420,6 +25881,30 @@ function concat() {
25420
25881
  }
25421
25882
 
25422
25883
 
25884
+ /***/ }),
25885
+
25886
+ /***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/defer.js":
25887
+ /*!****************************************************************************************************************!*\
25888
+ !*** ../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/defer.js ***!
25889
+ \****************************************************************************************************************/
25890
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
25891
+
25892
+ "use strict";
25893
+ __webpack_require__.r(__webpack_exports__);
25894
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25895
+ /* harmony export */ "defer": () => (/* binding */ defer)
25896
+ /* harmony export */ });
25897
+ /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Observable.js");
25898
+ /* harmony import */ var _innerFrom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./innerFrom */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js");
25899
+
25900
+
25901
+ function defer(observableFactory) {
25902
+ return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(function (subscriber) {
25903
+ (0,_innerFrom__WEBPACK_IMPORTED_MODULE_1__.innerFrom)(observableFactory()).subscribe(subscriber);
25904
+ });
25905
+ }
25906
+
25907
+
25423
25908
  /***/ }),
25424
25909
 
25425
25910
  /***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/empty.js":
@@ -26230,6 +26715,93 @@ function subscribeOn(scheduler, delay) {
26230
26715
  }
26231
26716
 
26232
26717
 
26718
+ /***/ }),
26719
+
26720
+ /***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js":
26721
+ /*!*******************************************************************************************************************!*\
26722
+ !*** ../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js ***!
26723
+ \*******************************************************************************************************************/
26724
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
26725
+
26726
+ "use strict";
26727
+ __webpack_require__.r(__webpack_exports__);
26728
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
26729
+ /* harmony export */ "takeUntil": () => (/* binding */ takeUntil)
26730
+ /* harmony export */ });
26731
+ /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/lift.js");
26732
+ /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js");
26733
+ /* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/innerFrom */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js");
26734
+ /* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/noop */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/noop.js");
26735
+
26736
+
26737
+
26738
+
26739
+ function takeUntil(notifier) {
26740
+ return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)(function (source, subscriber) {
26741
+ (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_1__.innerFrom)(notifier).subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, function () { return subscriber.complete(); }, _util_noop__WEBPACK_IMPORTED_MODULE_3__.noop));
26742
+ !subscriber.closed && source.subscribe(subscriber);
26743
+ });
26744
+ }
26745
+
26746
+
26747
+ /***/ }),
26748
+
26749
+ /***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/tap.js":
26750
+ /*!*************************************************************************************************************!*\
26751
+ !*** ../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/tap.js ***!
26752
+ \*************************************************************************************************************/
26753
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
26754
+
26755
+ "use strict";
26756
+ __webpack_require__.r(__webpack_exports__);
26757
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
26758
+ /* harmony export */ "tap": () => (/* binding */ tap)
26759
+ /* harmony export */ });
26760
+ /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isFunction */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/isFunction.js");
26761
+ /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/lift */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/lift.js");
26762
+ /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js");
26763
+ /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/identity */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/identity.js");
26764
+
26765
+
26766
+
26767
+
26768
+ function tap(observerOrNext, error, complete) {
26769
+ var tapObserver = (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(observerOrNext) || error || complete
26770
+ ?
26771
+ { next: observerOrNext, error: error, complete: complete }
26772
+ : observerOrNext;
26773
+ return tapObserver
26774
+ ? (0,_util_lift__WEBPACK_IMPORTED_MODULE_1__.operate)(function (source, subscriber) {
26775
+ var _a;
26776
+ (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
26777
+ var isUnsub = true;
26778
+ source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, function (value) {
26779
+ var _a;
26780
+ (_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);
26781
+ subscriber.next(value);
26782
+ }, function () {
26783
+ var _a;
26784
+ isUnsub = false;
26785
+ (_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
26786
+ subscriber.complete();
26787
+ }, function (err) {
26788
+ var _a;
26789
+ isUnsub = false;
26790
+ (_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);
26791
+ subscriber.error(err);
26792
+ }, function () {
26793
+ var _a, _b;
26794
+ if (isUnsub) {
26795
+ (_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
26796
+ }
26797
+ (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);
26798
+ }));
26799
+ })
26800
+ :
26801
+ _util_identity__WEBPACK_IMPORTED_MODULE_3__.identity;
26802
+ }
26803
+
26804
+
26233
26805
  /***/ }),
26234
26806
 
26235
26807
  /***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js":
@@ -27812,10 +28384,12 @@ class BeEventList {
27812
28384
  "use strict";
27813
28385
  __webpack_require__.r(__webpack_exports__);
27814
28386
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
28387
+ /* harmony export */ "DbChangeStage": () => (/* binding */ DbChangeStage),
27815
28388
  /* harmony export */ "DbConflictCause": () => (/* binding */ DbConflictCause),
27816
28389
  /* harmony export */ "DbConflictResolution": () => (/* binding */ DbConflictResolution),
27817
28390
  /* harmony export */ "DbOpcode": () => (/* binding */ DbOpcode),
27818
28391
  /* harmony export */ "DbResult": () => (/* binding */ DbResult),
28392
+ /* harmony export */ "DbValueType": () => (/* binding */ DbValueType),
27819
28393
  /* harmony export */ "OpenMode": () => (/* binding */ OpenMode)
27820
28394
  /* harmony export */ });
27821
28395
  /*---------------------------------------------------------------------------------------------
@@ -27845,6 +28419,25 @@ var DbOpcode;
27845
28419
  /** Some columns of an existing row were updated. */
27846
28420
  DbOpcode[DbOpcode["Update"] = 23] = "Update";
27847
28421
  })(DbOpcode || (DbOpcode = {}));
28422
+ /** Change value stage.
28423
+ * @internal
28424
+ */
28425
+ var DbChangeStage;
28426
+ (function (DbChangeStage) {
28427
+ DbChangeStage[DbChangeStage["Old"] = 0] = "Old";
28428
+ DbChangeStage[DbChangeStage["New"] = 1] = "New";
28429
+ })(DbChangeStage || (DbChangeStage = {}));
28430
+ /** Change value type.
28431
+ * @internal
28432
+ */
28433
+ var DbValueType;
28434
+ (function (DbValueType) {
28435
+ DbValueType[DbValueType["IntegerVal"] = 1] = "IntegerVal";
28436
+ DbValueType[DbValueType["FloatVal"] = 2] = "FloatVal";
28437
+ DbValueType[DbValueType["TextVal"] = 3] = "TextVal";
28438
+ DbValueType[DbValueType["BlobVal"] = 4] = "BlobVal";
28439
+ DbValueType[DbValueType["NullVal"] = 5] = "NullVal";
28440
+ })(DbValueType || (DbValueType = {}));
27848
28441
  /** Cause of conflict when applying a changeset
27849
28442
  * @internal
27850
28443
  */
@@ -34009,10 +34602,12 @@ __webpack_require__.r(__webpack_exports__);
34009
34602
  /* harmony export */ "ByteStream": () => (/* reexport safe */ _ByteStream__WEBPACK_IMPORTED_MODULE_7__.ByteStream),
34010
34603
  /* harmony export */ "ChangeSetStatus": () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.ChangeSetStatus),
34011
34604
  /* harmony export */ "CompressedId64Set": () => (/* reexport safe */ _CompressedId64Set__WEBPACK_IMPORTED_MODULE_10__.CompressedId64Set),
34605
+ /* harmony export */ "DbChangeStage": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbChangeStage),
34012
34606
  /* harmony export */ "DbConflictCause": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbConflictCause),
34013
34607
  /* harmony export */ "DbConflictResolution": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbConflictResolution),
34014
34608
  /* harmony export */ "DbOpcode": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbOpcode),
34015
34609
  /* harmony export */ "DbResult": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbResult),
34610
+ /* harmony export */ "DbValueType": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbValueType),
34016
34611
  /* harmony export */ "Dictionary": () => (/* reexport safe */ _Dictionary__WEBPACK_IMPORTED_MODULE_11__.Dictionary),
34017
34612
  /* harmony export */ "DisposableList": () => (/* reexport safe */ _Disposable__WEBPACK_IMPORTED_MODULE_12__.DisposableList),
34018
34613
  /* harmony export */ "DuplicatePolicy": () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_26__.DuplicatePolicy),
@@ -69906,23 +70501,25 @@ var ECClassModifier;
69906
70501
  ECClassModifier[ECClassModifier["Abstract"] = 1] = "Abstract";
69907
70502
  ECClassModifier[ECClassModifier["Sealed"] = 2] = "Sealed";
69908
70503
  })(ECClassModifier = exports.ECClassModifier || (exports.ECClassModifier = {}));
69909
- /** @beta */
70504
+ /**
70505
+ * An enumeration that has all the schema item type names as values
70506
+ * @beta */
69910
70507
  var SchemaItemType;
69911
70508
  (function (SchemaItemType) {
69912
- SchemaItemType[SchemaItemType["EntityClass"] = 0] = "EntityClass";
69913
- SchemaItemType[SchemaItemType["Mixin"] = 1] = "Mixin";
69914
- SchemaItemType[SchemaItemType["StructClass"] = 2] = "StructClass";
69915
- SchemaItemType[SchemaItemType["CustomAttributeClass"] = 3] = "CustomAttributeClass";
69916
- SchemaItemType[SchemaItemType["RelationshipClass"] = 4] = "RelationshipClass";
69917
- SchemaItemType[SchemaItemType["Enumeration"] = 5] = "Enumeration";
69918
- SchemaItemType[SchemaItemType["KindOfQuantity"] = 6] = "KindOfQuantity";
69919
- SchemaItemType[SchemaItemType["PropertyCategory"] = 7] = "PropertyCategory";
69920
- SchemaItemType[SchemaItemType["Unit"] = 8] = "Unit";
69921
- SchemaItemType[SchemaItemType["InvertedUnit"] = 9] = "InvertedUnit";
69922
- SchemaItemType[SchemaItemType["Constant"] = 10] = "Constant";
69923
- SchemaItemType[SchemaItemType["Phenomenon"] = 11] = "Phenomenon";
69924
- SchemaItemType[SchemaItemType["UnitSystem"] = 12] = "UnitSystem";
69925
- SchemaItemType[SchemaItemType["Format"] = 13] = "Format";
70509
+ SchemaItemType["EntityClass"] = "EntityClass";
70510
+ SchemaItemType["Mixin"] = "Mixin";
70511
+ SchemaItemType["StructClass"] = "StructClass";
70512
+ SchemaItemType["CustomAttributeClass"] = "CustomAttributeClass";
70513
+ SchemaItemType["RelationshipClass"] = "RelationshipClass";
70514
+ SchemaItemType["Enumeration"] = "Enumeration";
70515
+ SchemaItemType["KindOfQuantity"] = "KindOfQuantity";
70516
+ SchemaItemType["PropertyCategory"] = "PropertyCategory";
70517
+ SchemaItemType["Unit"] = "Unit";
70518
+ SchemaItemType["InvertedUnit"] = "InvertedUnit";
70519
+ SchemaItemType["Constant"] = "Constant";
70520
+ SchemaItemType["Phenomenon"] = "Phenomenon";
70521
+ SchemaItemType["UnitSystem"] = "UnitSystem";
70522
+ SchemaItemType["Format"] = "Format";
69926
70523
  })(SchemaItemType = exports.SchemaItemType || (exports.SchemaItemType = {}));
69927
70524
  /**
69928
70525
  * Primitive data types for ECProperties.
@@ -70064,25 +70661,10 @@ exports.parseSchemaItemType = parseSchemaItemType;
70064
70661
  * @param value The SchemaItemType to stringify.
70065
70662
  * @return A string representing the provided SchemaItemType. If the type is not valid, an empty string is returned.
70066
70663
  * @beta
70664
+ * @deprecated in 4.6.0 SchemaItemType is a string enum so just use it directly
70067
70665
  */
70068
70666
  function schemaItemTypeToString(value) {
70069
- switch (value) {
70070
- case SchemaItemType.EntityClass: return "EntityClass";
70071
- case SchemaItemType.Mixin: return "Mixin";
70072
- case SchemaItemType.StructClass: return "StructClass";
70073
- case SchemaItemType.CustomAttributeClass: return "CustomAttributeClass";
70074
- case SchemaItemType.RelationshipClass: return "RelationshipClass";
70075
- case SchemaItemType.Enumeration: return "Enumeration";
70076
- case SchemaItemType.KindOfQuantity: return "KindOfQuantity";
70077
- case SchemaItemType.PropertyCategory: return "PropertyCategory";
70078
- case SchemaItemType.Unit: return "Unit";
70079
- case SchemaItemType.InvertedUnit: return "InvertedUnit";
70080
- case SchemaItemType.Constant: return "Constant";
70081
- case SchemaItemType.Phenomenon: return "Phenomenon";
70082
- case SchemaItemType.UnitSystem: return "UnitSystem";
70083
- case SchemaItemType.Format: return "Format";
70084
- default: throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidSchemaItemType, "An invalid SchemaItemType has been provided.");
70085
- }
70667
+ return value; // TODO: Remove
70086
70668
  }
70087
70669
  exports.schemaItemTypeToString = schemaItemTypeToString;
70088
70670
  /** @internal */
@@ -71074,7 +71656,7 @@ class Constant extends SchemaItem_1.SchemaItem {
71074
71656
  * @param standalone Serialization includes only this object (as opposed to the full schema).
71075
71657
  * @param includeSchemaVersion Include the Schema's version information in the serialized object.
71076
71658
  */
71077
- toJSON(standalone, includeSchemaVersion) {
71659
+ toJSON(standalone = false, includeSchemaVersion = false) {
71078
71660
  const schemaJson = super.toJSON(standalone, includeSchemaVersion);
71079
71661
  if (this.phenomenon !== undefined)
71080
71662
  schemaJson.phenomenon = this.phenomenon.fullName;
@@ -72278,6 +72860,13 @@ class KindOfQuantity extends SchemaItem_1.SchemaItem {
72278
72860
  if (undefined !== kindOfQuantityProps.presentationUnits)
72279
72861
  await this.processPresentationUnits(kindOfQuantityProps.presentationUnits);
72280
72862
  }
72863
+ /**
72864
+ * @alpha
72865
+ * Used for schema editing.
72866
+ */
72867
+ setRelativeError(relativeError) {
72868
+ this._relativeError = relativeError;
72869
+ }
72281
72870
  }
72282
72871
  exports.KindOfQuantity = KindOfQuantity;
72283
72872
  /**
@@ -74215,6 +74804,20 @@ class Schema {
74215
74804
  const schema = object;
74216
74805
  return schema !== undefined && schema.schemaKey !== undefined && schema.context !== undefined;
74217
74806
  }
74807
+ /**
74808
+ * @alpha
74809
+ * Used for schema editing.
74810
+ */
74811
+ setDisplayLabel(displayLabel) {
74812
+ this._label = displayLabel;
74813
+ }
74814
+ /**
74815
+ * @alpha
74816
+ * Used for schema editing.
74817
+ */
74818
+ setDescription(description) {
74819
+ this._description = description;
74820
+ }
74218
74821
  }
74219
74822
  exports.Schema = Schema;
74220
74823
  /**
@@ -74280,7 +74883,7 @@ class SchemaItem {
74280
74883
  if (includeSchemaVersion) // check flag to see if we should output version
74281
74884
  itemJson.schemaVersion = this.key.schemaKey.version.toString();
74282
74885
  }
74283
- itemJson.schemaItemType = (0, ECObjects_1.schemaItemTypeToString)(this.schemaItemType);
74886
+ itemJson.schemaItemType = this.schemaItemType;
74284
74887
  if (undefined !== this.label)
74285
74888
  itemJson.label = this.label;
74286
74889
  if (undefined !== this.description)
@@ -106302,6 +106905,7 @@ __webpack_require__.r(__webpack_exports__);
106302
106905
  /* harmony export */ "createSurfaceMaterial": () => (/* reexport safe */ _common_render_primitives_SurfaceParams__WEBPACK_IMPORTED_MODULE_26__.createSurfaceMaterial),
106303
106906
  /* harmony export */ "createWorkerProxy": () => (/* reexport safe */ _common_WorkerProxy__WEBPACK_IMPORTED_MODULE_32__.createWorkerProxy),
106304
106907
  /* harmony export */ "decodeImdlGraphics": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_143__.decodeImdlGraphics),
106908
+ /* harmony export */ "decodeMeshoptBuffer": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_143__.decodeMeshoptBuffer),
106305
106909
  /* harmony export */ "disposeTileTreesForGeometricModels": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_143__.disposeTileTreesForGeometricModels),
106306
106910
  /* harmony export */ "edgeParamsFromImdl": () => (/* reexport safe */ _common_imdl_ParseImdlDocument__WEBPACK_IMPORTED_MODULE_16__.edgeParamsFromImdl),
106307
106911
  /* harmony export */ "extractImageSourceDimensions": () => (/* reexport safe */ _common_ImageUtil__WEBPACK_IMPORTED_MODULE_13__.extractImageSourceDimensions),
@@ -144999,11 +145603,12 @@ __webpack_require__.r(__webpack_exports__);
144999
145603
  /* harmony import */ var _render_RealityMeshParams__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../render/RealityMeshParams */ "../../core/frontend/lib/esm/render/RealityMeshParams.js");
145000
145604
  /* harmony import */ var _render_primitives_mesh_MeshPrimitives__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../render/primitives/mesh/MeshPrimitives */ "../../core/frontend/lib/esm/render/primitives/mesh/MeshPrimitives.js");
145001
145605
  /* harmony import */ var _render_primitives_Primitives__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../render/primitives/Primitives */ "../../core/frontend/lib/esm/render/primitives/Primitives.js");
145002
- /* harmony import */ var _common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/render/primitives/DisplayParams */ "../../core/frontend/lib/esm/common/render/primitives/DisplayParams.js");
145003
- /* harmony import */ var _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../common/FrontendLoggerCategory */ "../../core/frontend/lib/esm/common/FrontendLoggerCategory.js");
145004
- /* harmony import */ var _common_ImageUtil__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../common/ImageUtil */ "../../core/frontend/lib/esm/common/ImageUtil.js");
145005
- /* harmony import */ var _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../common/render/primitives/MeshPrimitive */ "../../core/frontend/lib/esm/common/render/primitives/MeshPrimitive.js");
145006
- /* harmony import */ var _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../common/gltf/GltfSchema */ "../../core/frontend/lib/esm/common/gltf/GltfSchema.js");
145606
+ /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./internal */ "../../core/frontend/lib/esm/tile/internal.js");
145607
+ /* harmony import */ var _common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../common/render/primitives/DisplayParams */ "../../core/frontend/lib/esm/common/render/primitives/DisplayParams.js");
145608
+ /* harmony import */ var _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../common/FrontendLoggerCategory */ "../../core/frontend/lib/esm/common/FrontendLoggerCategory.js");
145609
+ /* harmony import */ var _common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../common/ImageUtil */ "../../core/frontend/lib/esm/common/ImageUtil.js");
145610
+ /* harmony import */ var _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../common/render/primitives/MeshPrimitive */ "../../core/frontend/lib/esm/common/render/primitives/MeshPrimitive.js");
145611
+ /* harmony import */ var _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../common/gltf/GltfSchema */ "../../core/frontend/lib/esm/common/gltf/GltfSchema.js");
145007
145612
  /*---------------------------------------------------------------------------------------------
145008
145613
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
145009
145614
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -145024,6 +145629,7 @@ __webpack_require__.r(__webpack_exports__);
145024
145629
 
145025
145630
 
145026
145631
 
145632
+
145027
145633
  /**
145028
145634
  * A chunk of binary data exposed as a typed array.
145029
145635
  * The count member indicates how many elements exist. This may be less than this.buffer.length due to padding added to the
@@ -145044,15 +145650,15 @@ class GltfBufferData {
145044
145650
  if (expectedType !== actualType) {
145045
145651
  // Some data is stored in smaller data types to save space if no values exceed the maximum of the smaller type.
145046
145652
  switch (expectedType) {
145047
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float:
145048
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedByte:
145653
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float:
145654
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte:
145049
145655
  return undefined;
145050
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedShort:
145051
- if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedByte !== actualType)
145656
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort:
145657
+ if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte !== actualType)
145052
145658
  return undefined;
145053
145659
  break;
145054
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UInt32:
145055
- if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedByte !== actualType && _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedShort !== actualType)
145660
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UInt32:
145661
+ if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte !== actualType && _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort !== actualType)
145056
145662
  return undefined;
145057
145663
  break;
145058
145664
  }
@@ -145064,13 +145670,13 @@ class GltfBufferData {
145064
145670
  // NB: Endianness of typed array data is determined by the 'platform byte order'. Actual data is always little-endian.
145065
145671
  // We are assuming little-endian platform. If we find a big-endian platform, we'll need to use a DataView instead.
145066
145672
  switch (actualType) {
145067
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedByte:
145673
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte:
145068
145674
  return bytes;
145069
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedShort:
145675
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort:
145070
145676
  return new Uint16Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / 2);
145071
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UInt32:
145677
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UInt32:
145072
145678
  return new Uint32Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / 4);
145073
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float:
145679
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float:
145074
145680
  return new Float32Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / 4);
145075
145681
  default:
145076
145682
  return undefined;
@@ -145197,7 +145803,7 @@ function colorFromJson(values) {
145197
145803
  }
145198
145804
  function colorFromMaterial(material, isTransparent) {
145199
145805
  let color = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.white;
145200
- if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.isGltf1Material)(material)) {
145806
+ if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material)) {
145201
145807
  if (material.values?.color && Array.isArray(material.values.color))
145202
145808
  color = colorFromJson(material.values.color);
145203
145809
  }
@@ -145288,7 +145894,7 @@ class GltfReader {
145288
145894
  * @throws Error if a node appears more than once during traversal
145289
145895
  */
145290
145896
  traverseNodes(nodeIds) {
145291
- return (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.traverseGltfNodes)(nodeIds, this._nodes, new Set());
145897
+ return (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.traverseGltfNodes)(nodeIds, this._nodes, new Set());
145292
145898
  }
145293
145899
  /** Traverse the nodes specified by their scene, recursing into their child nodes.
145294
145900
  * @throws Error if a node appears more than once during traversal
@@ -145413,9 +146019,9 @@ class GltfReader {
145413
146019
  return undefined;
145414
146020
  }
145415
146021
  const translationsView = this.getBufferView(ext.attributes, "TRANSLATION");
145416
- const translations = translationsView?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float);
145417
- const rotations = this.getBufferView(ext.attributes, "ROTATION")?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float);
145418
- const scales = this.getBufferView(ext.attributes, "SCALE")?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float);
146022
+ const translations = translationsView?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
146023
+ const rotations = this.getBufferView(ext.attributes, "ROTATION")?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
146024
+ const scales = this.getBufferView(ext.attributes, "SCALE")?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
145419
146025
  // All attributes must specify the same count, count must be greater than zero, and at least one attribute must be specified.
145420
146026
  const count = translations?.count ?? rotations?.count ?? scales?.count;
145421
146027
  if (!count || (rotations && rotations.count !== count) || (scales && scales.count !== count)) {
@@ -145488,7 +146094,7 @@ class GltfReader {
145488
146094
  let thisBias;
145489
146095
  if (undefined !== pseudoRtcBias)
145490
146096
  thisBias = (undefined === thisTransform) ? pseudoRtcBias : thisTransform.matrix.multiplyInverse(pseudoRtcBias);
145491
- for (const meshKey of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.getGltfNodeMeshIds)(node)) {
146097
+ for (const meshKey of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.getGltfNodeMeshIds)(node)) {
145492
146098
  const nodeMesh = this._meshes[meshKey];
145493
146099
  if (nodeMesh?.primitives) {
145494
146100
  const meshes = this.readMeshPrimitives(node, featureTable, thisTransform, thisBias, nodeInstances);
@@ -145587,23 +146193,28 @@ class GltfReader {
145587
146193
  return undefined;
145588
146194
  const bufferViewAccessorValue = accessor.bufferView;
145589
146195
  const bufferView = undefined !== bufferViewAccessorValue ? this._bufferViews[bufferViewAccessorValue] : undefined;
145590
- if (!bufferView || undefined === bufferView.buffer)
146196
+ if (!bufferView)
145591
146197
  return undefined;
145592
- const buffer = this._buffers[bufferView.buffer];
145593
- const bufferData = buffer?.resolvedBuffer;
146198
+ let bufferData = bufferView.resolvedBuffer;
146199
+ if (!bufferData) {
146200
+ if (undefined === bufferView.buffer)
146201
+ return undefined;
146202
+ const buffer = this._buffers[bufferView.buffer];
146203
+ bufferData = buffer?.resolvedBuffer;
146204
+ }
145594
146205
  if (!bufferData)
145595
146206
  return undefined;
145596
146207
  const type = accessor.componentType;
145597
146208
  let dataSize = 0;
145598
146209
  switch (type) {
145599
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedByte:
146210
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte:
145600
146211
  dataSize = 1;
145601
146212
  break;
145602
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedShort:
146213
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort:
145603
146214
  dataSize = 2;
145604
146215
  break;
145605
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UInt32:
145606
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float:
146216
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UInt32:
146217
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float:
145607
146218
  dataSize = 4;
145608
146219
  break;
145609
146220
  default:
@@ -145633,10 +146244,10 @@ class GltfReader {
145633
146244
  return undefined;
145634
146245
  }
145635
146246
  }
145636
- readBufferData32(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UInt32); }
145637
- readBufferData16(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedShort); }
145638
- readBufferData8(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedByte); }
145639
- readBufferDataFloat(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float); }
146247
+ readBufferData32(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UInt32); }
146248
+ readBufferData16(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort); }
146249
+ readBufferData8(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte); }
146250
+ readBufferDataFloat(json, accessorName) { return this.readBufferData(json, accessorName, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float); }
145640
146251
  constructor(args) {
145641
146252
  this._resolvedTextures = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Dictionary((lhs, rhs) => compareTextureKeys(lhs, rhs));
145642
146253
  this._dracoMeshes = new Map();
@@ -145646,7 +146257,7 @@ class GltfReader {
145646
146257
  * (We also don't want to produce mip-maps for them, which is determined indirectly from the wrap mode).
145647
146258
  * Allow the default to be optionally overridden.
145648
146259
  */
145649
- this.defaultWrapMode = _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfWrapMode.Repeat;
146260
+ this.defaultWrapMode = _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfWrapMode.Repeat;
145650
146261
  this._glTF = args.props.glTF;
145651
146262
  this._version = args.props.version;
145652
146263
  this._yAxisUp = args.props.yAxisUp;
@@ -145698,7 +146309,7 @@ class GltfReader {
145698
146309
  if (typeof material !== "object")
145699
146310
  return undefined;
145700
146311
  // Bimium's shader value...almost certainly obsolete at this point.
145701
- if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.isGltf1Material)(material))
146312
+ if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material))
145702
146313
  return material.diffuse ?? this.extractId(material.values?.tex);
145703
146314
  // KHR_techniques_webgl extension
145704
146315
  const techniques = this._glTF.extensions?.KHR_techniques_webgl?.techniques;
@@ -145708,7 +146319,7 @@ class GltfReader {
145708
146319
  if (typeof uniforms === "object") {
145709
146320
  for (const uniformName of Object.keys(uniforms)) {
145710
146321
  const uniform = uniforms[uniformName];
145711
- if (typeof uniform === "object" && uniform.type === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Sampler2d)
146322
+ if (typeof uniform === "object" && uniform.type === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Sampler2d)
145712
146323
  return this.extractId(ext.values[uniformName]?.index);
145713
146324
  }
145714
146325
  }
@@ -145719,15 +146330,15 @@ class GltfReader {
145719
146330
  extractNormalMapId(material) {
145720
146331
  if (typeof material !== "object")
145721
146332
  return undefined;
145722
- if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.isGltf1Material)(material))
146333
+ if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material))
145723
146334
  return undefined;
145724
146335
  return this.extractId(material.normalTexture?.index);
145725
146336
  }
145726
146337
  isMaterialTransparent(material) {
145727
- if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.isGltf1Material)(material)) {
146338
+ if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material)) {
145728
146339
  if (this._glTF.techniques && undefined !== material.technique) {
145729
146340
  const technique = this._glTF.techniques[material.technique];
145730
- if (technique?.states?.enable?.some((state) => state === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfTechniqueState.Blend))
146341
+ if (technique?.states?.enable?.some((state) => state === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfTechniqueState.Blend))
145731
146342
  return true;
145732
146343
  }
145733
146344
  return false;
@@ -145751,11 +146362,11 @@ class GltfReader {
145751
146362
  // DisplayParams doesn't want a separate texture mapping if the material already has one.
145752
146363
  textureMapping = undefined;
145753
146364
  }
145754
- return new _common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams(_common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams.Type.Mesh, color, color, 1, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.LinePixels.Solid, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FillFlags.None, renderMaterial, undefined, hasBakedLighting, textureMapping);
146365
+ return new _common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_9__.DisplayParams(_common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_9__.DisplayParams.Type.Mesh, color, color, 1, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.LinePixels.Solid, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FillFlags.None, renderMaterial, undefined, hasBakedLighting, textureMapping);
145755
146366
  }
145756
146367
  readMeshPrimitives(node, featureTable, thisTransform, thisBias, instances) {
145757
146368
  const meshes = [];
145758
- for (const meshKey of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.getGltfNodeMeshIds)(node)) {
146369
+ for (const meshKey of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.getGltfNodeMeshIds)(node)) {
145759
146370
  const nodeMesh = this._meshes[meshKey];
145760
146371
  if (nodeMesh?.primitives) {
145761
146372
  for (const primitive of nodeMesh.primitives) {
@@ -145795,9 +146406,9 @@ class GltfReader {
145795
146406
  return meshes;
145796
146407
  }
145797
146408
  readMeshPrimitive(primitive, featureTable, pseudoRtcBias) {
145798
- const meshMode = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asInt(primitive.mode, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfMeshMode.Triangles);
145799
- if (meshMode === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfMeshMode.Points /* && !this._vertexTableRequired */) {
145800
- const pointCloud = this.readPointCloud(primitive, undefined !== featureTable);
146409
+ const meshMode = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asInt(primitive.mode, _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Triangles);
146410
+ if (meshMode === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Points /* && !this._vertexTableRequired */) {
146411
+ const pointCloud = this.readPointCloud2(primitive, undefined !== featureTable);
145801
146412
  if (pointCloud)
145802
146413
  return pointCloud;
145803
146414
  }
@@ -145811,14 +146422,14 @@ class GltfReader {
145811
146422
  return undefined;
145812
146423
  let primitiveType = -1;
145813
146424
  switch (meshMode) {
145814
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfMeshMode.Lines:
145815
- primitiveType = _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_11__.MeshPrimitiveType.Polyline;
146425
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Lines:
146426
+ primitiveType = _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Polyline;
145816
146427
  break;
145817
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfMeshMode.Points:
145818
- primitiveType = _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_11__.MeshPrimitiveType.Point;
146428
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Points:
146429
+ primitiveType = _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Point;
145819
146430
  break;
145820
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfMeshMode.Triangles:
145821
- primitiveType = _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_11__.MeshPrimitiveType.Mesh;
146431
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfMeshMode.Triangles:
146432
+ primitiveType = _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Mesh;
145822
146433
  break;
145823
146434
  default:
145824
146435
  return undefined;
@@ -145846,7 +146457,7 @@ class GltfReader {
145846
146457
  const colorIndices = this.readBufferData16(primitive.attributes, "_COLORINDEX");
145847
146458
  if (undefined !== colorIndices && material) {
145848
146459
  let texStep;
145849
- if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.isGltf1Material)(material))
146460
+ if ((0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material))
145850
146461
  texStep = material.values?.texStep;
145851
146462
  else
145852
146463
  texStep = material.extensions?.KHR_techniques_webgl?.values?.u_texStep;
@@ -145876,14 +146487,14 @@ class GltfReader {
145876
146487
  if (!this.readVertices(mesh, primitive, pseudoRtcBias))
145877
146488
  return undefined;
145878
146489
  switch (primitiveType) {
145879
- case _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_11__.MeshPrimitiveType.Mesh: {
146490
+ case _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Mesh: {
145880
146491
  if (!this.readMeshIndices(mesh, primitive))
145881
146492
  return undefined;
145882
146493
  if (!displayParams.ignoreLighting && !this.readNormals(mesh, primitive.attributes, "NORMAL"))
145883
146494
  return undefined;
145884
146495
  if (!mesh.uvs) {
145885
146496
  let texCoordIndex = 0;
145886
- if (!(0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.isGltf1Material)(material) && undefined !== material.pbrMetallicRoughness?.baseColorTexture?.texCoord)
146497
+ if (!(0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.isGltf1Material)(material) && undefined !== material.pbrMetallicRoughness?.baseColorTexture?.texCoord)
145887
146498
  texCoordIndex = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asInt(material.pbrMetallicRoughness.baseColorTexture.texCoord);
145888
146499
  this.readUVParams(mesh, primitive.attributes, `TEXCOORD_${texCoordIndex}`);
145889
146500
  }
@@ -145891,9 +146502,9 @@ class GltfReader {
145891
146502
  return undefined;
145892
146503
  break;
145893
146504
  }
145894
- case _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_11__.MeshPrimitiveType.Polyline:
145895
- case _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_11__.MeshPrimitiveType.Point: {
145896
- if (undefined !== mesh.primitive.polylines && !this.readPolylines(mesh.primitive.polylines, primitive, "indices", _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_11__.MeshPrimitiveType.Point === primitiveType))
146505
+ case _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Polyline:
146506
+ case _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Point: {
146507
+ if (undefined !== mesh.primitive.polylines && !this.readPolylines(mesh.primitive.polylines, primitive, "indices", _common_render_primitives_MeshPrimitive__WEBPACK_IMPORTED_MODULE_12__.MeshPrimitiveType.Point === primitiveType))
145897
146508
  return undefined;
145898
146509
  break;
145899
146510
  }
@@ -145915,23 +146526,60 @@ class GltfReader {
145915
146526
  }
145916
146527
  return mesh;
145917
146528
  }
145918
- readPointCloud(primitive, hasFeatures) {
146529
+ readPointCloud2(primitive, hasFeatures) {
146530
+ let pointRange;
146531
+ let positions;
146532
+ let qparams;
145919
146533
  const posView = this.getBufferView(primitive.attributes, "POSITION");
145920
- if (!posView || _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float !== posView.type)
145921
- return undefined;
145922
- const posData = posView.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float);
145923
- if (!(posData?.buffer instanceof Float32Array))
145924
- return undefined;
146534
+ switch (posView?.type) {
146535
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float: {
146536
+ const posData = posView.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
146537
+ if (!(posData?.buffer instanceof Float32Array)) {
146538
+ return undefined;
146539
+ }
146540
+ positions = posData.buffer;
146541
+ const strideSkip = posView.stride - 3;
146542
+ pointRange = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d();
146543
+ for (let i = 0; i < positions.length; i += strideSkip) {
146544
+ pointRange.extendXYZ(positions[i++], positions[i++], positions[i++]);
146545
+ }
146546
+ qparams = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.QParams3d.fromOriginAndScale(new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d(0, 0, 0), new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d(1, 1, 1));
146547
+ break;
146548
+ }
146549
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte:
146550
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort: {
146551
+ const posData = posView.toBufferData(posView.type);
146552
+ if (!(posData?.buffer instanceof Uint8Array || posData?.buffer instanceof Uint16Array)) {
146553
+ return undefined;
146554
+ }
146555
+ positions = posData.buffer;
146556
+ let min, max;
146557
+ const ext = posView.accessor.extensions?.WEB3D_quantized_attributes;
146558
+ if (ext) {
146559
+ min = ext.decodedMin;
146560
+ max = ext.decodedMax;
146561
+ }
146562
+ else {
146563
+ // Assume KHR_mesh_quantization...
146564
+ min = posView.accessor.min;
146565
+ max = posView.accessor.max;
146566
+ }
146567
+ if (undefined === min || undefined === max) {
146568
+ return undefined;
146569
+ }
146570
+ pointRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d.createXYZXYZ(min[0], min[1], min[2], max[0], max[1], max[2]);
146571
+ qparams = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.QParams3d.fromRange(pointRange);
146572
+ break;
146573
+ }
146574
+ default:
146575
+ return undefined;
146576
+ }
145925
146577
  const colorView = this.getBufferView(primitive.attributes, "COLOR_0");
145926
- if (!colorView || _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedByte !== colorView.type)
146578
+ if (!colorView || _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte !== colorView.type)
145927
146579
  return undefined;
145928
- const colorData = colorView.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedByte);
146580
+ const colorData = colorView.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte);
145929
146581
  if (!(colorData?.buffer instanceof Uint8Array))
145930
146582
  return undefined;
145931
- const strideSkip = posView.stride - 3;
145932
- const pointRange = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d();
145933
- for (let i = 0; i < posData.buffer.length; i += strideSkip)
145934
- pointRange.extendXYZ(posData.buffer[i++], posData.buffer[i++], posData.buffer[i++]);
145935
146583
  let colors = colorData.buffer;
145936
146584
  if ("VEC4" === colorView.accessor.type) {
145937
146585
  // ###TODO support transparent point clouds
@@ -145944,13 +146592,14 @@ class GltfReader {
145944
146592
  }
145945
146593
  }
145946
146594
  const features = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FeatureIndex();
145947
- if (hasFeatures)
146595
+ if (hasFeatures) {
145948
146596
  features.type = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FeatureIndexType.Uniform;
146597
+ }
145949
146598
  this._containsPointCloud = true;
145950
146599
  return {
145951
146600
  type: "pointcloud",
145952
- positions: posData.buffer,
145953
- qparams: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.QParams3d.fromOriginAndScale(new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d(0, 0, 0), new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d(1, 1, 1)),
146601
+ positions,
146602
+ qparams,
145954
146603
  pointRange,
145955
146604
  colors,
145956
146605
  colorFormat: "rgb",
@@ -146057,8 +146706,8 @@ class GltfReader {
146057
146706
  const view = this.getBufferView(primitive.attributes, "POSITION");
146058
146707
  if (undefined === view)
146059
146708
  return false;
146060
- if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float === view.type) {
146061
- const buffer = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float);
146709
+ if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float === view.type) {
146710
+ const buffer = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
146062
146711
  if (undefined === buffer)
146063
146712
  return false;
146064
146713
  const strideSkip = view.stride - 3;
@@ -146077,15 +146726,23 @@ class GltfReader {
146077
146726
  mesh.points = positions.toTypedArray();
146078
146727
  }
146079
146728
  else {
146080
- if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedShort !== view.type)
146729
+ if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort !== view.type)
146081
146730
  return false;
146731
+ let rangeMin, rangeMax;
146082
146732
  const quantized = view.accessor.extensions?.WEB3D_quantized_attributes;
146083
- const rangeMin = quantized?.decodedMin;
146084
- const rangeMax = quantized?.decodedMax;
146085
- if (!rangeMin || !rangeMax) // required by spec...
146733
+ if (quantized) {
146734
+ rangeMin = quantized.decodedMin;
146735
+ rangeMax = quantized.decodedMax;
146736
+ }
146737
+ else {
146738
+ // Assume KHR_mesh_quantization...
146739
+ rangeMin = view.accessor.min;
146740
+ rangeMax = view.accessor.max;
146741
+ }
146742
+ if (undefined === rangeMin || undefined === rangeMax) // required by spec...
146086
146743
  return false;
146087
146744
  // ###TODO apply WEB3D_quantized_attributes.decodeMatrix? Have not encountered in the wild; glTF 1.0 only.
146088
- const buffer = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedShort);
146745
+ const buffer = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort);
146089
146746
  if (undefined === buffer || !(buffer.buffer instanceof Uint16Array))
146090
146747
  return false;
146091
146748
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(buffer.buffer instanceof Uint16Array);
@@ -146147,8 +146804,8 @@ class GltfReader {
146147
146804
  if (undefined === view)
146148
146805
  return false;
146149
146806
  switch (view.type) {
146150
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float: {
146151
- const data = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float);
146807
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float: {
146808
+ const data = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float);
146152
146809
  if (undefined === data)
146153
146810
  return false;
146154
146811
  mesh.normals = new Uint16Array(data.count);
@@ -146160,8 +146817,8 @@ class GltfReader {
146160
146817
  }
146161
146818
  return true;
146162
146819
  }
146163
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedByte: {
146164
- const data = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedByte);
146820
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte: {
146821
+ const data = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte);
146165
146822
  if (undefined === data)
146166
146823
  return false;
146167
146824
  // ###TODO: we shouldn't have to allocate OctEncodedNormal objects...just use uint16s / numbers...
@@ -146180,13 +146837,13 @@ class GltfReader {
146180
146837
  }
146181
146838
  readColors(mesh, attribute, accessorName) {
146182
146839
  const view = this.getBufferView(attribute, accessorName);
146183
- if (!view || (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float !== view.type && _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedByte !== view.type && _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.SignedByte !== view.type))
146840
+ if (!view || (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float !== view.type && _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedByte !== view.type && _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.SignedByte !== view.type))
146184
146841
  return false;
146185
146842
  const data = view.toBufferData(view.type);
146186
146843
  if (!data)
146187
146844
  return false;
146188
146845
  const hasAlpha = "VEC4" === view.accessor.type;
146189
- const factor = view.type === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float ? 255 : 1;
146846
+ const factor = view.type === _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float ? 255 : 1;
146190
146847
  const rgbt = new Uint8Array(4);
146191
146848
  const color = new Uint32Array(rgbt.buffer);
146192
146849
  for (let i = 0; i < data.count; i++) {
@@ -146204,7 +146861,7 @@ class GltfReader {
146204
146861
  if (view === undefined)
146205
146862
  return false;
146206
146863
  switch (view.type) {
146207
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float: {
146864
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.Float: {
146208
146865
  const data = this.readBufferDataFloat(json, accessorName);
146209
146866
  if (!data)
146210
146867
  return false;
@@ -146222,13 +146879,13 @@ class GltfReader {
146222
146879
  }
146223
146880
  return true;
146224
146881
  }
146225
- case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedShort: {
146882
+ case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort: {
146226
146883
  const quantized = view.accessor.extensions?.WEB3D_quantized_attributes;
146227
146884
  const rangeMin = quantized?.decodedMin;
146228
146885
  const rangeMax = quantized?.decodedMax;
146229
146886
  if (undefined === rangeMin || undefined === rangeMax)
146230
146887
  return false;
146231
- const qData = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedShort);
146888
+ const qData = view.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfDataType.UnsignedShort);
146232
146889
  if (undefined === qData || !(qData.buffer instanceof Uint16Array))
146233
146890
  return false;
146234
146891
  mesh.uvRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range2d.createXYXY(rangeMin[0], rangeMin[1], rangeMax[0], rangeMax[1]);
@@ -146282,10 +146939,30 @@ class GltfReader {
146282
146939
  async resolveResources() {
146283
146940
  // Load any external images and buffers.
146284
146941
  await this._resolveResources();
146942
+ // Decompress any meshopt-compressed buffer views
146943
+ const decodeMeshoptBuffers = [];
146944
+ for (const bv of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.gltfDictionaryIterator)(this._bufferViews)) {
146945
+ const ext = bv.extensions?.EXT_meshopt_compression;
146946
+ if (ext) {
146947
+ const bufferData = this._buffers[ext.buffer]?.resolvedBuffer;
146948
+ if (bufferData) {
146949
+ const source = new Uint8Array(bufferData.buffer, bufferData.byteOffset + (ext.byteOffset ?? 0), ext.byteLength ?? 0);
146950
+ const decode = async () => {
146951
+ bv.resolvedBuffer = await (0,_internal__WEBPACK_IMPORTED_MODULE_8__.decodeMeshoptBuffer)(source, ext);
146952
+ if (bv.resolvedBuffer) {
146953
+ bv.byteLength = bv.resolvedBuffer.byteLength;
146954
+ bv.byteOffset = 0;
146955
+ }
146956
+ };
146957
+ decodeMeshoptBuffers.push(decode());
146958
+ }
146959
+ }
146960
+ }
146961
+ await Promise.all(decodeMeshoptBuffers);
146285
146962
  // If any meshes are draco-compressed, dynamically load the decoder module and then decode the meshes.
146286
146963
  const dracoMeshes = [];
146287
146964
  for (const node of this.traverseScene()) {
146288
- for (const meshId of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.getGltfNodeMeshIds)(node)) {
146965
+ for (const meshId of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.getGltfNodeMeshIds)(node)) {
146289
146966
  const mesh = this._meshes[meshId];
146290
146967
  if (mesh?.primitives)
146291
146968
  for (const primitive of mesh.primitives)
@@ -146300,8 +146977,8 @@ class GltfReader {
146300
146977
  await Promise.all(dracoMeshes.map(async (x) => this.decodeDracoMesh(x, dracoLoader)));
146301
146978
  }
146302
146979
  catch (err) {
146303
- _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_9__.FrontendLoggerCategory.Render, "Failed to decode draco-encoded glTF mesh");
146304
- _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logException(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_9__.FrontendLoggerCategory.Render, err);
146980
+ _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_10__.FrontendLoggerCategory.Render, "Failed to decode draco-encoded glTF mesh");
146981
+ _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logException(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_10__.FrontendLoggerCategory.Render, err);
146305
146982
  }
146306
146983
  }
146307
146984
  async _resolveResources() {
@@ -146309,14 +146986,14 @@ class GltfReader {
146309
146986
  // be required for the scene.
146310
146987
  const promises = [];
146311
146988
  try {
146312
- for (const buffer of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.gltfDictionaryIterator)(this._buffers))
146989
+ for (const buffer of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.gltfDictionaryIterator)(this._buffers))
146313
146990
  if (!buffer.resolvedBuffer)
146314
146991
  promises.push(this.resolveBuffer(buffer));
146315
146992
  await Promise.all(promises);
146316
146993
  if (this._isCanceled)
146317
146994
  return;
146318
146995
  promises.length = 0;
146319
- for (const image of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.gltfDictionaryIterator)(this._images))
146996
+ for (const image of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.gltfDictionaryIterator)(this._images))
146320
146997
  if (!image.resolvedImage)
146321
146998
  promises.push(this.resolveImage(image));
146322
146999
  await Promise.all(promises);
@@ -146370,7 +147047,7 @@ class GltfReader {
146370
147047
  return;
146371
147048
  const bvSrc = undefined !== image.bufferView ? image : image.extensions?.KHR_binary_glTF;
146372
147049
  if (undefined !== bvSrc?.bufferView) {
146373
- const format = undefined !== bvSrc.mimeType ? (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_10__.getImageSourceFormatForMimeType)(bvSrc.mimeType) : undefined;
147050
+ const format = undefined !== bvSrc.mimeType ? (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__.getImageSourceFormatForMimeType)(bvSrc.mimeType) : undefined;
146374
147051
  const bufferView = this._bufferViews[bvSrc.bufferView];
146375
147052
  if (undefined === format || !bufferView || !bufferView.byteLength || bufferView.byteLength < 0)
146376
147053
  return;
@@ -146382,9 +147059,9 @@ class GltfReader {
146382
147059
  try {
146383
147060
  const imageSource = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ImageSource(bytes, format);
146384
147061
  if (this._system.supportsCreateImageBitmap)
146385
- image.resolvedImage = await (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_10__.imageBitmapFromImageSource)(imageSource);
147062
+ image.resolvedImage = await (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__.imageBitmapFromImageSource)(imageSource);
146386
147063
  else
146387
- image.resolvedImage = await (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_10__.imageElementFromImageSource)(imageSource);
147064
+ image.resolvedImage = await (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__.imageElementFromImageSource)(imageSource);
146388
147065
  }
146389
147066
  catch (_) {
146390
147067
  //
@@ -146393,7 +147070,7 @@ class GltfReader {
146393
147070
  }
146394
147071
  const url = undefined !== image.uri ? this.resolveUrl(image.uri) : undefined;
146395
147072
  if (undefined !== url)
146396
- image.resolvedImage = await (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_10__.tryImageElementFromUrl)(url);
147073
+ image.resolvedImage = await (0,_common_ImageUtil__WEBPACK_IMPORTED_MODULE_11__.tryImageElementFromUrl)(url);
146397
147074
  }
146398
147075
  /** Exposed strictly for testing. */
146399
147076
  getTextureType(sampler) {
@@ -146402,7 +147079,7 @@ class GltfReader {
146402
147079
  let wrapT = sampler?.wrapT;
146403
147080
  if (undefined === wrapS && undefined === wrapT)
146404
147081
  wrapS = wrapT = this.defaultWrapMode;
146405
- if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfWrapMode.ClampToEdge === wrapS || _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfWrapMode.ClampToEdge === wrapT)
147082
+ if (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfWrapMode.ClampToEdge === wrapS || _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_13__.GltfWrapMode.ClampToEdge === wrapT)
146406
147083
  return _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.RenderTexture.Type.TileSection;
146407
147084
  return _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.RenderTexture.Type.Normal;
146408
147085
  }
@@ -148538,6 +149215,88 @@ class LRUTileList {
148538
149215
  }
148539
149216
 
148540
149217
 
149218
+ /***/ }),
149219
+
149220
+ /***/ "../../core/frontend/lib/esm/tile/MeshoptCompression.js":
149221
+ /*!**************************************************************!*\
149222
+ !*** ../../core/frontend/lib/esm/tile/MeshoptCompression.js ***!
149223
+ \**************************************************************/
149224
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
149225
+
149226
+ "use strict";
149227
+ __webpack_require__.r(__webpack_exports__);
149228
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
149229
+ /* harmony export */ "decodeMeshoptBuffer": () => (/* binding */ decodeMeshoptBuffer)
149230
+ /* harmony export */ });
149231
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
149232
+ /* harmony import */ var _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/FrontendLoggerCategory */ "../../core/frontend/lib/esm/common/FrontendLoggerCategory.js");
149233
+ /*---------------------------------------------------------------------------------------------
149234
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
149235
+ * See LICENSE.md in the project root for license terms and full copyright notice.
149236
+ *--------------------------------------------------------------------------------------------*/
149237
+ /** @packageDocumentation
149238
+ * @module Tiles
149239
+ */
149240
+
149241
+
149242
+ /** Loads and configures the MeshoptDecoder module on demand. */
149243
+ class Loader {
149244
+ constructor() {
149245
+ this._status = "uninitialized";
149246
+ }
149247
+ async getDecoder() {
149248
+ const status = this._status;
149249
+ switch (status) {
149250
+ case "failed":
149251
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined === this._decoder);
149252
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined === this._promise);
149253
+ return undefined;
149254
+ case "ready":
149255
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== this._decoder);
149256
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined === this._promise);
149257
+ return this._decoder;
149258
+ case "loading":
149259
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== this._promise);
149260
+ await this._promise;
149261
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)("failed" === this._status || "ready" === this._status);
149262
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined === this._promise);
149263
+ return this._decoder;
149264
+ }
149265
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)("uninitialized" === status);
149266
+ this._status = "loading";
149267
+ this._promise = this.load();
149268
+ return this.getDecoder();
149269
+ }
149270
+ async load() {
149271
+ try {
149272
+ // Import the module on first use.
149273
+ const decoder = (await __webpack_require__.e(/*! import() */ "vendors-common_temp_node_modules_pnpm_meshoptimizer_0_20_0_node_modules_meshoptimizer_index_m-a5ae61").then(__webpack_require__.bind(__webpack_require__, /*! meshoptimizer */ "../../common/temp/node_modules/.pnpm/meshoptimizer@0.20.0/node_modules/meshoptimizer/index.module.js"))).MeshoptDecoder;
149274
+ await decoder.ready;
149275
+ // Configure it to do the decoding outside of the main thread. No compelling reason to use more than one worker.
149276
+ decoder.useWorkers(1);
149277
+ this._status = "ready";
149278
+ this._decoder = decoder;
149279
+ }
149280
+ catch (err) {
149281
+ _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logException(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_1__.FrontendLoggerCategory.Render, err);
149282
+ this._status = "failed";
149283
+ }
149284
+ finally {
149285
+ this._promise = undefined;
149286
+ }
149287
+ }
149288
+ }
149289
+ const loader = new Loader();
149290
+ /** @internal */
149291
+ async function decodeMeshoptBuffer(source, args) {
149292
+ const decoder = await loader.getDecoder();
149293
+ if (!decoder) {
149294
+ return undefined;
149295
+ }
149296
+ return decoder.decodeGltfBufferAsync(args.count, args.byteStride, source, args.mode, args.filter);
149297
+ }
149298
+
149299
+
148541
149300
  /***/ }),
148542
149301
 
148543
149302
  /***/ "../../core/frontend/lib/esm/tile/OPCFormatInterpreter.js":
@@ -155711,6 +156470,7 @@ __webpack_require__.r(__webpack_exports__);
155711
156470
  /* harmony export */ "createRealityTileTreeReference": () => (/* reexport safe */ _RealityModelTileTree__WEBPACK_IMPORTED_MODULE_73__.createRealityTileTreeReference),
155712
156471
  /* harmony export */ "createSpatialTileTreeReferences": () => (/* reexport safe */ _PrimaryTileTree__WEBPACK_IMPORTED_MODULE_78__.createSpatialTileTreeReferences),
155713
156472
  /* harmony export */ "decodeImdlGraphics": () => (/* reexport safe */ _ImdlGraphicsCreator__WEBPACK_IMPORTED_MODULE_35__.decodeImdlGraphics),
156473
+ /* harmony export */ "decodeMeshoptBuffer": () => (/* reexport safe */ _MeshoptCompression__WEBPACK_IMPORTED_MODULE_89__.decodeMeshoptBuffer),
155714
156474
  /* harmony export */ "disposeTileTreesForGeometricModels": () => (/* reexport safe */ _PrimaryTileTree__WEBPACK_IMPORTED_MODULE_78__.disposeTileTreesForGeometricModels),
155715
156475
  /* harmony export */ "getCesiumAccessTokenAndEndpointUrl": () => (/* reexport safe */ _map_CesiumTerrainProvider__WEBPACK_IMPORTED_MODULE_64__.getCesiumAccessTokenAndEndpointUrl),
155716
156476
  /* harmony export */ "getCesiumAssetUrl": () => (/* reexport safe */ _map_CesiumTerrainProvider__WEBPACK_IMPORTED_MODULE_64__.getCesiumAssetUrl),
@@ -155817,6 +156577,7 @@ __webpack_require__.r(__webpack_exports__);
155817
156577
  /* harmony import */ var _ThreeDTileFormatInterpreter__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./ThreeDTileFormatInterpreter */ "../../core/frontend/lib/esm/tile/ThreeDTileFormatInterpreter.js");
155818
156578
  /* harmony import */ var _OPCFormatInterpreter__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./OPCFormatInterpreter */ "../../core/frontend/lib/esm/tile/OPCFormatInterpreter.js");
155819
156579
  /* harmony import */ var _FetchCloudStorage__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./FetchCloudStorage */ "../../core/frontend/lib/esm/tile/FetchCloudStorage.js");
156580
+ /* harmony import */ var _MeshoptCompression__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./MeshoptCompression */ "../../core/frontend/lib/esm/tile/MeshoptCompression.js");
155820
156581
  /*---------------------------------------------------------------------------------------------
155821
156582
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
155822
156583
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -155922,6 +156683,7 @@ __webpack_require__.r(__webpack_exports__);
155922
156683
 
155923
156684
 
155924
156685
 
156686
+
155925
156687
 
155926
156688
 
155927
156689
  /***/ }),
@@ -159806,8 +160568,11 @@ class WmtsMapLayerFormat extends ImageryMapLayerFormat {
159806
160568
  return { status: _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSourceStatus.Valid, subLayers };
159807
160569
  }
159808
160570
  catch (err) {
159809
- console.error(err); // eslint-disable-line no-console
159810
- return { status: _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSourceStatus.InvalidUrl };
160571
+ let status = _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSourceStatus.InvalidUrl;
160572
+ if (err?.status === 401) {
160573
+ status = ((userName && password) ? _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSourceStatus.InvalidCredentials : _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerSourceStatus.RequireAuth);
160574
+ }
160575
+ return { status };
159811
160576
  }
159812
160577
  }
159813
160578
  }
@@ -189801,7 +190566,7 @@ __webpack_require__.r(__webpack_exports__);
189801
190566
  /* harmony export */ "BSplineWrapMode": () => (/* reexport safe */ _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_108__.BSplineWrapMode),
189802
190567
  /* harmony export */ "BagOfCurves": () => (/* reexport safe */ _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_64__.BagOfCurves),
189803
190568
  /* harmony export */ "BarycentricTriangle": () => (/* reexport safe */ _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_3__.BarycentricTriangle),
189804
- /* harmony export */ "BentleyGeometryFlatBuffer": () => (/* reexport safe */ _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_129__.BentleyGeometryFlatBuffer),
190569
+ /* harmony export */ "BentleyGeometryFlatBuffer": () => (/* reexport safe */ _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_130__.BentleyGeometryFlatBuffer),
189805
190570
  /* harmony export */ "Bezier1dNd": () => (/* reexport safe */ _bspline_Bezier1dNd__WEBPACK_IMPORTED_MODULE_98__.Bezier1dNd),
189806
190571
  /* harmony export */ "BezierCoffs": () => (/* reexport safe */ _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_51__.BezierCoffs),
189807
190572
  /* harmony export */ "BezierCurve3d": () => (/* reexport safe */ _bspline_BezierCurve3d__WEBPACK_IMPORTED_MODULE_100__.BezierCurve3d),
@@ -189965,6 +190730,7 @@ __webpack_require__.r(__webpack_exports__);
189965
190730
  /* harmony export */ "RuledSweep": () => (/* reexport safe */ _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_92__.RuledSweep),
189966
190731
  /* harmony export */ "Sample": () => (/* reexport safe */ _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_128__.Sample),
189967
190732
  /* harmony export */ "Segment1d": () => (/* reexport safe */ _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_31__.Segment1d),
190733
+ /* harmony export */ "SerializationHelpers": () => (/* reexport safe */ _serialization_SerializationHelpers__WEBPACK_IMPORTED_MODULE_129__.SerializationHelpers),
189968
190734
  /* harmony export */ "SineCosinePolynomial": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.SineCosinePolynomial),
189969
190735
  /* harmony export */ "SmallSystem": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.SmallSystem),
189970
190736
  /* harmony export */ "SmoothTransformBetweenFrusta": () => (/* reexport safe */ _geometry3d_FrustumAnimation__WEBPACK_IMPORTED_MODULE_7__.SmoothTransformBetweenFrusta),
@@ -190133,7 +190899,8 @@ __webpack_require__.r(__webpack_exports__);
190133
190899
  /* harmony import */ var _serialization_IModelJsonSchema__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(/*! ./serialization/IModelJsonSchema */ "../../core/geometry/lib/esm/serialization/IModelJsonSchema.js");
190134
190900
  /* harmony import */ var _serialization_DeepCompare__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(/*! ./serialization/DeepCompare */ "../../core/geometry/lib/esm/serialization/DeepCompare.js");
190135
190901
  /* harmony import */ var _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(/*! ./serialization/GeometrySamples */ "../../core/geometry/lib/esm/serialization/GeometrySamples.js");
190136
- /* harmony import */ var _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(/*! ./serialization/BentleyGeometryFlatBuffer */ "../../core/geometry/lib/esm/serialization/BentleyGeometryFlatBuffer.js");
190902
+ /* harmony import */ var _serialization_SerializationHelpers__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(/*! ./serialization/SerializationHelpers */ "../../core/geometry/lib/esm/serialization/SerializationHelpers.js");
190903
+ /* harmony import */ var _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_130__ = __webpack_require__(/*! ./serialization/BentleyGeometryFlatBuffer */ "../../core/geometry/lib/esm/serialization/BentleyGeometryFlatBuffer.js");
190137
190904
  /*---------------------------------------------------------------------------------------------
190138
190905
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
190139
190906
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -190385,6 +191152,7 @@ __webpack_require__.r(__webpack_exports__);
190385
191152
 
190386
191153
 
190387
191154
 
191155
+
190388
191156
 
190389
191157
 
190390
191158
  /***/ }),
@@ -260465,22 +261233,22 @@ __webpack_require__.r(__webpack_exports__);
260465
261233
 
260466
261234
 
260467
261235
  /**
260468
- * `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry.
260469
- * @internal
261236
+ * The `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry, such as B-spline curves and surfaces.
261237
+ * @public
260470
261238
  */
260471
261239
  var SerializationHelpers;
260472
261240
  (function (SerializationHelpers) {
260473
- /** Constructor with required data. Inputs are captured, not copied. */
261241
+ /** Constructor for BSplineCurveData that populates the required data. Inputs are captured, not copied. */
260474
261242
  function createBSplineCurveData(poles, dim, knots, numPoles, order) {
260475
261243
  return { poles, dim, params: { numPoles, order, knots } };
260476
261244
  }
260477
261245
  SerializationHelpers.createBSplineCurveData = createBSplineCurveData;
260478
- /** Constructor with required data. Inputs are captured, not copied. */
261246
+ /** Constructor for BSplineSurfaceData that populates the required data. Inputs are captured, not copied. */
260479
261247
  function createBSplineSurfaceData(poles, dim, uKnots, uNumPoles, uOrder, vKnots, vNumPoles, vOrder) {
260480
261248
  return { poles, dim, uParams: { numPoles: uNumPoles, order: uOrder, knots: uKnots }, vParams: { numPoles: vNumPoles, order: vOrder, knots: vKnots } };
260481
261249
  }
260482
261250
  SerializationHelpers.createBSplineSurfaceData = createBSplineSurfaceData;
260483
- /** Clone curve data */
261251
+ /** Clone B-spline curve data */
260484
261252
  function cloneBSplineCurveData(source) {
260485
261253
  return {
260486
261254
  poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.copy2d(source.poles),
@@ -260496,7 +261264,7 @@ var SerializationHelpers;
260496
261264
  };
260497
261265
  }
260498
261266
  SerializationHelpers.cloneBSplineCurveData = cloneBSplineCurveData;
260499
- /** Clone surface data */
261267
+ /** Clone B-spline surface data */
260500
261268
  function cloneBSplineSurfaceData(source) {
260501
261269
  return {
260502
261270
  poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.copy3d(source.poles),
@@ -260519,7 +261287,7 @@ var SerializationHelpers;
260519
261287
  };
260520
261288
  }
260521
261289
  SerializationHelpers.cloneBSplineSurfaceData = cloneBSplineSurfaceData;
260522
- /** Copy from source to dest */
261290
+ /** Copy B-spline curve data from source to dest */
260523
261291
  function copyBSplineCurveDataPoles(source) {
260524
261292
  let nPole = 0;
260525
261293
  let nCoordPerPole = 0;
@@ -260566,7 +261334,7 @@ var SerializationHelpers;
260566
261334
  weights = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.create(source.weights);
260567
261335
  return { poles, weights };
260568
261336
  }
260569
- /** Copy from source to dest */
261337
+ /** Copy B-spline surface data from source to dest */
260570
261338
  function copyBSplineSurfaceDataPoles(source) {
260571
261339
  let nPoleRow = 0;
260572
261340
  let nPolePerRow = 0;
@@ -260625,7 +261393,7 @@ var SerializationHelpers;
260625
261393
  }
260626
261394
  return { poles, weights };
260627
261395
  }
260628
- /** Convert data arrays to the types specified by options. */
261396
+ /** Convert B-spline curve data arrays to the types specified by options. */
260629
261397
  function convertBSplineCurveDataArrays(data, options) {
260630
261398
  if (undefined !== options?.jsonPoles) {
260631
261399
  const packedPoles = data.poles instanceof Float64Array;
@@ -260649,7 +261417,7 @@ var SerializationHelpers;
260649
261417
  data.params.knots = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.pack(data.params.knots);
260650
261418
  }
260651
261419
  }
260652
- /** Convert data arrays to the types specified by options. */
261420
+ /** Convert B-spline surface data arrays to the types specified by options. */
260653
261421
  function convertBSplineSurfaceDataArrays(data, options) {
260654
261422
  if (undefined !== options?.jsonPoles) {
260655
261423
  const packedPoles = data.poles instanceof Float64Array;
@@ -260678,6 +261446,7 @@ var SerializationHelpers;
260678
261446
  data.vParams.knots = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.pack(data.vParams.knots);
260679
261447
  }
260680
261448
  }
261449
+ /** Helper class for preparing geometry data for import. */
260681
261450
  class Import {
260682
261451
  /** copy knots, with options to control destination type and extraneous knot removal */
260683
261452
  static copyKnots(knots, options, iStart, iEnd) {
@@ -260874,6 +261643,7 @@ var SerializationHelpers;
260874
261643
  }
260875
261644
  }
260876
261645
  SerializationHelpers.Import = Import;
261646
+ /** Helper class for preparing geometry data for export. */
260877
261647
  class Export {
260878
261648
  /**
260879
261649
  * Restore special legacy periodic B-spline knots opened via BSplineWrapMode.OpenByRemovingKnots logic.
@@ -289925,7 +290695,7 @@ class TestContext {
289925
290695
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
289926
290696
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
289927
290697
  await core_frontend_1.NoRenderApp.startup({
289928
- applicationVersion: "4.6.0-dev.1",
290698
+ applicationVersion: "4.6.0-dev.13",
289929
290699
  applicationId: this.settings.gprid,
289930
290700
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
289931
290701
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -291016,7 +291786,7 @@ class KeySet {
291016
291786
  this._nodeKeys.add(JSON.stringify(key));
291017
291787
  }
291018
291788
  for (const entry of keyset.instanceKeys) {
291019
- const lcClassName = entry["0"].toLowerCase();
291789
+ const lcClassName = normalizeClassName(entry["0"]);
291020
291790
  const idsJson = entry["1"];
291021
291791
  const ids = typeof idsJson === "string" ? (idsJson === _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.invalid ? new Set([_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.invalid]) : _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.CompressedId64Set.decompressSet(idsJson)) : new Set(idsJson);
291022
291792
  this._instanceKeys.set(lcClassName, ids);
@@ -291045,7 +291815,7 @@ class KeySet {
291045
291815
  this.add({ className: value.classFullName, id: _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.fromJSON(value.id) });
291046
291816
  }
291047
291817
  else if (Key.isInstanceKey(value)) {
291048
- const lcClassName = value.className.toLowerCase();
291818
+ const lcClassName = normalizeClassName(value.className);
291049
291819
  if (!this._instanceKeys.has(lcClassName)) {
291050
291820
  this._instanceKeys.set(lcClassName, new Set());
291051
291821
  this._lowerCaseMap.set(lcClassName, value.className);
@@ -291070,7 +291840,7 @@ class KeySet {
291070
291840
  this._nodeKeys.delete(key);
291071
291841
  }
291072
291842
  for (const entry of keyset._instanceKeys) {
291073
- const set = this._instanceKeys.get(entry["0"].toLowerCase());
291843
+ const set = this._instanceKeys.get(entry["0"]);
291074
291844
  if (set) {
291075
291845
  entry["1"].forEach((key) => {
291076
291846
  set.delete(key);
@@ -291100,7 +291870,7 @@ class KeySet {
291100
291870
  this.delete({ className: value.classFullName, id: value.id });
291101
291871
  }
291102
291872
  else if (Key.isInstanceKey(value)) {
291103
- const set = this._instanceKeys.get(value.className.toLowerCase());
291873
+ const set = this._instanceKeys.get(normalizeClassName(value.className));
291104
291874
  if (set) {
291105
291875
  set.delete(value.id);
291106
291876
  }
@@ -291128,7 +291898,7 @@ class KeySet {
291128
291898
  return this.has({ className: value.classFullName, id: value.id });
291129
291899
  }
291130
291900
  if (Key.isInstanceKey(value)) {
291131
- const set = this._instanceKeys.get(value.className.toLowerCase());
291901
+ const set = this._instanceKeys.get(normalizeClassName(value.className));
291132
291902
  return !!(set && set.has(value.id));
291133
291903
  }
291134
291904
  if (Key.isNodeKey(value)) {
@@ -291147,7 +291917,7 @@ class KeySet {
291147
291917
  return false;
291148
291918
  }
291149
291919
  for (const otherEntry of keys._instanceKeys) {
291150
- const thisEntryKeys = this._instanceKeys.get(otherEntry["0"].toLowerCase());
291920
+ const thisEntryKeys = this._instanceKeys.get(otherEntry["0"]);
291151
291921
  if (!thisEntryKeys || thisEntryKeys.size < otherEntry["1"].size) {
291152
291922
  return false;
291153
291923
  }
@@ -291162,7 +291932,7 @@ class KeySet {
291162
291932
  return true;
291163
291933
  }
291164
291934
  for (const otherEntry of keys._instanceKeys) {
291165
- const thisEntryKeys = this._instanceKeys.get(otherEntry["0"].toLowerCase());
291935
+ const thisEntryKeys = this._instanceKeys.get(otherEntry["0"]);
291166
291936
  if (thisEntryKeys && [...otherEntry["1"]].some((key) => thisEntryKeys.has(key))) {
291167
291937
  return true;
291168
291938
  }
@@ -291315,6 +292085,9 @@ class KeySet {
291315
292085
  return keyset;
291316
292086
  }
291317
292087
  }
292088
+ function normalizeClassName(className) {
292089
+ return className.replace(".", ":").toLowerCase();
292090
+ }
291318
292091
  const some = (set, cb) => {
291319
292092
  for (const item of set) {
291320
292093
  if (cb(item)) {
@@ -296916,11 +297689,13 @@ class Presentation {
296916
297689
  presentationManager = _PresentationManager__WEBPACK_IMPORTED_MODULE_5__.PresentationManager.create(managerProps);
296917
297690
  }
296918
297691
  if (!selectionManager) {
296919
- selectionManager = new _selection_SelectionManager__WEBPACK_IMPORTED_MODULE_6__.SelectionManager(props?.selection ?? {
296920
- scopes: new _selection_SelectionScopesManager__WEBPACK_IMPORTED_MODULE_7__.SelectionScopesManager({
296921
- rpcRequestsHandler: presentationManager.rpcRequestsHandler,
296922
- localeProvider: () => this.presentation.activeLocale,
296923
- }),
297692
+ selectionManager = new _selection_SelectionManager__WEBPACK_IMPORTED_MODULE_6__.SelectionManager({
297693
+ ...props?.selection,
297694
+ scopes: props?.selection?.scopes ??
297695
+ new _selection_SelectionScopesManager__WEBPACK_IMPORTED_MODULE_7__.SelectionScopesManager({
297696
+ rpcRequestsHandler: presentationManager.rpcRequestsHandler,
297697
+ localeProvider: () => this.presentation.activeLocale,
297698
+ }),
296924
297699
  });
296925
297700
  }
296926
297701
  if (!favoritePropertiesManager) {
@@ -296956,6 +297731,9 @@ class Presentation {
296956
297731
  favoritePropertiesManager.dispose();
296957
297732
  }
296958
297733
  favoritePropertiesManager = undefined;
297734
+ if (selectionManager) {
297735
+ selectionManager.dispose();
297736
+ }
296959
297737
  selectionManager = undefined;
296960
297738
  localization = undefined;
296961
297739
  }
@@ -297357,10 +298135,12 @@ class PresentationManager {
297357
298135
  }
297358
298136
  async getContentIteratorInternal(requestOptions) {
297359
298137
  const options = await this.addRulesetAndVariablesToOptions(requestOptions);
298138
+ const firstPageSize = options.batchSize ?? requestOptions.paging?.size;
297360
298139
  const rpcOptions = this.toRpcTokenOptions({
297361
298140
  ...options,
297362
298141
  descriptor: getDescriptorOverrides(requestOptions.descriptor),
297363
298142
  keys: stripTransientElementKeys(requestOptions.keys).toJSON(),
298143
+ ...(firstPageSize ? { paging: { ...requestOptions.paging, size: firstPageSize } } : undefined),
297364
298144
  ...(!requestOptions.omitFormattedValues && this._schemaContextProvider !== undefined ? { omitFormattedValues: true } : undefined),
297365
298145
  });
297366
298146
  let contentFormatter;
@@ -297964,7 +298744,7 @@ class StreamedResponseGenerator {
297964
298744
  */
297965
298745
  async fetchFirstPage() {
297966
298746
  const start = this._props.paging?.start ?? 0;
297967
- const batchSize = this._props.paging?.size ?? 0;
298747
+ const batchSize = this._props.batchSize ?? this._props.paging?.size ?? 0;
297968
298748
  return this._props.getBatch({ start, size: batchSize }, 0);
297969
298749
  }
297970
298750
  getRemainingPages(firstPage) {
@@ -297989,11 +298769,11 @@ class StreamedResponseGenerator {
297989
298769
  let batchSize;
297990
298770
  if (pageSize) {
297991
298771
  itemsToFetch = Math.min(totalItemsToFetch, pageSize) - receivedItemsLength;
297992
- batchSize = Math.min(pageSize, receivedItemsLength);
298772
+ batchSize = Math.min(this._props.batchSize ?? Number.MAX_SAFE_INTEGER, pageSize, receivedItemsLength);
297993
298773
  }
297994
298774
  else {
297995
298775
  itemsToFetch = totalItemsToFetch - receivedItemsLength;
297996
- batchSize = receivedItemsLength;
298776
+ batchSize = Math.min(this._props.batchSize ?? Number.MAX_SAFE_INTEGER, receivedItemsLength);
297997
298777
  }
297998
298778
  const remainingBatches = Math.ceil(itemsToFetch / batchSize);
297999
298779
  // Return the first page and then stream the remaining ones.
@@ -299469,12 +300249,21 @@ __webpack_require__.r(__webpack_exports__);
299469
300249
  /* harmony export */ "TRANSIENT_ELEMENT_CLASSNAME": () => (/* binding */ TRANSIENT_ELEMENT_CLASSNAME),
299470
300250
  /* harmony export */ "ToolSelectionSyncHandler": () => (/* binding */ ToolSelectionSyncHandler)
299471
300251
  /* harmony export */ });
300252
+ /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Subject.js");
300253
+ /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js");
300254
+ /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/empty.js");
300255
+ /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/of.js");
300256
+ /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/defer.js");
300257
+ /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js");
300258
+ /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/tap.js");
299472
300259
  /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
299473
300260
  /* harmony import */ var _itwin_core_frontend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-frontend */ "../../core/frontend/lib/esm/core-frontend.js");
299474
300261
  /* harmony import */ var _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @itwin/presentation-common */ "../../presentation/common/lib/esm/presentation-common.js");
299475
- /* harmony import */ var _HiliteSetProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./HiliteSetProvider */ "../../presentation/frontend/lib/esm/presentation-frontend/selection/HiliteSetProvider.js");
299476
- /* harmony import */ var _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SelectionChangeEvent */ "../../presentation/frontend/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js");
299477
- /* harmony import */ var _SelectionScopesManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SelectionScopesManager */ "../../presentation/frontend/lib/esm/presentation-frontend/selection/SelectionScopesManager.js");
300262
+ /* harmony import */ var _itwin_unified_selection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @itwin/unified-selection */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection.js");
300263
+ /* harmony import */ var _Presentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Presentation */ "../../presentation/frontend/lib/esm/presentation-frontend/Presentation.js");
300264
+ /* harmony import */ var _HiliteSetProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./HiliteSetProvider */ "../../presentation/frontend/lib/esm/presentation-frontend/selection/HiliteSetProvider.js");
300265
+ /* harmony import */ var _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SelectionChangeEvent */ "../../presentation/frontend/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js");
300266
+ /* harmony import */ var _SelectionScopesManager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SelectionScopesManager */ "../../presentation/frontend/lib/esm/presentation-frontend/selection/SelectionScopesManager.js");
299478
300267
  /*---------------------------------------------------------------------------------------------
299479
300268
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
299480
300269
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -299488,6 +300277,9 @@ __webpack_require__.r(__webpack_exports__);
299488
300277
 
299489
300278
 
299490
300279
 
300280
+
300281
+
300282
+
299491
300283
  /**
299492
300284
  * The selection manager which stores the overall selection.
299493
300285
  * @public
@@ -299497,27 +300289,37 @@ class SelectionManager {
299497
300289
  * Creates an instance of SelectionManager.
299498
300290
  */
299499
300291
  constructor(props) {
299500
- this._selectionContainerMap = new Map();
299501
300292
  this._imodelToolSelectionSyncHandlers = new Map();
299502
300293
  this._hiliteSetProviders = new Map();
299503
- this.selectionChange = new _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_4__.SelectionChangeEvent();
300294
+ this._knownIModels = new Map();
300295
+ this._currentSelection = new CurrentSelectionStorage();
300296
+ this._selectionChanges = new rxjs__WEBPACK_IMPORTED_MODULE_8__.Subject();
300297
+ this._listeners = [];
300298
+ this.selectionChange = new _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeEvent();
299504
300299
  this.scopes = props.scopes;
299505
- _itwin_core_frontend__WEBPACK_IMPORTED_MODULE_1__.IModelConnection.onClose.addListener((imodel) => {
300300
+ this._selectionStorage = props.selectionStorage ?? (0,_itwin_unified_selection__WEBPACK_IMPORTED_MODULE_3__.createStorage)();
300301
+ this._ownsStorage = props.selectionStorage === undefined;
300302
+ this._selectionStorage.selectionChangeEvent.addListener((args) => this._selectionChanges.next(args));
300303
+ this._selectionEventsSubscription = this.streamSelectionEvents();
300304
+ this._listeners.push(_itwin_core_frontend__WEBPACK_IMPORTED_MODULE_1__.IModelConnection.onOpen.addListener((imodel) => {
300305
+ this._knownIModels.set(imodel.key, imodel);
300306
+ }));
300307
+ this._listeners.push(_itwin_core_frontend__WEBPACK_IMPORTED_MODULE_1__.IModelConnection.onClose.addListener((imodel) => {
299506
300308
  this.onConnectionClose(imodel);
299507
- });
300309
+ }));
300310
+ }
300311
+ dispose() {
300312
+ this._selectionEventsSubscription.unsubscribe();
300313
+ this._listeners.forEach((dispose) => dispose());
299508
300314
  }
299509
300315
  onConnectionClose(imodel) {
299510
- this.clearSelection("Connection Close Event", imodel);
299511
- this._selectionContainerMap.delete(imodel);
299512
300316
  this._hiliteSetProviders.delete(imodel);
299513
- }
299514
- getContainer(imodel) {
299515
- let selectionContainer = this._selectionContainerMap.get(imodel);
299516
- if (!selectionContainer) {
299517
- selectionContainer = new SelectionContainer();
299518
- this._selectionContainerMap.set(imodel, selectionContainer);
300317
+ this._knownIModels.delete(imodel.key);
300318
+ this._currentSelection.clear(imodel.key);
300319
+ if (this._ownsStorage) {
300320
+ this.clearSelection("Connection Close Event", imodel);
300321
+ this._selectionStorage.clearStorage({ iModelKey: imodel.key });
299519
300322
  }
299520
- return selectionContainer;
299521
300323
  }
299522
300324
  /** @internal */
299523
300325
  // istanbul ignore next
@@ -299565,39 +300367,48 @@ class SelectionManager {
299565
300367
  }
299566
300368
  /** Get the selection levels currently stored in this manager for the specified imodel */
299567
300369
  getSelectionLevels(imodel) {
299568
- return this.getContainer(imodel).getSelectionLevels();
300370
+ return this._selectionStorage.getSelectionLevels({ iModelKey: imodel.key });
299569
300371
  }
299570
- /** Get the selection currently stored in this manager */
300372
+ /**
300373
+ * Get the selection currently stored in this manager
300374
+ *
300375
+ * @note Calling immediately after `add*`|`replace*`|`remove*`|`clear*` method call does not guarantee
300376
+ * that returned `KeySet` will include latest changes. Listen for `selectionChange` event to get the
300377
+ * latest selection after changes.
300378
+ */
299571
300379
  getSelection(imodel, level = 0) {
299572
- return this.getContainer(imodel).getSelection(level);
300380
+ return this._currentSelection.getSelection(imodel.key, level);
299573
300381
  }
299574
300382
  handleEvent(evt) {
299575
- const container = this.getContainer(evt.imodel);
299576
- const selectedItemsSet = container.getSelection(evt.level);
299577
- const guidBefore = selectedItemsSet.guid;
299578
300383
  switch (evt.changeType) {
299579
- case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_4__.SelectionChangeType.Add:
299580
- selectedItemsSet.add(evt.keys);
300384
+ case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Add:
300385
+ this._selectionStorage.addToSelection({
300386
+ iModelKey: evt.imodel.key,
300387
+ source: evt.source,
300388
+ level: evt.level,
300389
+ selectables: keysToSelectable(evt.imodel, evt.keys),
300390
+ });
299581
300391
  break;
299582
- case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_4__.SelectionChangeType.Remove:
299583
- selectedItemsSet.delete(evt.keys);
300392
+ case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Remove:
300393
+ this._selectionStorage.removeFromSelection({
300394
+ iModelKey: evt.imodel.key,
300395
+ source: evt.source,
300396
+ level: evt.level,
300397
+ selectables: keysToSelectable(evt.imodel, evt.keys),
300398
+ });
299584
300399
  break;
299585
- case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_4__.SelectionChangeType.Replace:
299586
- if (selectedItemsSet.size !== evt.keys.size || !selectedItemsSet.hasAll(evt.keys)) {
299587
- // note: the above check is only needed to avoid changing
299588
- // guid of the keyset if we're replacing keyset with the same keys
299589
- selectedItemsSet.clear().add(evt.keys);
299590
- }
300400
+ case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Replace:
300401
+ this._selectionStorage.replaceSelection({
300402
+ iModelKey: evt.imodel.key,
300403
+ source: evt.source,
300404
+ level: evt.level,
300405
+ selectables: keysToSelectable(evt.imodel, evt.keys),
300406
+ });
299591
300407
  break;
299592
- case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_4__.SelectionChangeType.Clear:
299593
- selectedItemsSet.clear();
300408
+ case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Clear:
300409
+ this._selectionStorage.clearSelection({ iModelKey: evt.imodel.key, source: evt.source, level: evt.level });
299594
300410
  break;
299595
300411
  }
299596
- if (selectedItemsSet.guid === guidBefore) {
299597
- return;
299598
- }
299599
- container.clear(evt.level + 1);
299600
- this.selectionChange.raiseEvent(evt, this);
299601
300412
  }
299602
300413
  /**
299603
300414
  * Add keys to the selection
@@ -299612,7 +300423,7 @@ class SelectionManager {
299612
300423
  source,
299613
300424
  level,
299614
300425
  imodel,
299615
- changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_4__.SelectionChangeType.Add,
300426
+ changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Add,
299616
300427
  keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(keys),
299617
300428
  timestamp: new Date(),
299618
300429
  rulesetId,
@@ -299632,7 +300443,7 @@ class SelectionManager {
299632
300443
  source,
299633
300444
  level,
299634
300445
  imodel,
299635
- changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_4__.SelectionChangeType.Remove,
300446
+ changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Remove,
299636
300447
  keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(keys),
299637
300448
  timestamp: new Date(),
299638
300449
  rulesetId,
@@ -299652,7 +300463,7 @@ class SelectionManager {
299652
300463
  source,
299653
300464
  level,
299654
300465
  imodel,
299655
- changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_4__.SelectionChangeType.Replace,
300466
+ changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Replace,
299656
300467
  keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(keys),
299657
300468
  timestamp: new Date(),
299658
300469
  rulesetId,
@@ -299671,7 +300482,7 @@ class SelectionManager {
299671
300482
  source,
299672
300483
  level,
299673
300484
  imodel,
299674
- changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_4__.SelectionChangeType.Clear,
300485
+ changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Clear,
299675
300486
  keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(),
299676
300487
  timestamp: new Date(),
299677
300488
  rulesetId,
@@ -299734,42 +300545,35 @@ class SelectionManager {
299734
300545
  getHiliteSetProvider(imodel) {
299735
300546
  let provider = this._hiliteSetProviders.get(imodel);
299736
300547
  if (!provider) {
299737
- provider = _HiliteSetProvider__WEBPACK_IMPORTED_MODULE_3__.HiliteSetProvider.create({ imodel });
300548
+ provider = _HiliteSetProvider__WEBPACK_IMPORTED_MODULE_5__.HiliteSetProvider.create({ imodel });
299738
300549
  this._hiliteSetProviders.set(imodel, provider);
299739
300550
  }
299740
300551
  return provider;
299741
300552
  }
299742
- }
299743
- /** @internal */
299744
- class SelectionContainer {
299745
- constructor() {
299746
- this._selectedItemsSetMap = new Map();
299747
- }
299748
- getSelection(level) {
299749
- let selectedItemsSet = this._selectedItemsSetMap.get(level);
299750
- if (!selectedItemsSet) {
299751
- selectedItemsSet = new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet();
299752
- this._selectedItemsSetMap.set(level, selectedItemsSet);
299753
- }
299754
- return selectedItemsSet;
299755
- }
299756
- getSelectionLevels() {
299757
- const levels = new Array();
299758
- for (const entry of this._selectedItemsSetMap.entries()) {
299759
- if (!entry[1].isEmpty) {
299760
- levels.push(entry[0]);
299761
- }
299762
- }
299763
- return levels.sort();
299764
- }
299765
- clear(level) {
299766
- const keys = this._selectedItemsSetMap.keys();
299767
- for (const key of keys) {
299768
- if (key >= level) {
299769
- const selectedItemsSet = this._selectedItemsSetMap.get(key);
299770
- selectedItemsSet.clear();
299771
- }
299772
- }
300553
+ streamSelectionEvents() {
300554
+ return this._selectionChanges
300555
+ .pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_9__.mergeMap)((args) => {
300556
+ const currentSelectables = this._selectionStorage.getSelection({ iModelKey: args.iModelKey, level: args.level });
300557
+ return this._currentSelection.computeSelection(args.iModelKey, args.level, currentSelectables, args.selectables).pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_9__.mergeMap)(({ level, changedSelection }) => {
300558
+ const imodel = this._knownIModels.get(args.iModelKey);
300559
+ if (!imodel) {
300560
+ return rxjs__WEBPACK_IMPORTED_MODULE_10__.EMPTY;
300561
+ }
300562
+ return (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.of)({
300563
+ imodel,
300564
+ keys: changedSelection,
300565
+ level,
300566
+ source: args.source,
300567
+ timestamp: args.timestamp,
300568
+ changeType: getChangeType(args.changeType),
300569
+ });
300570
+ }));
300571
+ }))
300572
+ .subscribe({
300573
+ next: (args) => {
300574
+ this.selectionChange.raiseEvent(args, this);
300575
+ },
300576
+ });
299773
300577
  }
299774
300578
  }
299775
300579
  /** @internal */
@@ -299809,7 +300613,7 @@ class ToolSelectionSyncHandler {
299809
300613
  // makes sure we're adding to selection keys with concrete classes and not "BisCore:Element", which
299810
300614
  // we can't because otherwise our keys compare fails (presentation components load data with
299811
300615
  // concrete classes)
299812
- const changer = new ScopedSelectionChanger(this._selectionSourceName, this._imodel, this._logicalSelection, (0,_SelectionScopesManager__WEBPACK_IMPORTED_MODULE_5__.createSelectionScopeProps)(this._logicalSelection.scopes.activeScope));
300616
+ const changer = new ScopedSelectionChanger(this._selectionSourceName, this._imodel, this._logicalSelection, (0,_SelectionScopesManager__WEBPACK_IMPORTED_MODULE_7__.createSelectionScopeProps)(this._logicalSelection.scopes.activeScope));
299813
300617
  // we know what to do immediately on `clear` events
299814
300618
  if (_itwin_core_frontend__WEBPACK_IMPORTED_MODULE_1__.SelectionSetEventType.Clear === ev.type) {
299815
300619
  await changer.clear(selectionLevel);
@@ -299909,6 +300713,196 @@ class ScopedSelectionChanger {
299909
300713
  this.manager.replaceSelection(this.name, this.imodel, keys, level);
299910
300714
  }
299911
300715
  }
300716
+ /** Stores current selection in `KeySet` format per iModel. */
300717
+ class CurrentSelectionStorage {
300718
+ constructor() {
300719
+ this._currentSelection = new Map();
300720
+ }
300721
+ getCurrentSelectionStorage(imodelKey) {
300722
+ let storage = this._currentSelection.get(imodelKey);
300723
+ if (!storage) {
300724
+ storage = new IModelSelectionStorage();
300725
+ this._currentSelection.set(imodelKey, storage);
300726
+ }
300727
+ return storage;
300728
+ }
300729
+ getSelection(imodelKey, level) {
300730
+ return this.getCurrentSelectionStorage(imodelKey).getSelection(level);
300731
+ }
300732
+ clear(imodelKey) {
300733
+ this._currentSelection.delete(imodelKey);
300734
+ }
300735
+ computeSelection(imodelKey, level, currSelectables, changedSelectables) {
300736
+ return this.getCurrentSelectionStorage(imodelKey).computeSelection(level, currSelectables, changedSelectables);
300737
+ }
300738
+ }
300739
+ /**
300740
+ * Computes and stores current selection in `KeySet` format.
300741
+ * It always stores result of latest resolved call to `computeSelection`.
300742
+ */
300743
+ class IModelSelectionStorage {
300744
+ constructor() {
300745
+ this._currentSelection = new Map();
300746
+ }
300747
+ getSelection(level) {
300748
+ let entry = this._currentSelection.get(level);
300749
+ if (!entry) {
300750
+ entry = { value: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(), ongoingComputationDisposers: new Set() };
300751
+ this._currentSelection.set(level, entry);
300752
+ }
300753
+ return entry.value;
300754
+ }
300755
+ clearSelections(level) {
300756
+ const clearedLevels = [];
300757
+ for (const [storedLevel] of this._currentSelection.entries()) {
300758
+ if (storedLevel > level) {
300759
+ clearedLevels.push(storedLevel);
300760
+ }
300761
+ }
300762
+ clearedLevels.forEach((storedLevel) => {
300763
+ const entry = this._currentSelection.get(storedLevel);
300764
+ // istanbul ignore if
300765
+ if (!entry) {
300766
+ return;
300767
+ }
300768
+ for (const disposer of entry.ongoingComputationDisposers) {
300769
+ disposer.next();
300770
+ }
300771
+ this._currentSelection.delete(storedLevel);
300772
+ });
300773
+ }
300774
+ addDisposer(level, disposer) {
300775
+ const entry = this._currentSelection.get(level);
300776
+ if (!entry) {
300777
+ this._currentSelection.set(level, { value: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(), ongoingComputationDisposers: new Set([disposer]) });
300778
+ return;
300779
+ }
300780
+ entry.ongoingComputationDisposers.add(disposer);
300781
+ }
300782
+ setSelection(level, keys, disposer) {
300783
+ const currEntry = this._currentSelection.get(level);
300784
+ // istanbul ignore else
300785
+ if (currEntry) {
300786
+ currEntry.ongoingComputationDisposers.delete(disposer);
300787
+ }
300788
+ this._currentSelection.set(level, {
300789
+ value: keys,
300790
+ ongoingComputationDisposers: currEntry?.ongoingComputationDisposers ?? /* istanbul ignore next */ new Set(),
300791
+ });
300792
+ }
300793
+ computeSelection(level, currSelectables, changedSelectables) {
300794
+ this.clearSelections(level);
300795
+ const prevComputationsDisposers = [...(this._currentSelection.get(level)?.ongoingComputationDisposers ?? [])];
300796
+ const currDisposer = new rxjs__WEBPACK_IMPORTED_MODULE_8__.Subject();
300797
+ this.addDisposer(level, currDisposer);
300798
+ return (0,rxjs__WEBPACK_IMPORTED_MODULE_12__.defer)(async () => {
300799
+ const convertedSelectables = [];
300800
+ const [current, changed] = await Promise.all([
300801
+ selectablesToKeys(currSelectables, convertedSelectables),
300802
+ selectablesToKeys(changedSelectables, convertedSelectables),
300803
+ ]);
300804
+ const currentSelection = new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet([...current.keys, ...current.selectableKeys.flatMap((selectable) => selectable.keys)]);
300805
+ const changedSelection = new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet([...changed.keys, ...changed.selectableKeys.flatMap((selectable) => selectable.keys)]);
300806
+ return {
300807
+ level,
300808
+ currentSelection,
300809
+ changedSelection,
300810
+ };
300811
+ }).pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_13__.takeUntil)(currDisposer), (0,rxjs__WEBPACK_IMPORTED_MODULE_14__.tap)({
300812
+ next: (val) => {
300813
+ prevComputationsDisposers.forEach((disposer) => disposer.next());
300814
+ this.setSelection(val.level, val.currentSelection, currDisposer);
300815
+ },
300816
+ }));
300817
+ }
300818
+ }
300819
+ function keysToSelectable(imodel, keys) {
300820
+ const selectables = [];
300821
+ keys.forEach((key) => {
300822
+ if ("id" in key) {
300823
+ selectables.push(key);
300824
+ return;
300825
+ }
300826
+ const customSelectable = {
300827
+ identifier: key.pathFromRoot.join("/"),
300828
+ data: key,
300829
+ loadInstanceKeys: () => createInstanceKeysIterator(imodel, key),
300830
+ };
300831
+ selectables.push(customSelectable);
300832
+ });
300833
+ return selectables;
300834
+ }
300835
+ async function selectablesToKeys(selectables, convertedList) {
300836
+ const keys = [];
300837
+ const selectableKeys = [];
300838
+ for (const [className, ids] of selectables.instanceKeys) {
300839
+ for (const id of ids) {
300840
+ keys.push({ id, className });
300841
+ }
300842
+ }
300843
+ for (const [_, selectable] of selectables.custom) {
300844
+ if (isNodeKey(selectable.data)) {
300845
+ selectableKeys.push({ identifier: selectable.identifier, keys: [selectable.data] });
300846
+ continue;
300847
+ }
300848
+ const converted = convertedList.find((con) => con.identifier === selectable.identifier);
300849
+ if (converted) {
300850
+ selectableKeys.push(converted);
300851
+ continue;
300852
+ }
300853
+ const newConverted = { identifier: selectable.identifier, keys: [] };
300854
+ convertedList.push(newConverted);
300855
+ for await (const instanceKey of selectable.loadInstanceKeys()) {
300856
+ newConverted.keys.push(instanceKey);
300857
+ }
300858
+ selectableKeys.push(newConverted);
300859
+ }
300860
+ return { keys, selectableKeys };
300861
+ }
300862
+ async function* createInstanceKeysIterator(imodel, nodeKey) {
300863
+ if (_itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.NodeKey.isInstancesNodeKey(nodeKey)) {
300864
+ for (const key of nodeKey.instanceKeys) {
300865
+ yield key;
300866
+ }
300867
+ return;
300868
+ }
300869
+ const content = await _Presentation__WEBPACK_IMPORTED_MODULE_4__.Presentation.presentation.getContentInstanceKeys({
300870
+ imodel,
300871
+ keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet([nodeKey]),
300872
+ rulesetOrId: {
300873
+ id: "grouped-instances",
300874
+ rules: [
300875
+ {
300876
+ ruleType: "Content",
300877
+ specifications: [
300878
+ {
300879
+ specType: "SelectedNodeInstances",
300880
+ },
300881
+ ],
300882
+ },
300883
+ ],
300884
+ },
300885
+ });
300886
+ for await (const key of content.items()) {
300887
+ yield key;
300888
+ }
300889
+ }
300890
+ function isNodeKey(data) {
300891
+ const key = data;
300892
+ return key.pathFromRoot !== undefined && key.type !== undefined;
300893
+ }
300894
+ function getChangeType(type) {
300895
+ switch (type) {
300896
+ case "add":
300897
+ return _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Add;
300898
+ case "remove":
300899
+ return _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Remove;
300900
+ case "replace":
300901
+ return _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Replace;
300902
+ case "clear":
300903
+ return _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Clear;
300904
+ }
300905
+ }
299912
300906
 
299913
300907
 
299914
300908
  /***/ }),
@@ -309621,7 +310615,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
309621
310615
  /***/ ((module) => {
309622
310616
 
309623
310617
  "use strict";
309624
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.6.0-dev.1","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.6.0-dev.1","@itwin/core-bentley":"workspace:^4.6.0-dev.1","@itwin/core-common":"workspace:^4.6.0-dev.1","@itwin/core-geometry":"workspace:^4.6.0-dev.1","@itwin/core-orbitgt":"workspace:^4.6.0-dev.1","@itwin/core-quantity":"workspace:^4.6.0-dev.1"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.0.2","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
310618
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.6.0-dev.13","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.6.0-dev.13","@itwin/core-bentley":"workspace:^4.6.0-dev.13","@itwin/core-common":"workspace:^4.6.0-dev.13","@itwin/core-geometry":"workspace:^4.6.0-dev.13","@itwin/core-orbitgt":"workspace:^4.6.0-dev.13","@itwin/core-quantity":"workspace:^4.6.0-dev.13"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.0.2","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","meshoptimizer":"~0.20.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
309625
310619
 
309626
310620
  /***/ }),
309627
310621