// Production steps of ECMA-262, Edition 6, 22.1.2.1
if (!Array.from) {
    Array.from = (function () {
        var symbolIterator;
        try {
            symbolIterator = Symbol.iterator
                ? Symbol.iterator
                : 'Symbol(Symbol.iterator)';
        } catch (e) {
            symbolIterator = 'Symbol(Symbol.iterator)';
        }

        var toStr = Object.prototype.toString;
        var isCallable = function (fn) {
            return (
                typeof fn === 'function' ||
                toStr.call(fn) === '[object Function]'
            );
        };
        var toInteger = function (value) {
            var number = Number(value);
            if (isNaN(number)) return 0;
            if (number === 0 || !isFinite(number)) return number;
            return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
        };
        var maxSafeInteger = Math.pow(2, 53) - 1;
        var toLength = function (value) {
            var len = toInteger(value);
            return Math.min(Math.max(len, 0), maxSafeInteger);
        };

        var setGetItemHandler = function setGetItemHandler(isIterator, items) {
            var iterator = isIterator && items[symbolIterator]();
            return function getItem(k) {
                return isIterator ? iterator.next() : items[k];
            };
        };

        var getArray = function getArray(
            T,
            A,
            len,
            getItem,
            isIterator,
            mapFn
        ) {
            // 16. Let k be 0.
            var k = 0;

            // 17. Repeat, while k < len… or while iterator is done (also steps a - h)
            while (k < len || isIterator) {
                var item = getItem(k);
                var kValue = isIterator ? item.value : item;

                if (isIterator && item.done) {
                    return A;
                } else {
                    if (mapFn) {
                        A[k] =
                            typeof T === 'undefined'
                                ? mapFn(kValue, k)
                                : mapFn.call(T, kValue, k);
                    } else {
                        A[k] = kValue;
                    }
                }
                k += 1;
            }

            if (isIterator) {
                throw new TypeError(
                    'Array.from: provided arrayLike or iterator has length more then 2 ** 52 - 1'
                );
            } else {
                A.length = len;
            }

            return A;
        };

        // The length property of the from method is 1.
        return function from(arrayLikeOrIterator /*, mapFn, thisArg */) {
            // 1. Let C be the this value.
            var C = this;

            // 2. Let items be ToObject(arrayLikeOrIterator).
            var items = Object(arrayLikeOrIterator);
            var isIterator = isCallable(items[symbolIterator]);

            // 3. ReturnIfAbrupt(items).
            if (arrayLikeOrIterator == null && !isIterator) {
                throw new TypeError(
                    'Array.from requires an array-like object or iterator - not null or undefined'
                );
            }

            // 4. If mapfn is undefined, then let mapping be false.
            var mapFn = arguments.length > 1 ? arguments[1] : void undefined;
            var T;
            if (typeof mapFn !== 'undefined') {
                // 5. else
                // 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
                if (!isCallable(mapFn)) {
                    throw new TypeError(
                        'Array.from: when provided, the second argument must be a function'
                    );
                }

                // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.
                if (arguments.length > 2) {
                    T = arguments[2];
                }
            }

            // 10. Let lenValue be Get(items, "length").
            // 11. Let len be ToLength(lenValue).
            var len = toLength(items.length);

            // 13. If IsConstructor(C) is true, then
            // 13. a. Let A be the result of calling the [[Construct]] internal method
            // of C with an argument list containing the single item len.
            // 14. a. Else, Let A be ArrayCreate(len).
            var A = isCallable(C) ? Object(new C(len)) : new Array(len);

            return getArray(
                T,
                A,
                len,
                setGetItemHandler(isIterator, items),
                isIterator,
                mapFn
            );
        };
    })();
}

if (!Element.prototype.matches) {
    Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
}

if (!Element.prototype.closest) {
    Element.prototype.closest = function (s) {
        var el = this;

        do {
            if (el.matches(s)) return el;
            el = el.parentElement || el.parentNode;
        } while (el !== null && el.nodeType === 1);
        return null;
    };
}

// REQUIRED FOR:
// draco_decoder.js (loaded async from DRACOLoader.js)
if (!Math.clz32) Math.clz32 = (function(log, LN2){
    return function(x) {
      // Let n be ToUint32(x).
      // Let p be the number of leading zero bits in
      // the 32-bit binary representation of n.
      // Return p.
      var asUint = x >>> 0;
      if (asUint === 0) {
        return 32;
      }
      return 31 - (log(asUint) / LN2 | 0) |0; // the "| 0" acts like math.floor
    };
})(Math.log, Math.LN2);

// REQUIRED FOR:
// draco_decoder.js (loaded async from DRACOLoader.js)
Math.fround = Math.fround || (function (array) {
    return function(x) {
      return array[0] = x, array[0];
    };
})(new Float32Array(1));

// REQUIRED FOR:
// draco_decoder.js (loaded async from DRACOLoader.js)
if (!Math.imul) Math.imul = function(opA, opB) {
    opB |= 0; // ensure that opB is an integer. opA will automatically be coerced.
    // floating points give us 53 bits of precision to work with plus 1 sign bit
    // automatically handled for our convienence:
    // 1. 0x003fffff /*opA & 0x000fffff*/ * 0x7fffffff /*opB*/ = 0x1fffff7fc00001
    //    0x1fffff7fc00001 < Number.MAX_SAFE_INTEGER /*0x1fffffffffffff*/
    var result = (opA & 0x003fffff) * opB;
    // 2. We can remove an integer coersion from the statement above because:
    //    0x1fffff7fc00001 + 0xffc00000 = 0x1fffffff800001
    //    0x1fffffff800001 < Number.MAX_SAFE_INTEGER /*0x1fffffffffffff*/
    if (opA & 0xffc00000 /*!== 0*/) result += (opA & 0xffc00000) * opB |0;
    return result |0;
};

window.MutationObserver = window.MutationObserver || window.WebKitMutationObserver;

if (!Object.entries) {
    Object.entries = function( obj ){
        var ownProps = Object.keys( obj ),
            i = ownProps.length,
            resArray = new Array(i); // preallocate the Array
        while (i--)
            resArray[i] = [ownProps[i], obj[ownProps[i]]];

        return resArray;
    };
}

if (!Object.fromEntries) {
    Object.fromEntries = function(iterable){
        var result = {};
        var array = Array.from(iterable);
        array.forEach(function(value){
            result[value[0]] = value[1];
        });
        return result;
    }
}

// https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
// https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame

(function() {
    window.requestAnimationFrame =
        window.requestAnimationFrame ||
        window.msRequestAnimationFrame ||
        window.mozRequestAnimationFrame ||
        window.webkitRequestAnimationFrame ||
        window.oRequestAnimationFrame;
    window.cancelAnimationFrame =
        window.cancelAnimationFrame ||
        window.msCancelAnimationFrame ||
        window.mozCancelAnimationFrame ||
        window.webkitCancelAnimationFrame ||
        window.oCancelAnimationFrame;

    if (!window.requestAnimationFrame) {
        var lastTime = 0;

        window.requestAnimationFrame = function(callback, element) {
            var currTime = new Date().getTime();
            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
            var id = window.setTimeout(
                function() {
                    callback(currTime + timeToCall);
                },
                timeToCall
            );
            lastTime = currTime + timeToCall;
            return id;
        };
    }

    if (!window.cancelAnimationFrame) {
        window.cancelAnimationFrame = function(id) {
            clearTimeout(id);
        };
    }
}());

(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
  (factory((global.WHATWGFetch = {})));
}(this, (function (exports) { 'use strict';

  /* eslint-disable no-prototype-builtins */
  var g =
    (typeof globalThis !== 'undefined' && globalThis) ||
    (typeof self !== 'undefined' && self) ||
    // eslint-disable-next-line no-undef
    (typeof global !== 'undefined' && global) ||
    {};

  var support = {
    searchParams: 'URLSearchParams' in g,
    iterable: 'Symbol' in g && 'iterator' in Symbol,
    blob:
      'FileReader' in g &&
      'Blob' in g &&
      (function() {
        try {
          new Blob();
          return true
        } catch (e) {
          return false
        }
      })(),
    formData: 'FormData' in g,
    arrayBuffer: 'ArrayBuffer' in g
  };

  function isDataView(obj) {
    return obj && DataView.prototype.isPrototypeOf(obj)
  }

  if (support.arrayBuffer) {
    var viewClasses = [
      '[object Int8Array]',
      '[object Uint8Array]',
      '[object Uint8ClampedArray]',
      '[object Int16Array]',
      '[object Uint16Array]',
      '[object Int32Array]',
      '[object Uint32Array]',
      '[object Float32Array]',
      '[object Float64Array]'
    ];

    var isArrayBufferView =
      ArrayBuffer.isView ||
      function(obj) {
        return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
      };
  }

  function normalizeName(name) {
    if (typeof name !== 'string') {
      name = String(name);
    }
    if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {
      throw new TypeError('Invalid character in header field name: "' + name + '"')
    }
    return name.toLowerCase()
  }

  function normalizeValue(value) {
    if (typeof value !== 'string') {
      value = String(value);
    }
    return value
  }

  // Build a destructive iterator for the value list
  function iteratorFor(items) {
    var iterator = {
      next: function() {
        var value = items.shift();
        return {done: value === undefined, value: value}
      }
    };

    if (support.iterable) {
      iterator[Symbol.iterator] = function() {
        return iterator
      };
    }

    return iterator
  }

  function Headers(headers) {
    this.map = {};

    if (headers instanceof Headers) {
      headers.forEach(function(value, name) {
        this.append(name, value);
      }, this);
    } else if (Array.isArray(headers)) {
      headers.forEach(function(header) {
        if (header.length != 2) {
          throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length)
        }
        this.append(header[0], header[1]);
      }, this);
    } else if (headers) {
      Object.getOwnPropertyNames(headers).forEach(function(name) {
        this.append(name, headers[name]);
      }, this);
    }
  }

  Headers.prototype.append = function(name, value) {
    name = normalizeName(name);
    value = normalizeValue(value);
    var oldValue = this.map[name];
    this.map[name] = oldValue ? oldValue + ', ' + value : value;
  };

  Headers.prototype['delete'] = function(name) {
    delete this.map[normalizeName(name)];
  };

  Headers.prototype.get = function(name) {
    name = normalizeName(name);
    return this.has(name) ? this.map[name] : null
  };

  Headers.prototype.has = function(name) {
    return this.map.hasOwnProperty(normalizeName(name))
  };

  Headers.prototype.set = function(name, value) {
    this.map[normalizeName(name)] = normalizeValue(value);
  };

  Headers.prototype.forEach = function(callback, thisArg) {
    for (var name in this.map) {
      if (this.map.hasOwnProperty(name)) {
        callback.call(thisArg, this.map[name], name, this);
      }
    }
  };

  Headers.prototype.keys = function() {
    var items = [];
    this.forEach(function(value, name) {
      items.push(name);
    });
    return iteratorFor(items)
  };

  Headers.prototype.values = function() {
    var items = [];
    this.forEach(function(value) {
      items.push(value);
    });
    return iteratorFor(items)
  };

  Headers.prototype.entries = function() {
    var items = [];
    this.forEach(function(value, name) {
      items.push([name, value]);
    });
    return iteratorFor(items)
  };

  if (support.iterable) {
    Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
  }

  function consumed(body) {
    if (body._noBody) return
    if (body.bodyUsed) {
      return Promise.reject(new TypeError('Already read'))
    }
    body.bodyUsed = true;
  }

  function fileReaderReady(reader) {
    return new Promise(function(resolve, reject) {
      reader.onload = function() {
        resolve(reader.result);
      };
      reader.onerror = function() {
        reject(reader.error);
      };
    })
  }

  function readBlobAsArrayBuffer(blob) {
    var reader = new FileReader();
    var promise = fileReaderReady(reader);
    reader.readAsArrayBuffer(blob);
    return promise
  }

  function readBlobAsText(blob) {
    var reader = new FileReader();
    var promise = fileReaderReady(reader);
    var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
    var encoding = match ? match[1] : 'utf-8';
    reader.readAsText(blob, encoding);
    return promise
  }

  function readArrayBufferAsText(buf) {
    var view = new Uint8Array(buf);
    var chars = new Array(view.length);

    for (var i = 0; i < view.length; i++) {
      chars[i] = String.fromCharCode(view[i]);
    }
    return chars.join('')
  }

  function bufferClone(buf) {
    if (buf.slice) {
      return buf.slice(0)
    } else {
      var view = new Uint8Array(buf.byteLength);
      view.set(new Uint8Array(buf));
      return view.buffer
    }
  }

  function Body() {
    this.bodyUsed = false;

    this._initBody = function(body) {
      /*
        fetch-mock wraps the Response object in an ES6 Proxy to
        provide useful test harness features such as flush. However, on
        ES5 browsers without fetch or Proxy support pollyfills must be used;
        the proxy-pollyfill is unable to proxy an attribute unless it exists
        on the object before the Proxy is created. This change ensures
        Response.bodyUsed exists on the instance, while maintaining the
        semantic of setting Request.bodyUsed in the constructor before
        _initBody is called.
      */
      // eslint-disable-next-line no-self-assign
      this.bodyUsed = this.bodyUsed;
      this._bodyInit = body;
      if (!body) {
        this._noBody = true;
        this._bodyText = '';
      } else if (typeof body === 'string') {
        this._bodyText = body;
      } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
        this._bodyBlob = body;
      } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
        this._bodyFormData = body;
      } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
        this._bodyText = body.toString();
      } else if (support.arrayBuffer && support.blob && isDataView(body)) {
        this._bodyArrayBuffer = bufferClone(body.buffer);
        // IE 10-11 can't handle a DataView body.
        this._bodyInit = new Blob([this._bodyArrayBuffer]);
      } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
        this._bodyArrayBuffer = bufferClone(body);
      } else {
        this._bodyText = body = Object.prototype.toString.call(body);
      }

      if (!this.headers.get('content-type')) {
        if (typeof body === 'string') {
          this.headers.set('content-type', 'text/plain;charset=UTF-8');
        } else if (this._bodyBlob && this._bodyBlob.type) {
          this.headers.set('content-type', this._bodyBlob.type);
        } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
          this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
        }
      }
    };

    if (support.blob) {
      this.blob = function() {
        var rejected = consumed(this);
        if (rejected) {
          return rejected
        }

        if (this._bodyBlob) {
          return Promise.resolve(this._bodyBlob)
        } else if (this._bodyArrayBuffer) {
          return Promise.resolve(new Blob([this._bodyArrayBuffer]))
        } else if (this._bodyFormData) {
          throw new Error('could not read FormData body as blob')
        } else {
          return Promise.resolve(new Blob([this._bodyText]))
        }
      };
    }

    this.arrayBuffer = function() {
      if (this._bodyArrayBuffer) {
        var isConsumed = consumed(this);
        if (isConsumed) {
          return isConsumed
        } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
          return Promise.resolve(
            this._bodyArrayBuffer.buffer.slice(
              this._bodyArrayBuffer.byteOffset,
              this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
            )
          )
        } else {
          return Promise.resolve(this._bodyArrayBuffer)
        }
      } else if (support.blob) {
        return this.blob().then(readBlobAsArrayBuffer)
      } else {
        throw new Error('could not read as ArrayBuffer')
      }
    };

    this.text = function() {
      var rejected = consumed(this);
      if (rejected) {
        return rejected
      }

      if (this._bodyBlob) {
        return readBlobAsText(this._bodyBlob)
      } else if (this._bodyArrayBuffer) {
        return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
      } else if (this._bodyFormData) {
        throw new Error('could not read FormData body as text')
      } else {
        return Promise.resolve(this._bodyText)
      }
    };

    if (support.formData) {
      this.formData = function() {
        return this.text().then(decode)
      };
    }

    this.json = function() {
      return this.text().then(JSON.parse)
    };

    return this
  }

  // HTTP methods whose capitalization should be normalized
  var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'];

  function normalizeMethod(method) {
    var upcased = method.toUpperCase();
    return methods.indexOf(upcased) > -1 ? upcased : method
  }

  function Request(input, options) {
    if (!(this instanceof Request)) {
      throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
    }

    options = options || {};
    var body = options.body;

    if (input instanceof Request) {
      if (input.bodyUsed) {
        throw new TypeError('Already read')
      }
      this.url = input.url;
      this.credentials = input.credentials;
      if (!options.headers) {
        this.headers = new Headers(input.headers);
      }
      this.method = input.method;
      this.mode = input.mode;
      this.signal = input.signal;
      if (!body && input._bodyInit != null) {
        body = input._bodyInit;
        input.bodyUsed = true;
      }
    } else {
      this.url = String(input);
    }

    this.credentials = options.credentials || this.credentials || 'same-origin';
    if (options.headers || !this.headers) {
      this.headers = new Headers(options.headers);
    }
    this.method = normalizeMethod(options.method || this.method || 'GET');
    this.mode = options.mode || this.mode || null;
    this.signal = options.signal || this.signal || (function () {
      if ('AbortController' in g) {
        var ctrl = new AbortController();
        return ctrl.signal;
      }
    }());
    this.referrer = null;

    if ((this.method === 'GET' || this.method === 'HEAD') && body) {
      throw new TypeError('Body not allowed for GET or HEAD requests')
    }
    this._initBody(body);

    if (this.method === 'GET' || this.method === 'HEAD') {
      if (options.cache === 'no-store' || options.cache === 'no-cache') {
        // Search for a '_' parameter in the query string
        var reParamSearch = /([?&])_=[^&]*/;
        if (reParamSearch.test(this.url)) {
          // If it already exists then set the value with the current time
          this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());
        } else {
          // Otherwise add a new '_' parameter to the end with the current time
          var reQueryString = /\?/;
          this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();
        }
      }
    }
  }

  Request.prototype.clone = function() {
    return new Request(this, {body: this._bodyInit})
  };

  function decode(body) {
    var form = new FormData();
    body
      .trim()
      .split('&')
      .forEach(function(bytes) {
        if (bytes) {
          var split = bytes.split('=');
          var name = split.shift().replace(/\+/g, ' ');
          var value = split.join('=').replace(/\+/g, ' ');
          form.append(decodeURIComponent(name), decodeURIComponent(value));
        }
      });
    return form
  }

  function parseHeaders(rawHeaders) {
    var headers = new Headers();
    // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
    // https://tools.ietf.org/html/rfc7230#section-3.2
    var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
    // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill
    // https://github.com/github/fetch/issues/748
    // https://github.com/zloirock/core-js/issues/751
    preProcessedHeaders
      .split('\r')
      .map(function(header) {
        return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header
      })
      .forEach(function(line) {
        var parts = line.split(':');
        var key = parts.shift().trim();
        if (key) {
          var value = parts.join(':').trim();
          try {
            headers.append(key, value);
          } catch (error) {
            console.warn('Response ' + error.message);
          }
        }
      });
    return headers
  }

  Body.call(Request.prototype);

  function Response(bodyInit, options) {
    if (!(this instanceof Response)) {
      throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
    }
    if (!options) {
      options = {};
    }

    this.type = 'default';
    this.status = options.status === undefined ? 200 : options.status;
    if (this.status < 200 || this.status > 599) {
      throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].")
    }
    this.ok = this.status >= 200 && this.status < 300;
    this.statusText = options.statusText === undefined ? '' : '' + options.statusText;
    this.headers = new Headers(options.headers);
    this.url = options.url || '';
    this._initBody(bodyInit);
  }

  Body.call(Response.prototype);

  Response.prototype.clone = function() {
    return new Response(this._bodyInit, {
      status: this.status,
      statusText: this.statusText,
      headers: new Headers(this.headers),
      url: this.url
    })
  };

  Response.error = function() {
    var response = new Response(null, {status: 200, statusText: ''});
    response.ok = false;
    response.status = 0;
    response.type = 'error';
    return response
  };

  var redirectStatuses = [301, 302, 303, 307, 308];

  Response.redirect = function(url, status) {
    if (redirectStatuses.indexOf(status) === -1) {
      throw new RangeError('Invalid status code')
    }

    return new Response(null, {status: status, headers: {location: url}})
  };

  exports.DOMException = g.DOMException;
  try {
    new exports.DOMException();
  } catch (err) {
    exports.DOMException = function(message, name) {
      this.message = message;
      this.name = name;
      var error = Error(message);
      this.stack = error.stack;
    };
    exports.DOMException.prototype = Object.create(Error.prototype);
    exports.DOMException.prototype.constructor = exports.DOMException;
  }

  function fetch(input, init) {
    return new Promise(function(resolve, reject) {
      var request = new Request(input, init);

      if (request.signal && request.signal.aborted) {
        return reject(new exports.DOMException('Aborted', 'AbortError'))
      }

      var xhr = new XMLHttpRequest();

      function abortXhr() {
        xhr.abort();
      }

      xhr.onload = function() {
        var options = {
          statusText: xhr.statusText,
          headers: parseHeaders(xhr.getAllResponseHeaders() || '')
        };
        // This check if specifically for when a user fetches a file locally from the file system
        // Only if the status is out of a normal range
        if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) {
          options.status = 200;
        } else {
          options.status = xhr.status;
        }
        options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
        var body = 'response' in xhr ? xhr.response : xhr.responseText;
        setTimeout(function() {
          resolve(new Response(body, options));
        }, 0);
      };

      xhr.onerror = function() {
        setTimeout(function() {
          reject(new TypeError('Network request failed'));
        }, 0);
      };

      xhr.ontimeout = function() {
        setTimeout(function() {
          reject(new TypeError('Network request timed out'));
        }, 0);
      };

      xhr.onabort = function() {
        setTimeout(function() {
          reject(new exports.DOMException('Aborted', 'AbortError'));
        }, 0);
      };

      function fixUrl(url) {
        try {
          return url === '' && g.location.href ? g.location.href : url
        } catch (e) {
          return url
        }
      }

      xhr.open(request.method, fixUrl(request.url), true);

      if (request.credentials === 'include') {
        xhr.withCredentials = true;
      } else if (request.credentials === 'omit') {
        xhr.withCredentials = false;
      }

      if ('responseType' in xhr) {
        if (support.blob) {
          xhr.responseType = 'blob';
        } else if (
          support.arrayBuffer
        ) {
          xhr.responseType = 'arraybuffer';
        }
      }

      if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {
        var names = [];
        Object.getOwnPropertyNames(init.headers).forEach(function(name) {
          names.push(normalizeName(name));
          xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
        });
        request.headers.forEach(function(value, name) {
          if (names.indexOf(name) === -1) {
            xhr.setRequestHeader(name, value);
          }
        });
      } else {
        request.headers.forEach(function(value, name) {
          xhr.setRequestHeader(name, value);
        });
      }

      if (request.signal) {
        request.signal.addEventListener('abort', abortXhr);

        xhr.onreadystatechange = function() {
          // DONE (success or failure)
          if (xhr.readyState === 4) {
            request.signal.removeEventListener('abort', abortXhr);
          }
        };
      }

      xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
    })
  }

  fetch.polyfill = true;

  if (!g.fetch) {
    g.fetch = fetch;
    g.Headers = Headers;
    g.Request = Request;
    g.Response = Response;
  }

  exports.Headers = Headers;
  exports.Request = Request;
  exports.Response = Response;
  exports.fetch = fetch;

  Object.defineProperty(exports, '__esModule', { value: true });

})));

/*! Hammer.JS - v2.0.7 - 2016-04-22
 * http://hammerjs.github.io/
 *
 * Copyright (c) 2016 Jorik Tangelder;
 * Licensed under the MIT license */
!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"\n"+d+" AT \n";return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ma.length;){if(c=ma[g],e=c?c+f:b,e in a)return e;g++}return d}function v(){return ua++}function w(b){var c=b.ownerDocument||b;return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;return new(b=c?c:xa?M:ya?P:wa?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&Ea&&d-e===0,g=b&(Ga|Ha)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:pa(a.pointers[c].clientX),clientY:pa(a.pointers[c].clientY)},c++;return{timeStamp:ra(),pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b)return{x:pa(a[0].clientX),y:pa(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ea)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ga|Ha)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),this.mouse=new L(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}function S(a,b){a&Ea?(this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):a&(Ga|Ha)&&T.call(this,b)}function T(a){var b=a.changedPointers[0];if(b.identifier===this.primaryTouch){var c={x:b.clientX,y:b.clientY};this.lastTouches.push(c);var d=this.lastTouches,e=function(){var a=d.indexOf(c);a>-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d<this.lastTouches.length;d++){var e=this.lastTouches[d],f=Math.abs(b-e.x),g=Math.abs(c-e.y);if(db>=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=c?a.CSS.supports("touch-action",d):!0}),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var sa=h(function(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a},"extend","Use `assign`."),ta=h(function(a,b){return sa(a,b,!0)},"merge","Use `assign`."),ua=1,va=/mobile|tablet|ip(ad|hone|od)|android/i,wa="ontouchstart"in a,xa=u(a,"PointerEvent")!==d,ya=wa&&va.test(navigator.userAgent),za="touch",Aa="pen",Ba="mouse",Ca="kinect",Da=25,Ea=1,Fa=2,Ga=4,Ha=8,Ia=1,Ja=2,Ka=4,La=8,Ma=16,Na=Ja|Ka,Oa=La|Ma,Pa=Na|Oa,Qa=["x","y"],Ra=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(this.element),this.evWin,this.domHandler)}};var Sa={mousedown:Ea,mousemove:Fa,mouseup:Ga},Ta="mousedown",Ua="mousemove mouseup";i(L,x,{handler:function(a){var b=Sa[a.type];b&Ea&&0===a.button&&(this.pressed=!0),b&Fa&&1!==a.which&&(b=Ga),this.pressed&&(b&Ga&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:Ba,srcEvent:a}))}});var Va={pointerdown:Ea,pointermove:Fa,pointerup:Ga,pointercancel:Ha,pointerout:Ha},Wa={2:za,3:Aa,4:Ba,5:Ca},Xa="pointerdown",Ya="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown",Ya="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Va[d],f=Wa[a.pointerType]||a.pointerType,g=f==za,h=r(b,a.pointerId,"pointerId");e&Ea&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(tb|nb)))return!1;a++}return!0},recognize:function(a){var b=la({},a);return k(this.options.enable,[this,b])?(this.state&(rb|sb|tb)&&(this.state=nb),this.state=this.process(b),void(this.state&(ob|pb|qb|sb)&&this.tryEmit(b))):(this.reset(),void(this.state=tb))},process:function(a){},getTouchAction:function(){},reset:function(){}},i(aa,Y,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(ob|pb),e=this.attrTest(a);return d&&(c&Ha||!e)?b|sb:d||e?c&Ga?b|qb:b&ob?b|pb:ob:tb}}),i(ba,aa,{defaults:{event:"pan",threshold:10,pointers:1,direction:Pa},getTouchAction:function(){var a=this.options.direction,b=[];return a&Na&&b.push(lb),a&Oa&&b.push(kb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Na?(e=0===f?Ia:0>f?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&Ea&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ga)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||H(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=rb,this.tryEmit()},b.interval,this),ob):rb}return tb},failTimeout:function(){return this._timer=e(function(){this.state=tb},this.options.interval,this),tb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ha.VERSION="2.0.7",ha.defaults={domEvents:!1,touchAction:gb,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[ca,{enable:!1},["rotate"]],[fa,{direction:Na}],[ba,{direction:Na},["swipe"]],[ga],[ga,{event:"doubletap",taps:2},["tap"]],[da]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ub=1,vb=2;ia.prototype={set:function(a){return la(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?vb:ub},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&rb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(ob|pb|qb)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Y)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}return this},on:function(a,b){if(a!==d&&b!==d){var c=this.handlers;return g(q(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this}},off:function(a,b){if(a!==d){var c=this.handlers;return g(q(a),function(a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]}),this}},emit:function(a,b){this.options.domEvents&&ka(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&ja(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},la(ha,{INPUT_START:Ea,INPUT_MOVE:Fa,INPUT_END:Ga,INPUT_CANCEL:Ha,STATE_POSSIBLE:nb,STATE_BEGAN:ob,STATE_CHANGED:pb,STATE_ENDED:qb,STATE_RECOGNIZED:rb,STATE_CANCELLED:sb,STATE_FAILED:tb,DIRECTION_NONE:Ia,DIRECTION_LEFT:Ja,DIRECTION_RIGHT:Ka,DIRECTION_UP:La,DIRECTION_DOWN:Ma,DIRECTION_HORIZONTAL:Na,DIRECTION_VERTICAL:Oa,DIRECTION_ALL:Pa,Manager:ia,Input:x,TouchAction:V,TouchInput:P,MouseInput:L,PointerEventInput:M,TouchMouseInput:R,SingleTouchInput:N,Recognizer:Y,AttrRecognizer:aa,Tap:ga,Pan:ba,Swipe:fa,Pinch:ca,Rotate:ea,Press:da,on:m,off:n,each:g,merge:ta,extend:sa,assign:la,inherit:i,bindFn:j,prefixed:u});var wb="undefined"!=typeof a?a:"undefined"!=typeof self?self:{};wb.Hammer=ha,"function"==typeof define&&define.amd?define(function(){return ha}):"undefined"!=typeof module&&module.exports?module.exports=ha:a[c]=ha}(window,document,"Hammer");
//# sourceMappingURL=hammer.min.js.map
!function(){"use strict";function n(n,i){for(var e=0;e<i.length;e++){var t=i[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}function i(n,i,e){return i in n?Object.defineProperty(n,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[i]=e,n}var e=function(){function e(){!function(n,i){if(!(n instanceof i))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"mPlugins",void 0),i(this,"mEvents",void 0),this.mPlugins={},this.mEvents={}}var t,u;return t=e,(u=[{key:"registerPlugin",value:function(n,i){return void 0===this.mPlugins[n]&&(this.mPlugins[n]=i,this[n]=function(){var i;return(i=this.mPlugins)[n].apply(i,arguments)},!0)}},{key:"unregisterPlugin",value:function(n){return void 0!==this.mPlugins[n]&&(delete this.mPlugins[n],delete this[n],!0)}},{key:"subscribe",value:function(n,i){return void 0===this.mEvents[n]&&(this.mEvents[n]=[]),this.mEvents[n].push(i)}},{key:"unsubscribe",value:function(n,i){void 0!==this.mEvents[n]&&(this.mEvents[n][i]=void 0)}},{key:"emit",value:function(n,i){void 0!==this.mEvents[n]&&this.mEvents[n].forEach((function(n){void 0!==n&&setTimeout((function(){n(i)}),0)}))}}])&&n(t.prototype,u),e}();window.expivi=window.expivi||{interact:null};var t=null;window.expivi.interact=function(){return null===t&&(t=new e),t}}();
!function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=function(){function i(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),n(this,"mOptions",void 0),n(this,"mOriginalItem",void 0),n(this,"mDimensions",void 0),n(this,"mDomObserver",void 0),this.mOptions=function(t){for(var i=1;i<arguments.length;i++){var r=null!=arguments[i]?arguments[i]:{};i%2?e(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},t),this.mOriginalItem=this.mOptions.element,this.mDimensions={width:0,height:0};var r=window.MutationObserver||window.WebKitMutationObserver;this.mDomObserver=new r(this.onDomChanged.bind(this)),this.mDomObserver.observe(this.mOriginalItem,{attributes:!1,childList:!0,subtree:!0}),this.update()}var r,o;return r=i,(o=[{key:"destroy",value:function(){this.mDomObserver&&this.mDomObserver.disconnect()}},{key:"update",value:function(){var e=this.mOriginalItem.getBoundingClientRect();this.mDimensions.width=e.width,this.mDimensions.height=e.height}},{key:"onDropped",value:function(e,t){return!!this.isInRect(e,t)}},{key:"onDomChanged",value:function(){this.update()}},{key:"isInRect",value:function(e,t){var n=this.mOriginalItem.getBoundingClientRect(),i=document.body.getBoundingClientRect(),r=n.left-i.left,o=n.top-i.top,s=r+n.width,u=o+n.height;return e>r&&t>o&&e<s&&t<u}},{key:"width",get:function(){return this.mDimensions.width}},{key:"height",get:function(){return this.mDimensions.height}},{key:"element",get:function(){return this.mOptions.element}}])&&t(r.prototype,o),i}();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),s(this,"mOptions",void 0),s(this,"mItems",[]),s(this,"mSubscriptions",[]),s(this,"mListeners",[]),this.mOptions=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({ondropped:function(){}},t);var n=this.parseElements(this.mOptions.droppable);this.mItems=n.map((function(e){return new i({element:e})})),this.registerListeners()}var t,n;return t=e,(n=[{key:"destroy",value:function(){this.unregisterListeners(),this.mItems.splice(0).forEach((function(e){return e.destroy()}))}},{key:"registerListeners",value:function(){var e=this;this.addEventListener({name:"resize",el:document,fn:this.onWindowResize.bind(this),options:!1}),this.mSubscriptions.push(window.expivi.interact().subscribe("draggable:dragend",(function(t){var n=t.position.x,i=t.position.y;e.mItems.forEach((function(r){r.onDropped(n,i)&&e.mOptions.ondropped({type:"droppped",originalSource:t.originalSource,event:t.event,position:{x:n,y:i},clientX:n-window.pageXOffset,clientY:i-window.pageYOffset,width:r.width,height:r.height})}))})))}},{key:"unregisterListeners",value:function(){this.mListeners.splice(0).forEach((function(e){e.el.removeEventListener(e.name,e.fn,e.options)})),this.mSubscriptions.splice(0).forEach((function(e){return window.expivi.interact().unsubscribe("draggable:dragend",e)}))}},{key:"onWindowResize",value:function(e){this.mItems.forEach((function(e){e.update()}))}},{key:"parseElements",value:function(e){if(null==e||null==e)return[];if(e&&e.nodeName)return[e];if("string"==typeof e){for(var t=[],n=document.querySelectorAll(e),i=0;i<n.length;i++)t.push(n[i]);return t}return Array.isArray(e)?e:[]}},{key:"addEventListener",value:function(e){e.el.addEventListener(e.name,e.fn,e.options),this.mListeners.push(e)}}])&&o(t.prototype,n),e}();if(void 0===window.expivi.interact)throw"Implement expivi-interact before dropzone.";window.expivi.interact().registerPlugin("dropzone",(function(e){return new u(e)}))}();
/*! For license information please see index.js.LICENSE.txt */
(function(){var __webpack_modules__={41840:function(e,t,n){"use strict";n.d(t,{K:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=(n(16280),function(){function e(){(0,r.A)(this,e),(0,a.A)(this,"mAccessor",void 0),(0,a.A)(this,"mIsInitialized",!1)}return(0,i.A)(e,null,[{key:"getInstance",value:function(){return e.sInstance||(e.sInstance=new e),e.sInstance}},{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getInstance();n.mAccessor=e,n.mAccessor.init(t),n.mIsInitialized=!0}},{key:"isInitialized",value:function(){return this.getInstance().mIsInitialized}},{key:"renderer",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.renderer()}},{key:"sceneManager",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.sceneManager()}},{key:"eventBus",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.eventBus()}},{key:"messenger",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.messenger()}},{key:"commandManager",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.commandManager()}},{key:"stateRegistery",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.stateRegistery()}},{key:"settingsManager",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.settingsManager()}},{key:"interceptorManager",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.interceptorManager()}},{key:"physicsSystem",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.physicsSystem()}},{key:"constraintSystem",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.constraintSystem()}},{key:"dispose",value:function(){e.sInstance&&e.sInstance.mAccessor&&e.sInstance.mAccessor.dispose(),delete e.sInstance}},{key:"reset",value:function(t,n){var r=e.getInstance();if(!r.mAccessor)throw new Error("Module used before initialisation.");return r.mAccessor.reset(t,n)}}])}());(0,a.A)(o,"sInstance",void 0)},31167:function(e,t,n){"use strict";n.d(t,{J:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=function(){return(0,i.A)((function e(t){(0,r.A)(this,e),(0,a.A)(this,"mName",void 0),this.mName=t}),[{key:"getName",value:function(){return this.mName}}])}()},12217:function(e,t,n){"use strict";n.d(t,{F:function(){return l}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467);function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}var l=function(e){function t(){return(0,r.A)(this,t),e=this,n=t,i=[t.mType],n=(0,o.A)(n),(0,a.A)(e,c()?Reflect.construct(n,i||[],(0,o.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,s.A)(t,e),(0,i.A)(t,null,[{key:"getTopicName",value:function(){return t.mType}}])}(n(31167).J);(0,u.A)(l,"mType","BoundingBoxUpdateEvent")},5074:function(e,t,n){"use strict";n.d(t,{E:function(){return l}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467);function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}var l=function(e){function t(e,n,i){var s,l,h,f;return(0,r.A)(this,t),l=this,h=t,f=[t.getTopicName(e)],h=(0,o.A)(h),s=(0,a.A)(l,c()?Reflect.construct(h,f||[],(0,o.A)(l).constructor):h.apply(l,f)),(0,u.A)(s,"mType",void 0),(0,u.A)(s,"mVisible",void 0),(0,u.A)(s,"mData",void 0),s.mType=e,s.mVisible=n,s.mData=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return this.mType}},{key:"isVisible",value:function(){return this.mVisible}},{key:"getData",value:function(){return this.mData}}],[{key:"getTopicName",value:function(e){return"EditorGizmoVisibilityEvent.".concat(e)}}])}(n(31167).J)},94273:function(e,t,n){"use strict";n.d(t,{r:function(){return l}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467);function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}var l=function(e){function t(e,n){var i,s,l,h;return(0,r.A)(this,t),s=this,l=t,h=[t.getTopicName(e)],l=(0,o.A)(l),i=(0,a.A)(s,c()?Reflect.construct(l,h||[],(0,o.A)(s).constructor):l.apply(s,h)),(0,u.A)(i,"mType",void 0),(0,u.A)(i,"mData",void 0),i.mType=e,i.mData=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return this.mType}},{key:"getData",value:function(){return this.mData}}],[{key:"getTopicName",value:function(e){return"EditorSubscriptionType.".concat(e)}}])}(n(31167).J)},18910:function(e,t,n){"use strict";n.d(t,{LH:function(){return f},EI:function(){return p},G_:function(){return v},TF:function(){return g},A0:function(){return M},BX:function(){return w},ui:function(){return T.u},A_:function(){return C.A},lF:function(){return R},kU:function(){return I.k},P9:function(){return D},TD:function(){return j},cf:function(){return q},OZ:function(){return W.O},yR:function(){return X},vq:function(){return $},Xf:function(){return Q},VC:function(){return J.V},Eg:function(){return ee.E},y0:function(){return te.y},fV:function(){return re},jb:function(){return ae},xt:function(){return se},q0:function(){return ue.q},qX:function(){return le},W2:function(){return fe},Sc:function(){return de},nN:function(){return I.G}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(1393);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(){return(0,r.A)(this,t),e=this,n=t,i=arguments,n=(0,o.A)(n),(0,a.A)(e,h()?Reflect.construct(n,i||[],(0,o.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(m=function(){return!!e})()}(0,u.A)(f,"TypeRTTI",new c.O("MessageAfterViewInit",l.Q.TypeRTTI));var p=function(e){function t(){return(0,r.A)(this,t),e=this,n=t,i=arguments,n=(0,o.A)(n),(0,a.A)(e,m()?Reflect.construct(n,i||[],(0,o.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}(0,u.A)(p,"TypeRTTI",new c.O("MessageCameraAnimated",l.Q.TypeRTTI));var v=function(e){function t(){var e,n,i,s,c=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return(0,r.A)(this,t),n=this,i=t,i=(0,o.A)(i),e=(0,a.A)(n,d()?Reflect.construct(i,s||[],(0,o.A)(n).constructor):i.apply(n,s)),(0,u.A)(e,"mZoomed",void 0),e.mZoomed=c,e}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"hasZoomed",get:function(){return this.mZoomed}}])}(l.Q);function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}(0,u.A)(v,"TypeRTTI",new c.O("MessageCameraZoom",l.Q.TypeRTTI));var g=function(e){function t(){return(0,r.A)(this,t),e=this,n=t,i=arguments,n=(0,o.A)(n),(0,a.A)(e,y()?Reflect.construct(n,i||[],(0,o.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(g,"TypeRTTI",new c.O("MessageControlsMoved",l.Q.TypeRTTI));var b=n(68263),A=n(41840);function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_=function(){return!!e})()}var M=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,_()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"mName",void 0),(0,u.A)(s,"mData",void 0),(0,u.A)(s,"mScreenPosition",new b.I),s.mName=e,s.mScreenPosition.copy(n),s.mData=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"name",get:function(){return this.mName}},{key:"data",get:function(){return this.mData}},{key:"position",get:function(){return this.mScreenPosition}},{key:"canvasPosition",get:function(){var e=A.K.renderer().getRenderEngine().getCanvas().getBoundingClientRect();return new b.I(this.mScreenPosition.x-e.left,this.mScreenPosition.y-e.top)}}])}(l.Q);function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(k=function(){return!!e})()}(0,u.A)(M,"TypeRTTI",new c.O("MessageDrag",l.Q.TypeRTTI));var w=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,k()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"mName",void 0),(0,u.A)(s,"mIsDroppedInDropZone",void 0),(0,u.A)(s,"mData",void 0),s.mName=e,s.mIsDroppedInDropZone=n,s.mData=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"name",get:function(){return this.mName}},{key:"data",get:function(){return this.mData}},{key:"isDroppedInDropZone",get:function(){return this.mIsDroppedInDropZone}}])}(l.Q);(0,u.A)(w,"TypeRTTI",new c.O("MessageDropZone",l.Q.TypeRTTI));var T=n(52669);function x(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(x=function(){return!!e})()}var S=function(e){function t(){return(0,r.A)(this,t),e=this,n=t,i=arguments,n=(0,o.A)(n),(0,a.A)(e,x()?Reflect.construct(n,i||[],(0,o.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(S,"TypeRTTI",new c.O("MessageInitRenderObject",l.Q.TypeRTTI));var C=n(85661);function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(E=function(){return!!e})()}var R=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,E()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"mName",void 0),(0,u.A)(i,"mEvent",void 0),i.mName=e,i.mEvent=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"name",get:function(){return this.mName}},{key:"event",get:function(){return this.mEvent}}])}(l.Q);(0,u.A)(R,"TypeRTTI",new c.O("MessageMouse",l.Q.TypeRTTI));var I=n(7909);function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(O=function(){return!!e})()}var D=function(e){function t(e,n,i,s,c){var l,h,f,m;return(0,r.A)(this,t),h=this,f=t,f=(0,o.A)(f),l=(0,a.A)(h,O()?Reflect.construct(f,m||[],(0,o.A)(h).constructor):f.apply(h,m)),(0,u.A)(l,"product_scene_uuid",void 0),(0,u.A)(l,"product_scene_id",void 0),(0,u.A)(l,"attribute_id",void 0),(0,u.A)(l,"option_id",void 0),(0,u.A)(l,"visible",void 0),l.product_scene_id=e,l.product_scene_uuid=n,l.attribute_id=i,l.option_id=c,l.visible=s,l}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function P(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(P=function(){return!!e})()}(0,u.A)(D,"TypeRTTI",new c.O("MessageOptionVisibility",l.Q.TypeRTTI));var B=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,P()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"renderer",void 0),(0,u.A)(s,"camera",void 0),(0,u.A)(s,"scene",void 0),s.renderer=e,s.camera=n,s.scene=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function F(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(F=function(){return!!e})()}(0,u.A)(B,"TypeRTTI",new c.O("MessagePostrender",l.Q.TypeRTTI));var N=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,F()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"renderer",void 0),(0,u.A)(s,"camera",void 0),(0,u.A)(s,"scene",void 0),s.renderer=e,s.camera=n,s.scene=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function L(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(L=function(){return!!e})()}(0,u.A)(N,"TypeRTTI",new c.O("MessagePrerender",l.Q.TypeRTTI));var j=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,L()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"mItemId",void 0),(0,u.A)(s,"mVisible",void 0),(0,u.A)(s,"mProductNode",void 0),s.mItemId=e,s.mVisible=n,s.mProductNode=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"itemId",get:function(){return this.mItemId}},{key:"visible",get:function(){return this.mVisible}},{key:"productNode",get:function(){return this.mProductNode}}])}(l.Q);function U(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(U=function(){return!!e})()}(0,u.A)(j,"TypeRTTI",new c.O("MessagePriceVisibility",l.Q.TypeRTTI));var V=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,U()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"mRenderer",void 0),(0,u.A)(s,"mCamera",void 0),(0,u.A)(s,"mScene",void 0),s.mRenderer=e,s.mCamera=n,s.mScene=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"renderer",get:function(){return this.mRenderer}},{key:"camera",get:function(){return this.mCamera}},{key:"scene",get:function(){return this.mScene}}])}(l.Q);function z(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(z=function(){return!!e})()}(0,u.A)(V,"TypeRTTI",new c.O("MessageRender",l.Q.TypeRTTI));var H=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,z()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"renderer",void 0),(0,u.A)(s,"camera",void 0),(0,u.A)(s,"scene",void 0),s.renderer=e,s.camera=n,s.scene=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function G(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(G=function(){return!!e})()}(0,u.A)(H,"TypeRTTI",new c.O("MessageRenderPosteffects",l.Q.TypeRTTI));var q=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,G()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"mRenderPool",void 0),(0,u.A)(i,"mDeltaTime",void 0),i.mRenderPool=e,i.mDeltaTime=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"renderPool",get:function(){return this.mRenderPool}},{key:"deltaTime",get:function(){return this.mDeltaTime}}])}(l.Q);(0,u.A)(q,"TypeRTTI",new c.O("MessageSceneAfterDraw",l.Q.TypeRTTI));var W=n(21501);function K(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(K=function(){return!!e})()}var X=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,K()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"mRenderPool",void 0),(0,u.A)(i,"mDeltaTime",void 0),i.mRenderPool=e,i.mDeltaTime=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"renderPool",get:function(){return this.mRenderPool}},{key:"deltaTime",get:function(){return this.mDeltaTime}}])}(l.Q);(0,u.A)(X,"TypeRTTI",new c.O("MessageSceneDraw",l.Q.TypeRTTI));n(82363);function Y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Y=function(){return!!e})()}var $=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,Y()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"parent",void 0),n.parent=e,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function Z(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Z=function(){return!!e})()}(0,u.A)($,"TypeRTTI",new c.O("MessageSceneObjectAttached",l.Q.TypeRTTI));var Q=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,Z()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"parent",void 0),n.parent=e,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(Q,"TypeRTTI",new c.O("MessageSceneObjectDetached",l.Q.TypeRTTI));var J=n(97298),ee=n(85434),te=n(44152);function ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ne=function(){return!!e})()}var re=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,ne()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"key",void 0),(0,u.A)(i,"value",void 0),i.key=e,i.value=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function ie(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ie=function(){return!!e})()}(0,u.A)(re,"TypeRTTI",new c.O("MessageSetValue",l.Q.TypeRTTI));var ae=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,ie()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"mWidth",void 0),(0,u.A)(i,"mHeight",void 0),i.mWidth=e,i.mHeight=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"width",get:function(){return this.mWidth}},{key:"height",get:function(){return this.mHeight}}])}(l.Q);function oe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oe=function(){return!!e})()}(0,u.A)(ae,"TypeRTTI",new c.O("MessageSizechange",l.Q.TypeRTTI));var se=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,oe()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"reset",void 0),(0,u.A)(i,"save",void 0),i.save=e,i.reset=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(se,"TypeRTTI",new c.O("MessageStateControls",l.Q.TypeRTTI));var ue=n(95580);function ce(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ce=function(){return!!e})()}var le=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,ce()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"mLocked",void 0),(0,u.A)(i,"mChanged",void 0),i.mLocked=e,i.mChanged=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"isTransformLocked",get:function(){return this.mLocked}},{key:"isTransformChanged",get:function(){return this.mChanged}}])}(l.Q);function he(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(he=function(){return!!e})()}(0,u.A)(le,"TypeRTTI",new c.O("MessageTransformControls",l.Q.TypeRTTI));var fe=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,he()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"mDelta",void 0),n.mDelta=e,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"delta",get:function(){return this.mDelta}}])}(l.Q);(0,u.A)(fe,"TypeRTTI",new c.O("MessageViewupdate",l.Q.TypeRTTI));var me=n(28001);function pe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pe=function(){return!!e})()}var de=function(e){function t(e){var n,i,s,c,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:me.b.TypeRTTI;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,pe()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"visible",void 0),(0,u.A)(n,"object_type",void 0),n.visible=e,n.object_type=l,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(de,"TypeRTTI",new c.O("MessageVisibility",l.Q.TypeRTTI))},52669:function(e,t,n){"use strict";n.d(t,{u:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(1393);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e,n){var i,s,c,l,f=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,h()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"fitPosition",void 0),(0,u.A)(i,"targetObject",void 0),(0,u.A)(i,"animate",void 0),i.fitPosition=e,i.targetObject=n,i.animate=f,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(f,"TypeRTTI",new c.O("MessageFitCamera",l.Q.TypeRTTI))},85661:function(e,t,n){"use strict";n.d(t,{A:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(1393),l=n(44889);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,h()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"mMaterialModelId",void 0),(0,u.A)(i,"mSharedKey",void 0),i.mMaterialModelId=e,i.mSharedKey=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"materialModelId",get:function(){return this.mMaterialModelId}},{key:"sharedKey",get:function(){return this.mSharedKey}}])}(c.Q);(0,u.A)(f,"TypeRTTI",new l.O("MessageMaterialOverwrite",c.Q.TypeRTTI))},7909:function(e,t,n){"use strict";n.d(t,{G:function(){return r},k:function(){return m}});n(60825);var r,i=n(23029),a=n(92901),o=n(50388),s=n(53954),u=n(85501),c=n(64467),l=n(44889),h=n(1393);function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}!function(e){e[e.NONE=0]="NONE",e[e.PUSH_CONTROLLER=1]="PUSH_CONTROLLER",e[e.POP_CONTROLLER=2]="POP_CONTROLLER"}(r||(r={}));var m=function(e){function t(e,n){var a,u,l,h,m=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.NONE,p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,d=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return(0,i.A)(this,t),u=this,l=t,l=(0,s.A)(l),a=(0,o.A)(u,f()?Reflect.construct(l,h||[],(0,s.A)(u).constructor):l.apply(u,h)),(0,c.A)(a,"origin",void 0),(0,c.A)(a,"dir",void 0),(0,c.A)(a,"action",void 0),(0,c.A)(a,"delta",void 0),(0,c.A)(a,"forceUpdate",void 0),a.origin=e,a.dir=n,a.action=m,a.delta=p,a.forceUpdate=d,a}return(0,u.A)(t,e),(0,a.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(h.Q);(0,c.A)(m,"TypeRTTI",new l.O("MessageMoveCamera",h.Q.TypeRTTI))},21501:function(e,t,n){"use strict";n.d(t,{O:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(1393);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(){return(0,r.A)(this,t),e=this,n=t,i=arguments,n=(0,o.A)(n),(0,a.A)(e,h()?Reflect.construct(n,i||[],(0,o.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(f,"TypeRTTI",new c.O("MessageSceneDestroy",l.Q.TypeRTTI))},82363:function(e,t,n){"use strict";n.d(t,{P:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(1393);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,h()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"delta",void 0),n.delta=e,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(f,"TypeRTTI",new c.O("MessageSceneFixedUpdate",l.Q.TypeRTTI))},97298:function(e,t,n){"use strict";n.d(t,{V:function(){return m}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=(n(50113),n(79432),n(26099),n(3064),n(9920),n(98992),n(72577),n(3949),n(23500),n(44889)),l=n(1393),h=n(11208);function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}var m=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,f()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"delta",void 0),(0,u.A)(n,"processStatus",{}),n.delta=e,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"setProcessStatus",value:function(e,t){this.processStatus[e]=t}},{key:"getProcessStatus",value:function(e){return this.processStatus[e]}},{key:"clearProcessStatuses",value:function(){var e=this;Object.keys(this.processStatus).forEach((function(t){return delete e.processStatus[t]}))}},{key:"getProcessStatuses",value:function(){return this.processStatus}},{key:"isAnyProcessInProgress",value:function(){var e=this;return!!Object.keys(this.processStatus).find((function(t){return e.processStatus[t]===h.B.InProgress}))}}])}(l.Q);(0,u.A)(m,"TypeRTTI",new c.O("MessageSceneUpdate",l.Q.TypeRTTI))},85434:function(e,t,n){"use strict";n.d(t,{E:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(1393);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e){var n,i,s,c,l=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],f=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],m=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,h()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"camId",void 0),(0,u.A)(n,"animate",void 0),(0,u.A)(n,"openView",void 0),(0,u.A)(n,"skipRenderAwaiting",void 0),n.camId=e,n.animate=l,n.openView=f,n.skipRenderAwaiting=m,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(f,"TypeRTTI",new c.O("MessageSelectCameraId",l.Q.TypeRTTI))},44152:function(e,t,n){"use strict";n.d(t,{y:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(1393),l=n(44889);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,h()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"viewId",void 0),n.viewId=e,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(c.Q);(0,u.A)(f,"TypeRTTI",new l.O("MessageSelectViewId",c.Q.TypeRTTI))},95580:function(e,t,n){"use strict";n.d(t,{q:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(1393);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,h()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"event",void 0),(0,u.A)(i,"data",void 0),i.event=e,i.data=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(f,"TypeRTTI",new c.O("MessageToolbarItemEvent",l.Q.TypeRTTI))},73704:function(e,t,n){"use strict";n.d(t,{X:function(){return v}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(90991),u=n(85501),c=n(64467),l=(n(69085),n(70192)),h=n(44889),f=n(41840),m=n(47928);function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function d(e,t,n,r){var i=(0,s.A)((0,o.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var v=function(e){function t(){var e,n,i,s,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return(0,r.A)(this,t),n=this,i=t,i=(0,o.A)(i),e=(0,a.A)(n,p()?Reflect.construct(i,s||[],(0,o.A)(n).constructor):i.apply(n,s)),(0,c.A)(e,"mWidth",1),(0,c.A)(e,"mHeight",1),(0,c.A)(e,"mDepth",1),e.mWidth=u,e.mHeight=l,e.mDepth=h,e}return(0,u.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"createShape",value:function(){return f.K.physicsSystem().getWorld().createBox(new m.P(this.mWidth,this.mHeight,this.mDepth))}},{key:"getShapeType",value:function(){return"box"}},{key:"getWidth",value:function(){return this.mWidth}},{key:"setWidth",value:function(e){var t;this.mWidth=e,this.mShape.setWidth(this.mWidth),null===(t=this.mHelper)||void 0===t||t.updateChanges()}},{key:"getHeight",value:function(){return this.mHeight}},{key:"setHeight",value:function(e){var t;this.mHeight=e,this.mShape.setHeight(this.mHeight),null===(t=this.mHelper)||void 0===t||t.updateChanges()}},{key:"getDepth",value:function(){return this.mDepth}},{key:"setDepth",value:function(e){var t;this.mDepth=e,this.mShape.setDepth(this.mDepth),null===(t=this.mHelper)||void 0===t||t.updateChanges()}},{key:"onAutomaticUpdate",value:function(){var e,t=this.getParentObject().getBoundingBox(!0),n=new m.P;t.getSize(n),this.mWidth=n.x,this.mHeight=n.y,this.mDepth=n.z,this.mShape.setWidth(this.mWidth),this.mShape.setHeight(this.mHeight),this.mShape.setDepth(this.mDepth),this.setOffset(new m.P(0,.5*n.y,0)),null===(e=this.mHelper)||void 0===e||e.updateChanges()}},{key:"parse",value:function(e){if(!d(t,"parse",this,3)([e]))return!1;var n;(e.properties&&(this.mWidth="number"==typeof e.properties.width?e.properties.width:1,this.mHeight="number"==typeof e.properties.height?e.properties.height:1,this.mDepth="number"==typeof e.properties.depth?e.properties.depth:1),this.mShape)&&(this.mShape.setWidth(this.mWidth),this.mShape.setHeight(this.mHeight),this.mShape.setDepth(this.mDepth),null===(n=this.mHelper)||void 0===n||n.updateChanges());return!0}},{key:"serialize",value:function(){var e=d(t,"serialize",this,3)([]);return e.properties=Object.assign(e.properties,{width:this.mWidth,height:this.mHeight,depth:this.mDepth}),e}}])}(l.f);(0,c.A)(v,"TypeRTTI",new h.O("BoxColliderComponent",l.f.TypeRTTI))},70192:function(e,t,n){"use strict";n.d(t,{f:function(){return b}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=(n(44114),n(54554),n(26099),n(3362),n(33811),n(9920),n(86994),n(98992),n(3949),n(41795),n(23500),n(43423)),l=n(41840),h=n(44889),f=n(11345),m=n(5074),p=n(47153),d=n(47928),v=n(71197),y=n(12217);function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(g=function(){return!!e})()}var b=function(e){function t(){var e,n,i,s;return(0,r.A)(this,t),n=this,i=t,s=["physics-object-collider"],i=(0,o.A)(i),e=(0,a.A)(n,g()?Reflect.construct(i,s||[],(0,o.A)(n).constructor):i.apply(n,s)),(0,u.A)(e,"mEnabled",!0),(0,u.A)(e,"mSceneObjectId",void 0),(0,u.A)(e,"mBody",void 0),(0,u.A)(e,"mOffset",new d.P),(0,u.A)(e,"mShape",void 0),(0,u.A)(e,"mAutomatic",!1),(0,u.A)(e,"mBodyType",v.k.Kinematic),(0,u.A)(e,"mDebug",!1),(0,u.A)(e,"mHelper",void 0),(0,u.A)(e,"mSubscriptions",[]),e}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this,t=l.K.physicsSystem().getWorld();this.mShape=this.createShape(),this.mBody=t.createBody(this.mShape,this.mBodyType),this.mBody.setOffset(this.mOffset);var n=this.getParentObject();this.mSceneObjectId=n.getSceneObjectId(),l.K.physicsSystem().registerMesh(n,this.mBody),this.mEnabled=!0,this.mDebug=l.K.physicsSystem().showHelpers(),this.mDebug&&this.createHelper(),this.mSubscriptions.push(l.K.eventBus().subscribe(m.E.getTopicName(p.o.PhysicsCollider),(function(t){e.mDebug=t.isVisible(),e.mDebug?e.createHelper():e.destroyHelper()})),l.K.eventBus().subscribe(y.F.getTopicName(),(function(){e.mAutomatic&&e.onAutomaticUpdate()}),"".concat(this.mSceneObjectId)))}},{key:"OnDetached",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.destroyHelper(),this.mEnabled&&(l.K.physicsSystem().unregisterMesh(this.mSceneObjectId),delete this.mSceneObjectId,this.mEnabled=!1),this.mBody&&(this.mBody.dispose(),delete this.mBody),this.mShape&&delete this.mShape}},{key:"isAttachable",value:function(e){return e.isTypeName("ConfigurableNode")||e.isTypeName("ProductNode")||e.isTypeName("ReferenceProductNode")}},{key:"createHelper",value:function(){this.mHelper||(this.mHelper=new f.F(this.mBody),l.K.sceneManager().addNode(this.mHelper,void 0,!1))}},{key:"destroyHelper",value:function(){this.mHelper&&(l.K.sceneManager().removeNode(this.mHelper,!0,!0,!0,!1),this.mHelper.destroy(!0),delete this.mHelper)}},{key:"isEnabled",value:function(){return this.mEnabled}},{key:"setEnabled",value:function(e){if(this.mEnabled!==e)if(this.mEnabled=e,this.mEnabled){var t=this.getParentObject();l.K.physicsSystem().registerMesh(t,this.mBody),this.mDebug&&this.createHelper()}else{var n=this.getParentObject();l.K.physicsSystem().unregisterMesh(n.getSceneObjectId()),this.destroyHelper()}}},{key:"isAutomatic",value:function(){return this.mAutomatic}},{key:"setAutomatic",value:function(e){this.mAutomatic=e,this.mAutomatic&&this.mBody&&this.onAutomaticUpdate()}},{key:"getOffset",value:function(){return this.mOffset}},{key:"setOffset",value:function(e){var t;this.mOffset.copy(e),null===(t=this.mBody)||void 0===t||t.setOffset(this.mOffset)}},{key:"getBodyType",value:function(){return this.mBodyType}},{key:"setBodyType",value:function(e){this.mBodyType!==e&&(this.mBodyType=e,this.mBody.setBodyType(this.mBodyType))}},{key:"getBody",value:function(){return this.mBody}},{key:"parse",value:function(e){if(!e)return!1;this.mBodyType="number"==typeof e.body_type&&e.body_type in v.k?e.body_type:v.k.Kinematic;var t=Array.isArray(e.offset)&&e.offset.length>=3?e.offset:[0,0,0];return this.mOffset.fromArray(t),this.setAutomatic(void 0!==e.automatic&&Boolean(e.automatic)),this.mBody&&(this.mBody.setBodyType(this.mBodyType),this.mBody.setOffset(this.mOffset)),!0}},{key:"serialize",value:function(){return{type:this.getShapeType(),body_type:this.mBodyType,offset:this.mOffset.toArray(),automatic:this.mAutomatic,properties:{}}}}])}(c.$);(0,u.A)(b,"TypeRTTI",new h.O("PhysicsColliderComponent",c.$.TypeRTTI))},30700:function(e,t,n){"use strict";n.d(t,{X:function(){return v}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(90991),u=n(85501),c=n(64467),l=(n(69085),n(70192)),h=n(44889),f=n(41840),m=n(47928);function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function d(e,t,n,r){var i=(0,s.A)((0,o.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var v=function(e){function t(){var e,n,i,s,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return(0,r.A)(this,t),n=this,i=t,i=(0,o.A)(i),e=(0,a.A)(n,p()?Reflect.construct(i,s||[],(0,o.A)(n).constructor):i.apply(n,s)),(0,c.A)(e,"mRadius",void 0),e.mRadius=u,e}return(0,u.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"createShape",value:function(){return f.K.physicsSystem().getWorld().createSphere(this.mRadius)}},{key:"getShapeType",value:function(){return"sphere"}},{key:"getRadius",value:function(){return this.mRadius}},{key:"setRadius",value:function(e){var t;this.mRadius=e,this.mShape.setRadius(e),null===(t=this.mHelper)||void 0===t||t.updateChanges()}},{key:"onAutomaticUpdate",value:function(){var e,t=this.getParentObject().getBoundingBox(!0),n=new m.P;t.getSize(n);var r=Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z);this.mRadius=.5*r,this.mShape.setRadius(this.mRadius),this.setOffset(new m.P(0,.5*n.y,0)),null===(e=this.mHelper)||void 0===e||e.updateChanges()}},{key:"parse",value:function(e){if(!d(t,"parse",this,3)([e]))return!1;var n;(e.properties&&(this.mRadius="number"==typeof e.properties.radius?e.properties.radius:1),this.mShape)&&(this.mShape.setRadius(this.mRadius),null===(n=this.mHelper)||void 0===n||n.updateChanges());return!0}},{key:"serialize",value:function(){var e=d(t,"serialize",this,3)([]);return e.properties=Object.assign(e.properties,{radius:this.mRadius}),e}}])}(l.f);(0,c.A)(v,"TypeRTTI",new h.O("SphereColliderComponent",l.f.TypeRTTI))},39136:function(e,t,n){"use strict";var r;n.d(t,{V:function(){return r}}),function(e){e.UNBLOCK_DEFAULT_TOUCH="UNBLOCK_DEFAULT_TOUCH",e.SCENE_EDITOR="SCENE_EDITOR"}(r||(r={}))},95216:function(e,t,n){"use strict";var r;n.d(t,{U:function(){return r}}),function(e){e.Android="android",e.iOS="ios",e.WindowsPhone="windowsphone",e.MacOS="macos",e.Windows="windows",e.Linux="linux",e.Unknown="unknown"}(r||(r={}))},47153:function(e,t,n){"use strict";var r;n.d(t,{o:function(){return r}}),function(e){e[e.PhysicsCollider=0]="PhysicsCollider"}(r||(r={}))},33153:function(e,t,n){"use strict";var r;n.d(t,{E:function(){return r}}),function(e){e[e.Initialized=0]="Initialized",e[e.BuildStarted=1]="BuildStarted",e[e.BuildFinished=2]="BuildFinished",e[e.BuildUpdated=3]="BuildUpdated",e[e.BuildFullyLoaded=4]="BuildFullyLoaded",e[e.BuildFailed=5]="BuildFailed",e[e.ViewUpdated=6]="ViewUpdated",e[e.WindowResized=7]="WindowResized",e[e.TransformModeChanged=8]="TransformModeChanged",e[e.TransformTargetMode=9]="TransformTargetMode",e[e.HistoryChanged=10]="HistoryChanged",e[e.SceneGraphAdded=11]="SceneGraphAdded",e[e.SceneGraphRemoved=12]="SceneGraphRemoved",e[e.SceneGraphChanged=13]="SceneGraphChanged",e[e.NodeAdded=14]="NodeAdded",e[e.NodeRemoved=15]="NodeRemoved",e[e.NodeChanged=16]="NodeChanged",e[e.HelperAdded=17]="HelperAdded",e[e.HelperRemoved=18]="HelperRemoved",e[e.ObjectFocused=19]="ObjectFocused",e[e.ObjectSelected=20]="ObjectSelected",e[e.ObjectChanged=21]="ObjectChanged",e[e.ObjectTransformed=22]="ObjectTransformed",e[e.ObjectTargetChanged=23]="ObjectTargetChanged",e[e.ModelAttributeChanged=24]="ModelAttributeChanged",e[e.TransformControlChanged=25]="TransformControlChanged",e[e.TransformControlLock=26]="TransformControlLock",e[e.TransformControlUnLock=27]="TransformControlUnLock",e[e.ZoomChanged=28]="ZoomChanged",e[e.BatchProgress=29]="BatchProgress",e[e.RequestFrame=30]="RequestFrame",e[e.OffsetChanged=31]="OffsetChanged",e[e.OffsetVisibility=32]="OffsetVisibility",e[e.MeshChanged=33]="MeshChanged",e[e.ProductOptionChanged=34]="ProductOptionChanged",e[e.ProductQuestionChanged=35]="ProductQuestionChanged",e[e.ProductMaterialChanged=36]="ProductMaterialChanged",e[e.ProductMaterialVisibility=37]="ProductMaterialVisibility",e[e.SceneObjectAttached=38]="SceneObjectAttached",e[e.SceneObjectDetached=39]="SceneObjectDetached",e[e.PlaySound=40]="PlaySound",e[e.ProductAttributeUpdated=41]="ProductAttributeUpdated",e[e.ProductArticlesChanged=42]="ProductArticlesChanged",e[e.ProductStartLoading=43]="ProductStartLoading",e[e.ProductFinishedLoading=44]="ProductFinishedLoading",e[e.ProductErrorLoading=45]="ProductErrorLoading",e[e.ActiveViewChanged=46]="ActiveViewChanged",e[e.QrWebAr=47]="QrWebAr",e[e.Warning=48]="Warning",e[e.EnterVR=49]="EnterVR",e[e.ExitVR=50]="ExitVR",e[e.ToolbarVisible=51]="ToolbarVisible",e[e.ToolbarHidden=52]="ToolbarHidden",e[e.Shared=53]="Shared",e[e.ProductAttributeModerated=54]="ProductAttributeModerated",e[e.DrawingTechniqueFailed=55]="DrawingTechniqueFailed",e[e.MaterialUpdated=56]="MaterialUpdated",e[e.RendererBuildStarted=57]="RendererBuildStarted",e[e.RendererBuildProgress=58]="RendererBuildProgress",e[e.RendererBuildFinished=59]="RendererBuildFinished",e[e.RendererBuildIdle=60]="RendererBuildIdle",e[e.ScreenshotTransitionStart=61]="ScreenshotTransitionStart",e[e.ScreenshotTransitionEnd=62]="ScreenshotTransitionEnd",e[e.LoadConfigurationStarted=63]="LoadConfigurationStarted",e[e.LoadConfigurationFinished=64]="LoadConfigurationFinished",e[e.MediaDownload=65]="MediaDownload",e[e.MaxTypeValue=66]="MaxTypeValue"}(r||(r={}))},11208:function(e,t,n){"use strict";var r;n.d(t,{B:function(){return r}}),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Finished=2]="Finished"}(r||(r={}))},5771:function(e,t,n){"use strict";var r;n.d(t,{U:function(){return r}}),function(e){e[e.Idle=0]="Idle",e[e.Loading=1]="Loading",e[e.Loaded=2]="Loaded",e[e.Failed=3]="Failed"}(r||(r={}))},65040:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}}},77972:function(e,t,n){"use strict";n.d(t,{$:function(){return l}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(65040);function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}var l=function(e){function t(e){return(0,r.A)(this,t),n=this,i=t,s=[e],i=(0,o.A)(i),(0,a.A)(n,c()?Reflect.construct(i,s||[],(0,o.A)(n).constructor):i.apply(n,s));var n,i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"load",value:function(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=u.l.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",c,!1),u.l.add(e,this),t&&t(this),i.manager.itemEnd(e)}function c(t){o.removeEventListener("load",s,!1),o.removeEventListener("error",c,!1),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}return o.addEventListener("load",s,!1),o.addEventListener("error",c,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o}}])}(n(21997).a)},21997:function(e,t,n){"use strict";n.d(t,{a:function(){return o}});var r=n(23029),i=n(92901);n(26099),n(3362);var a=new function(e,t,n){var r=this,i=!1,a=0,o=0,s=void 0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===i&&void 0!==r.onStart&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this}},o=function(){return(0,i.A)((function e(t){(0,r.A)(this,e),this.manager=void 0!==t?t:a,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}),[{key:"load",value:function(){}},{key:"loadAsync",value:function(e,t){var n=this;return new Promise((function(r,i){n.load(e,r,t,i)}))}},{key:"parse",value:function(){}},{key:"setCrossOrigin",value:function(e){return this.crossOrigin=e,this}},{key:"setWithCredentials",value:function(e){return this.withCredentials=e,this}},{key:"setPath",value:function(e){return this.path=e,this}},{key:"setResourcePath",value:function(e){return this.resourcePath=e,this}},{key:"setRequestHeader",value:function(e){return this.requestHeader=e,this}}])}()},73380:function(e,t,n){"use strict";n.d(t,{N:function(){return s}});var r=n(23029),i=n(92901),a=n(64467),o=(n(48718),n(47928)),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.P(1/0,1/0,1/0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new o.P(-1/0,-1/0,-1/0);(0,r.A)(this,e),(0,a.A)(this,"min",void 0),(0,a.A)(this,"max",void 0),this.min=t,this.max=n}return(0,i.A)(e,[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromArray",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,u=e.length;s<u;s+=3){var c=e[s],l=e[s+1],h=e[s+2];c<t&&(t=c),l<n&&(n=l),h<r&&(r=h),c>i&&(i=c),l>a&&(a=l),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this}},{key:"setFromBufferAttribute",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,u=e.count;s<u;s++){var c=e.getX(s),l=e.getY(s),h=e.getZ(s);c<t&&(t=c),l<n&&(n=l),h<r&&(r=h),c>i&&(i=c),l>a&&(a=l),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}},{key:"setFromCenterAndSize",value:function(t,n){var r=e._vector.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}},{key:"clone",value:function(){return(new e).copy(this)}},{key:"copy",value:function(e){return this.min.copy(e.min),this.max.copy(e.max),this}},{key:"makeEmpty",value:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}},{key:"isEmpty",value:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}},{key:"getCenter",value:function(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}},{key:"getSize",value:function(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}},{key:"expandByPoint",value:function(e){return this.min.min(e),this.max.max(e),this}},{key:"expandByVector",value:function(e){return this.min.sub(e),this.max.add(e),this}},{key:"expandByScalar",value:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this}},{key:"containsPoint",value:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}},{key:"containsBox",value:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}},{key:"getParameter",value:function(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}},{key:"intersectsBox",value:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}},{key:"intersectsPlane",value:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}},{key:"clampPoint",value:function(e,t){return t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(t){return e._vector.copy(t).clamp(this.min,this.max).sub(t).length()}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(t){return this.isEmpty()||(e._points[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e._points[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e._points[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e._points[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e._points[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e._points[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e._points[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e._points[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(e._points)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}])}();(0,a.A)(s,"_vector",new o.P),(0,a.A)(s,"_points",[new o.P,new o.P,new o.P,new o.P,new o.P,new o.P,new o.P,new o.P])},22098:function(e,t,n){"use strict";n.d(t,{v:function(){return s}});var r=n(23029),i=n(92901),a=n(64467),o=(n(28706),n(34782),n(26099),n(27495),n(38781),n(69780)),s=function(){function e(t,n,i){return(0,r.A)(this,e),(0,a.A)(this,"r",1),(0,a.A)(this,"g",1),(0,a.A)(this,"b",1),"string"==typeof t||t instanceof e||void 0===n?this.set(t):this.setRGB(t,n,i)}return(0,i.A)(e,[{key:"x",get:function(){return this.r},set:function(e){this.r=e}},{key:"y",get:function(){return this.g},set:function(e){this.g=e}},{key:"z",get:function(){return this.b},set:function(e){this.b=e}},{key:"set",value:function(t){return t instanceof e?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}},{key:"setRGB",value:function(e,t,n){return this.r=e,this.g=t,this.b=n,this}},{key:"setHSL",value:function(t,n,r){if(t=(0,o.rl)(t,1),n=(0,o.qE)(n,0,1),r=(0,o.qE)(r,0,1),0===n)this.r=this.g=this.b=r;else{var i=r<=.5?r*(1+n):r+n-r*n,a=2*r-i;this.r=e.hue2rgb(a,i,t+1/3),this.g=e.hue2rgb(a,i,t),this.b=e.hue2rgb(a,i,t-1/3)}return this}},{key:"setStyle",value:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("Color: Alpha component of ".concat(e," will be ignored."))}var n;if(n=/^((?:rgb|hsl)a?)\(([^)]*)\)/.exec(e)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[4]),this;if(r=/^\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[4]),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,u=parseInt(r[3],10)/100;return t(r[4]),this.setHSL(o,s,u)}}}else if(n=/^#([A-Fa-f\d]+)$/.exec(e)){var c=n[1],l=c.length;if(3===l)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return this}},{key:"clone",value:function(){return new e(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copyGammaToLinear",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}},{key:"copyLinearToGamma",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}},{key:"convertGammaToLinear",value:function(e){return this.copyGammaToLinear(this,e),this}},{key:"convertLinearToGamma",value:function(e){return this.copyLinearToGamma(this,e),this}},{key:"copySRGBToLinear",value:function(t){return this.r=e.SRGBToLinear(t.r),this.g=e.SRGBToLinear(t.g),this.b=e.SRGBToLinear(t.b),this}},{key:"copyLinearToSRGB",value:function(t){return this.r=e.LinearToSRGB(t.r),this.g=e.LinearToSRGB(t.g),this.b=e.LinearToSRGB(t.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){return 255*this.r<<16^255*this.g<<8^255*this.b}},{key:"getHexString",value:function(){return"#".concat(("000000"+this.getHex().toString(16)).slice(-6).toUpperCase())}},{key:"getHSL",value:function(e){var t,n,r=this.r,i=this.g,a=this.b,o=Math.max(r,i,a),s=Math.min(r,i,a),u=(s+o)/2;if(s===o)t=0,n=0;else{var c=o-s;switch(n=u<=.5?c/(o+s):c/(2-o-s),o){case r:t=(i-a)/c+(i<a?6:0);break;case i:t=(a-r)/c+2;break;case a:t=(r-i)/c+4}t/=6}return e.h=t,e.s=n,e.l=u,e}},{key:"getStyle",value:function(){return"rgb(".concat(255*this.r|0,",").concat(255*this.g|0,",").concat(255*this.b|0,")")}},{key:"offsetHSL",value:function(t,n,r){return this.getHSL(e._hslA),e._hslA.h+=t,e._hslA.s+=n,e._hslA.l+=r,this.setHSL(e._hslA.h,e._hslA.s,e._hslA.l),this}},{key:"add",value:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}},{key:"addColors",value:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}},{key:"addScalar",value:function(e){return this.r+=e,this.g+=e,this.b+=e,this}},{key:"sub",value:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}},{key:"multiply",value:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}},{key:"multiplyScalar",value:function(e){return this.r*=e,this.g*=e,this.b*=e,this}},{key:"lerp",value:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}},{key:"lerpColors",value:function(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}},{key:"lerpHSL",value:function(t,n){this.getHSL(e._hslA),t.getHSL(e._hslB);var r=(0,o.Cc)(e._hslA.h,e._hslB.h,n),i=(0,o.Cc)(e._hslA.s,e._hslB.s,n),a=(0,o.Cc)(e._hslA.l,e._hslB.l,n);return this.setHSL(r,i,a),this}},{key:"equals",value:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}},{key:"fromBufferAttribute",value:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}},{key:"toJSON",value:function(){return this.getHex()}},{key:"getAvg",value:function(){return(this.r+this.g+this.b)/3}}],[{key:"hue2rgb",value:function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}},{key:"SRGBToLinear",value:function(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}},{key:"LinearToSRGB",value:function(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}},{key:"Black",value:function(){return new e(0,0,0)}},{key:"White",value:function(){return new e(1,1,1)}},{key:"Red",value:function(){return new e(1,0,0)}},{key:"Green",value:function(){return new e(0,1,0)}},{key:"Blue",value:function(){return new e(0,0,1)}},{key:"Purple",value:function(){return new e(.5,0,.5)}},{key:"Magenta",value:function(){return new e(1,0,1)}},{key:"Yellow",value:function(){return new e(1,1,0)}},{key:"Orange",value:function(){return new e(1,.65,0)}},{key:"Gray",value:function(){return new e(.5,.5,.5)}},{key:"Teal",value:function(){return new e(0,1,1)}},{key:"Random",value:function(){return new e(Math.random(),Math.random(),Math.random())}}])}();(0,a.A)(s,"_hslA",{h:0,s:0,l:0}),(0,a.A)(s,"_hslB",{h:0,s:0,l:0})},209:function(e,t,n){"use strict";n.d(t,{O:function(){return l}});var r=n(23029),i=n(92901),a=n(64467),o=n(94695),s=n(37842),u=n(69780),c=n(27291),l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DefaultOrder;(0,r.A)(this,e),(0,a.A)(this,"onChange",new c.B),(0,a.A)(this,"_x",void 0),(0,a.A)(this,"_y",void 0),(0,a.A)(this,"_z",void 0),(0,a.A)(this,"_order",e.DefaultOrder),this._x=t,this._y=n,this._z=i,this._order=o}return(0,i.A)(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}},{key:"set",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new e(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,!1!==t&&this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],h=r[2],f=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin((0,u.qE)(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,m),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-(0,u.qE)(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-h,i),this._z=0);break;case"ZXY":this._x=Math.asin((0,u.qE)(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,m),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-(0,u.qE)(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,m),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin((0,u.qE)(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-h,i)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-(0,u.qE)(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,m),this._y=0);break;default:console.warn("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.DefaultOrder,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e._matrix.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e._matrix,n,r)}},{key:"setFromVector3",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}},{key:"reorder",value:function(t){return e._quaternion.setFromEuler(this),this.setFromQuaternion(e._quaternion,t)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.DefaultOrder,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this._x=t[0],this._y=t[1],this._z=t[2],this._order=n,!1!==r&&this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e}},{key:"toLonLat",value:function(){var e=Math.asin(this._x);return{longitude:Math.atan2(this._y,this._z),latitude:e}}},{key:"_onChangeCallback",value:function(){this.onChange.next()}}])}();(0,a.A)(l,"DefaultOrder","XYZ"),(0,a.A)(l,"RotationOrders",["XYZ","YZX","ZXY","XZY","YXZ","ZYX"]),(0,a.A)(l,"_matrix",new o.k),(0,a.A)(l,"_quaternion",new s.P)},69780:function(e,t,n){"use strict";n.d(t,{Cc:function(){return l},G4:function(){return h},H:function(){return c},pu:function(){return u},qE:function(){return o},rl:function(){return s},up:function(){return r}});var r=Math.PI/180,i=180/Math.PI,a=1e-6;function o(e,t,n){return Math.max(t,Math.min(n,e))}function s(e,t){return(e%t+t)%t}function u(e){return e*r}function c(e){return e*i}function l(e,t,n){return(1-n)*e+n*t}function h(e,t){return Math.abs(e-t)<a}},95822:function(e,t,n){"use strict";n.d(t,{d:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=function(){function e(){(0,r.A)(this,e),(0,a.A)(this,"elements",[]),this.elements=[1,0,0,0,1,0,0,0,1]}return(0,i.A)(e,[{key:"set",value:function(e,t,n,r,i,a,o,s,u){var c=this.elements;return c[0]=e,c[1]=r,c[2]=o,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=a,c[8]=u,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],u=n[1],c=n[4],l=n[7],h=n[2],f=n[5],m=n[8],p=r[0],d=r[3],v=r[6],y=r[1],g=r[4],b=r[7],A=r[2],_=r[5],M=r[8];return i[0]=a*p+o*y+s*A,i[3]=a*d+o*g+s*_,i[6]=a*v+o*b+s*M,i[1]=u*p+c*y+l*A,i[4]=u*d+c*g+l*_,i[7]=u*v+c*b+l*M,i[2]=h*p+f*y+m*A,i[5]=h*d+f*g+m*_,i[8]=h*v+f*b+m*M,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8];return t*a*c-t*o*u-n*i*c+n*o*s+r*i*u-r*a*s}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=c*a-o*u,h=o*s-c*i,f=u*i-a*s,m=t*l+n*h+r*f;if(0===m)return this.set(0,0,0,0,0,0,0,0,0);var p=1/m;return e[0]=l*p,e[1]=(r*u-c*n)*p,e[2]=(o*n-r*a)*p,e[3]=h*p,e[4]=(c*t-r*s)*p,e[5]=(r*i-o*t)*p,e[6]=f*p,e[7]=(n*s-u*t)*p,e[8]=(a*t-n*i)*p,this}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).invert().transpose()}},{key:"transposeIntoArray",value:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}},{key:"setUvTransform",value:function(e,t,n,r,i,a,o){var s=Math.cos(i),u=Math.sin(i);return this.set(n*s,n*u,-n*(s*a+u*o)+a+e,-r*u,r*s,-r*(-u*a+s*o)+o+t,0,0,1),this}},{key:"scale",value:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}},{key:"rotate",value:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],u=r[4],c=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*u,r[6]=t*o+n*c,r[1]=-n*i+t*s,r[4]=-n*a+t*u,r[7]=-n*o+t*c,this}},{key:"translate",value:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<9;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}}])}()},94695:function(e,t,n){"use strict";n.d(t,{k:function(){return u}});var r,i=n(23029),a=n(92901),o=n(64467),s=n(47928),u=function(){function e(){(0,i.A)(this,e),(0,o.A)(this,"elements",void 0),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}return(0,a.A)(e,[{key:"set",value:function(e,t,n,r,i,a,o,s,u,c,l,h,f,m,p,d){var v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=r,v[1]=i,v[5]=a,v[9]=o,v[13]=s,v[2]=u,v[6]=c,v[10]=l,v[14]=h,v[3]=f,v[7]=m,v[11]=p,v[15]=d,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}},{key:"copyPosition",value:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}},{key:"setFromMatrix3",value:function(e){var t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(t){var n=this.elements,r=t.elements,i=1/e._v1.setFromMatrixColumn(t,0).length(),a=1/e._v1.setFromMatrixColumn(t,1).length(),o=1/e._v1.setFromMatrixColumn(t,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*a,n[5]=r[5]*a,n[6]=r[6]*a,n[7]=0,n[8]=r[8]*o,n[9]=r[9]*o,n[10]=r[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),u=Math.sin(r),c=Math.cos(i),l=Math.sin(i);if("XYZ"===e.order){var h=a*c,f=a*l,m=o*c,p=o*l;t[0]=s*c,t[4]=-s*l,t[8]=u,t[1]=f+m*u,t[5]=h-p*u,t[9]=-o*s,t[2]=p-h*u,t[6]=m+f*u,t[10]=a*s}else if("YXZ"===e.order){var d=s*c,v=s*l,y=u*c,g=u*l;t[0]=d+g*o,t[4]=y*o-v,t[8]=a*u,t[1]=a*l,t[5]=a*c,t[9]=-o,t[2]=v*o-y,t[6]=g+d*o,t[10]=a*s}else if("ZXY"===e.order){var b=s*c,A=s*l,_=u*c,M=u*l;t[0]=b-M*o,t[4]=-a*l,t[8]=_+A*o,t[1]=A+_*o,t[5]=a*c,t[9]=M-b*o,t[2]=-a*u,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){var k=a*c,w=a*l,T=o*c,x=o*l;t[0]=s*c,t[4]=T*u-w,t[8]=k*u+x,t[1]=s*l,t[5]=x*u+k,t[9]=w*u-T,t[2]=-u,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var S=a*s,C=a*u,E=o*s,R=o*u;t[0]=s*c,t[4]=R-S*l,t[8]=E*l+C,t[1]=l,t[5]=a*c,t[9]=-o*c,t[2]=-u*c,t[6]=C*l+E,t[10]=S-R*l}else if("XZY"===e.order){var I=a*s,O=a*u,D=o*s,P=o*u;t[0]=s*c,t[4]=-l,t[8]=u*c,t[1]=I*l+P,t[5]=a*c,t[9]=O*l-D,t[2]=D*l-O,t[6]=o*c,t[10]=P*l+I}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(t){return this.compose(e._zero,t,e._one)}},{key:"lookAt",value:function(t,n,r){var i=this.elements;return e._z.subVectors(t,n),0===e._z.lengthSq()&&(e._z.z=1),e._z.normalize(),e._x.crossVectors(r,e._z),0===e._x.lengthSq()&&(1===Math.abs(r.z)?e._z.x+=1e-4:e._z.z+=1e-4,e._z.normalize(),e._x.crossVectors(r,e._z)),e._x.normalize(),e._y.crossVectors(e._z,e._x),i[0]=e._x.x,i[4]=e._y.x,i[8]=e._z.x,i[1]=e._x.y,i[5]=e._y.y,i[9]=e._z.y,i[2]=e._x.z,i[6]=e._y.z,i[10]=e._z.z,this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],u=n[12],c=n[1],l=n[5],h=n[9],f=n[13],m=n[2],p=n[6],d=n[10],v=n[14],y=n[3],g=n[7],b=n[11],A=n[15],_=r[0],M=r[4],k=r[8],w=r[12],T=r[1],x=r[5],S=r[9],C=r[13],E=r[2],R=r[6],I=r[10],O=r[14],D=r[3],P=r[7],B=r[11],F=r[15];return i[0]=a*_+o*T+s*E+u*D,i[4]=a*M+o*x+s*R+u*P,i[8]=a*k+o*S+s*I+u*B,i[12]=a*w+o*C+s*O+u*F,i[1]=c*_+l*T+h*E+f*D,i[5]=c*M+l*x+h*R+f*P,i[9]=c*k+l*S+h*I+f*B,i[13]=c*w+l*C+h*O+f*F,i[2]=m*_+p*T+d*E+v*D,i[6]=m*M+p*x+d*R+v*P,i[10]=m*k+p*S+d*I+v*B,i[14]=m*w+p*C+d*O+v*F,i[3]=y*_+g*T+b*E+A*D,i[7]=y*M+g*x+b*R+A*P,i[11]=y*k+g*S+b*I+A*B,i[15]=y*w+g*C+b*O+A*F,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],u=e[13],c=e[2],l=e[6],h=e[10],f=e[14];return e[3]*(+i*s*l-r*u*l-i*o*h+n*u*h+r*o*f-n*s*f)+e[7]*(+t*s*f-t*u*h+i*a*h-r*a*f+r*u*c-i*s*c)+e[11]*(+t*u*l-t*o*f-i*a*l+n*a*f+i*o*c-n*u*c)+e[15]*(-r*o*c-t*s*l+t*o*h+r*a*l-n*a*h+n*s*c)}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}},{key:"setPosition",value:function(e,t,n){var r=this.elements;return e instanceof s.P?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],f=e[11],m=e[12],p=e[13],d=e[14],v=e[15],y=l*d*u-p*h*u+p*s*f-o*d*f-l*s*v+o*h*v,g=m*h*u-c*d*u-m*s*f+a*d*f+c*s*v-a*h*v,b=c*p*u-m*l*u+m*o*f-a*p*f-c*o*v+a*l*v,A=m*l*s-c*p*s-m*o*h+a*p*h+c*o*d-a*l*d,_=t*y+n*g+r*b+i*A;if(0===_)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var M=1/_;return e[0]=y*M,e[1]=(p*h*i-l*d*i-p*r*f+n*d*f+l*r*v-n*h*v)*M,e[2]=(o*d*i-p*s*i+p*r*u-n*d*u-o*r*v+n*s*v)*M,e[3]=(l*s*i-o*h*i-l*r*u+n*h*u+o*r*f-n*s*f)*M,e[4]=g*M,e[5]=(c*d*i-m*h*i+m*r*f-t*d*f-c*r*v+t*h*v)*M,e[6]=(m*s*i-a*d*i-m*r*u+t*d*u+a*r*v-t*s*v)*M,e[7]=(a*h*i-c*s*i+c*r*u-t*h*u-a*r*f+t*s*f)*M,e[8]=b*M,e[9]=(m*l*i-c*p*i-m*n*f+t*p*f+c*n*v-t*l*v)*M,e[10]=(a*p*i-m*o*i+m*n*u-t*p*u-a*n*v+t*o*v)*M,e[11]=(c*o*i-a*l*i-c*n*u+t*l*u+a*n*f-t*o*f)*M,e[12]=A*M,e[13]=(c*p*r-m*l*r+m*n*h-t*p*h-c*n*d+t*l*d)*M,e[14]=(m*o*r-a*p*r-m*n*s+t*p*s+a*n*d-t*o*d)*M,e[15]=(a*l*r-c*o*r+c*n*s-t*l*s-a*n*h+t*o*h)*M,this}},{key:"scale",value:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}},{key:"getMaxScaleOnAxis",value:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}},{key:"makeTranslation",value:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}},{key:"makeRotationY",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,u=i*a,c=i*o;return this.set(u*a+n,u*o-r*s,u*s+r*o,0,u*o+r*s,c*o+n,c*s-r*a,0,u*s-r*o,c*s+r*a,i*s*s+n,0,0,0,0,1),this}},{key:"makeScale",value:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}},{key:"makeShear",value:function(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}},{key:"compose",value:function(e,t,n){var r=this.elements,i=t.x,a=t.y,o=t.z,s=t.w,u=i+i,c=a+a,l=o+o,h=i*u,f=i*c,m=i*l,p=a*c,d=a*l,v=o*l,y=s*u,g=s*c,b=s*l,A=n.x,_=n.y,M=n.z;return r[0]=(1-(p+v))*A,r[1]=(f+b)*A,r[2]=(m-g)*A,r[3]=0,r[4]=(f-b)*_,r[5]=(1-(h+v))*_,r[6]=(d+y)*_,r[7]=0,r[8]=(m+g)*M,r[9]=(d-y)*M,r[10]=(1-(h+p))*M,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}},{key:"decompose",value:function(t,n,r){var i=this.elements,a=e._v1.set(i[0],i[1],i[2]).length(),o=e._v1.set(i[4],i[5],i[6]).length(),s=e._v1.set(i[8],i[9],i[10]).length();this.determinant()<0&&(a=-a),t.x=i[12],t.y=i[13],t.z=i[14],e._m1.copy(this);var u=1/a,c=1/o,l=1/s;return e._m1.elements[0]*=u,e._m1.elements[1]*=u,e._m1.elements[2]*=u,e._m1.elements[4]*=c,e._m1.elements[5]*=c,e._m1.elements[6]*=c,e._m1.elements[8]*=l,e._m1.elements[9]*=l,e._m1.elements[10]*=l,n.setFromRotationMatrix(e._m1),r.x=a,r.y=o,r.z=s,this}},{key:"makePerspective",value:function(e,t,n,r,i,a){var o=this.elements,s=2*i/(t-e),u=2*i/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),h=-(a+i)/(a-i),f=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=u,o[9]=l,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=f,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}},{key:"makeOrthographic",value:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),u=1/(n-r),c=1/(a-i),l=(t+e)*s,h=(n+r)*u,f=(a+i)*c;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-l,o[1]=0,o[5]=2*u,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-f,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<16;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},{key:"toggleCoordSystem",value:function(){return this.elements[2]*=-1,this.elements[6]*=-1,this.elements[8]*=-1,this.elements[9]*=-1,this.elements[14]*=-1,this}},{key:"toggleCoordSystemAsProjection",value:function(){return this.elements[8]*=-1,this.elements[9]*=-1,this.elements[10]*=-1,this.elements[11]*=-1,this}}])}();r=u,(0,o.A)(u,"_v1",new s.P),(0,o.A)(u,"_m1",new r),(0,o.A)(u,"_zero",new s.P(0,0,0)),(0,o.A)(u,"_one",new s.P(1,1,1)),(0,o.A)(u,"_x",new s.P),(0,o.A)(u,"_y",new s.P),(0,o.A)(u,"_z",new s.P)},73050:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(23029),i=n(92901),a=n(64467),o=n(47928),s=n(95822),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o.P.Right(),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,r.A)(this,e),(0,a.A)(this,"normal",void 0),(0,a.A)(this,"constant",void 0),this.normal=t,this.constant=n}return(0,i.A)(e,[{key:"set",value:function(e,t){return this.normal.copy(e),this.constant=t,this}},{key:"setComponents",value:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(t,n,r){var i=e._vector1.subVectors(r,n).cross(e._vector2.subVectors(t,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}},{key:"copy",value:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this}},{key:"normalize",value:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(e){return this.normal.dot(e)+this.constant}},{key:"distanceToSphere",value:function(e,t){return this.distanceToPoint(e)-t}},{key:"projectPoint",value:function(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}},{key:"intersectLine",value:function(t,n,r){var i=e._vector1.subVectors(n,t),a=this.normal.dot(i);if(0===a)return 0===this.distanceToPoint(t)?r.copy(t):null;var o=-(t.dot(this.normal)+this.constant)/a;return o<0||o>1?null:r.copy(i).multiplyScalar(o).add(t)}},{key:"intersectsLine",value:function(e,t){var n=this.distanceToPoint(e),r=this.distanceToPoint(t);return n<0&&r>0||r<0&&n>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(t,n){var r=n||e._normalMatrix.getNormalMatrix(t),i=this.coplanarPoint(e._vector1).applyMatrix4(t),a=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(a),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},{key:"clone",value:function(){return(new e).copy(this)}}])}();(0,a.A)(u,"_vector1",new o.P),(0,a.A)(u,"_vector2",new o.P),(0,a.A)(u,"_normalMatrix",new s.d)},37842:function(e,t,n){"use strict";n.d(t,{P:function(){return u}});var r=n(23029),i=n(92901),a=n(64467),o=(n(45374),n(69780)),s=n(27291),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;(0,r.A)(this,e),(0,a.A)(this,"_x",void 0),(0,a.A)(this,"_y",void 0),(0,a.A)(this,"_z",void 0),(0,a.A)(this,"_w",void 0),(0,a.A)(this,"onChange",new s.B),this._x=t,this._y=n,this._z=i,this._w=o}return(0,i.A)(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}},{key:"set",value:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new e(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,!1!==t&&this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e.x,r=e.y,i=e.z,a=e.order,o=Math.cos,s=Math.sin,u=o(n/2),c=o(r/2),l=o(i/2),h=s(n/2),f=s(r/2),m=s(i/2);switch(a){case"XYZ":this._x=h*c*l+u*f*m,this._y=u*f*l-h*c*m,this._z=u*c*m+h*f*l,this._w=u*c*l-h*f*m;break;case"YXZ":this._x=h*c*l+u*f*m,this._y=u*f*l-h*c*m,this._z=u*c*m-h*f*l,this._w=u*c*l+h*f*m;break;case"ZXY":this._x=h*c*l-u*f*m,this._y=u*f*l+h*c*m,this._z=u*c*m+h*f*l,this._w=u*c*l-h*f*m;break;case"ZYX":this._x=h*c*l-u*f*m,this._y=u*f*l+h*c*m,this._z=u*c*m-h*f*l,this._w=u*c*l+h*f*m;break;case"YZX":this._x=h*c*l+u*f*m,this._y=u*f*l+h*c*m,this._z=u*c*m-h*f*l,this._w=u*c*l-h*f*m;break;case"XZY":this._x=h*c*l-u*f*m,this._y=u*f*l-h*c*m,this._z=u*c*m+h*f*l,this._w=u*c*l+h*f*m;break;default:console.warn("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],u=t[2],c=t[6],l=t[10],h=n+o+l;if(h>0){var f=.5/Math.sqrt(h+1);this._w=.25/f,this._x=(c-s)*f,this._y=(i-u)*f,this._z=(a-r)*f}else if(n>o&&n>l){var m=2*Math.sqrt(1+n-o-l);this._w=(c-s)/m,this._x=.25*m,this._y=(r+a)/m,this._z=(i+u)/m}else if(o>l){var p=2*Math.sqrt(1+o-n-l);this._w=(i-u)/p,this._x=(r+a)/p,this._y=.25*p,this._z=(s+c)/p}else{var d=2*Math.sqrt(1+l-n-o);this._w=(a-r)/d,this._x=(i+u)/d,this._y=(s+c)/d,this._z=.25*d}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,t){var n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs((0,o.qE)(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}},{key:"multiply",value:function(e){return this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,u=t._z,c=t._w;return this._x=n*c+a*o+r*u-i*s,this._y=r*c+a*s+i*o-n*u,this._z=i*c+a*u+n*s-r*o,this._w=a*c-n*o-r*s-i*u,this._onChangeCallback(),this}},{key:"slerp",value:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var u=1-t;return this._w=u*a+t*this._w,this._x=u*n+t*this._x,this._y=u*r+t*this._y,this._z=u*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),l=Math.atan2(c,o),h=Math.sin((1-t)*l)/c,f=Math.sin(t*l)/c;return this._w=a*h+this._w*f,this._x=n*h+this._x*f,this._y=r*h+this._y*f,this._z=i*h+this._z*f,this._onChangeCallback(),this}},{key:"slerpQuaternions",value:function(e,t,n){return this.copy(e).slerp(t,n)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],!1!==n&&this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}},{key:"_onChangeCallback",value:function(){this.onChange.next()}},{key:"fromSphericalCoords",value:function(e,t){var n=Math.cos(e/2),r=Math.cos(t/2),i=Math.sin(e/2),a=Math.sin(t/2);return this._x=r*n,this._y=-a*i,this._z=i*r,this._w=a*n,this}}],[{key:"slerpFlat",value:function(e,t,n,r,i,a,o){var s=n[r+0],u=n[r+1],c=n[r+2],l=n[r+3],h=i[a+0],f=i[a+1],m=i[a+2],p=i[a+3];if(0===o)return e[t+0]=s,e[t+1]=u,e[t+2]=c,void(e[t+3]=l);if(1===o)return e[t+0]=h,e[t+1]=f,e[t+2]=m,void(e[t+3]=p);if(l!==p||s!==h||u!==f||c!==m){var d=1-o,v=s*h+u*f+c*m+l*p,y=v>=0?1:-1,g=1-v*v;if(g>Number.EPSILON){var b=Math.sqrt(g),A=Math.atan2(b,v*y);d=Math.sin(d*A)/b,o=Math.sin(o*A)/b}var _=o*y;if(s=s*d+h*_,u=u*d+f*_,c=c*d+m*_,l=l*d+p*_,d===1-o){var M=1/Math.sqrt(s*s+u*u+c*c+l*l);s*=M,u*=M,c*=M,l*=M}}e[t]=s,e[t+1]=u,e[t+2]=c,e[t+3]=l}},{key:"multiplyQuaternionsFlat",value:function(e,t,n,r,i,a){var o=n[r],s=n[r+1],u=n[r+2],c=n[r+3],l=i[a],h=i[a+1],f=i[a+2],m=i[a+3];return e[t]=o*m+c*l+s*f-u*h,e[t+1]=s*m+c*h+u*l-o*f,e[t+2]=u*m+c*f+o*h-s*l,e[t+3]=c*m-o*l-s*h-u*f,e}},{key:"identity",value:function(){return(new e).identity()}}])}()},68263:function(e,t,n){"use strict";n.d(t,{I:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=(n(16280),function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,r.A)(this,e),(0,a.A)(this,"x",0),(0,a.A)(this,"y",0),this.x=t,this.y=n}return(0,i.A)(e,[{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}},{key:"set",value:function(e,t){return this.x=e,this.y=t,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: ".concat(e))}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: ".concat(e))}}},{key:"clone",value:function(){return new e(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){var e=Math.atan2(-this.y,-this.x)+Math.PI;return e}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}},{key:"fromBufferAttribute",value:function(e,t){return void 0!==(arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0)&&console.warn("Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}},{key:"rotateAround",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}}],[{key:"Zero",value:function(){return new e(0,0)}},{key:"Half",value:function(){return new e(.5,.5)}},{key:"One",value:function(){return new e(1,1)}}])}())},47928:function(e,t,n){"use strict";n.d(t,{P:function(){return l}});var r,i=n(23029),a=n(92901),o=n(64467),s=(n(16280),n(48718),n(37842)),u=n(69780),c=n(27291),l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;(0,i.A)(this,e),(0,o.A)(this,"_x",void 0),(0,o.A)(this,"_y",void 0),(0,o.A)(this,"_z",void 0),(0,o.A)(this,"onChange",new c.B),this._x=t,this._y=n,this._z=r}return(0,a.A)(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"set",value:function(e,t,n){return void 0===n&&(n=this._z),this._x=e,this._y=t,this._z=n,this._onChangeCallback(),this}},{key:"setScalar",value:function(e){return this._x=e,this._y=e,this._z=e,this._onChangeCallback(),this}},{key:"setX",value:function(e){return this._x=e,this._onChangeCallback(),this}},{key:"setY",value:function(e){return this._y=e,this._onChangeCallback(),this}},{key:"setZ",value:function(e){return this._z=e,this._onChangeCallback(),this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this._x=t;break;case 1:this._y=t;break;case 2:this._z=t;break;default:throw new Error("index is out of range: ".concat(e))}return this._onChangeCallback(),this}},{key:"getComponent",value:function(e){switch(e){case 0:return this._x;case 1:return this._y;case 2:return this._z;default:throw new Error("index is out of range: ".concat(e))}}},{key:"clone",value:function(){return new e(this._x,this._y,this._z)}},{key:"copy",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this._x=e.x,this._y=e.y,this._z=e.z,!1!==t&&this._onChangeCallback(),this}},{key:"add",value:function(e){return this._x+=e.x,this._y+=e.y,this._z+=e.z,this._onChangeCallback(),this}},{key:"addScalar",value:function(e){return this._x+=e,this._y+=e,this._z+=e,this._onChangeCallback(),this}},{key:"addVectors",value:function(e,t){return this._x=e.x+t.x,this._y=e.y+t.y,this._z=e.z+t.z,this._onChangeCallback(),this}},{key:"addScaledVector",value:function(e,t){return this._x+=e.x*t,this._y+=e.y*t,this._z+=e.z*t,this._onChangeCallback(),this}},{key:"sub",value:function(e){return this._x-=e.x,this._y-=e.y,this._z-=e.z,this._onChangeCallback(),this}},{key:"subScalar",value:function(e){return this._x-=e,this._y-=e,this._z-=e,this._onChangeCallback(),this}},{key:"subVectors",value:function(e,t){return this._x=e.x-t.x,this._y=e.y-t.y,this._z=e.z-t.z,this._onChangeCallback(),this}},{key:"multiply",value:function(e){return this._x*=e.x,this._y*=e.y,this._z*=e.z,this._onChangeCallback(),this}},{key:"multiplyScalar",value:function(e){return this._x*=e,this._y*=e,this._z*=e,this._onChangeCallback(),this}},{key:"multiplyVectors",value:function(e,t){return this._x=e.x*t.x,this._y=e.y*t.y,this._z=e.z*t.z,this._onChangeCallback(),this}},{key:"applyEuler",value:function(t){return this.applyQuaternion(e._quaternion.setFromEuler(t))}},{key:"applyAxisAngle",value:function(t,n){return this.applyQuaternion(e._quaternion.setFromAxisAngle(t,n))}},{key:"applyMatrix3",value:function(e){var t=this._x,n=this._y,r=this._z,i=e.elements;return this._x=i[0]*t+i[3]*n+i[6]*r,this._y=i[1]*t+i[4]*n+i[7]*r,this._z=i[2]*t+i[5]*n+i[8]*r,this._onChangeCallback(),this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var t=this._x,n=this._y,r=this._z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this._x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this._y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this._z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this._onChangeCallback(),this}},{key:"applyQuaternion",value:function(e){var t=this._x,n=this._y,r=this._z,i=e.x,a=e.y,o=e.z,s=e.w,u=s*t+a*r-o*n,c=s*n+o*t-i*r,l=s*r+i*n-a*t,h=-i*t-a*n-o*r;return this._x=u*s+h*-i+c*-o-l*-a,this._y=c*s+h*-a+l*-i-u*-o,this._z=l*s+h*-o+u*-a-c*-i,this._onChangeCallback(),this}},{key:"project",value:function(e,t){return this.applyMatrix4(e).applyMatrix4(t)}},{key:"unproject",value:function(e,t){return this.applyMatrix4(t).applyMatrix4(e)}},{key:"transformDirection",value:function(e){var t=this._x,n=this._y,r=this._z,i=e.elements;return this._x=i[0]*t+i[4]*n+i[8]*r,this._y=i[1]*t+i[5]*n+i[9]*r,this._z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}},{key:"divide",value:function(e){return this._x/=e.x,this._y/=e.y,this._z/=e.z,this._onChangeCallback(),this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(e){return this._x=Math.min(this._x,e.x),this._y=Math.min(this._y,e.y),this._z=Math.min(this._z,e.z),this._onChangeCallback(),this}},{key:"max",value:function(e){return this._x=Math.max(this._x,e.x),this._y=Math.max(this._y,e.y),this._z=Math.max(this._z,e.z),this._onChangeCallback(),this}},{key:"clamp",value:function(e,t){return this._x=Math.max(e.x,Math.min(t.x,this.x)),this._y=Math.max(e.y,Math.min(t.y,this.y)),this._z=Math.max(e.z,Math.min(t.z,this.z)),this._onChangeCallback(),this}},{key:"clampScalar",value:function(e,t){return this._x=Math.max(e,Math.min(t,this._x)),this._y=Math.max(e,Math.min(t,this._y)),this._z=Math.max(e,Math.min(t,this._z)),this._onChangeCallback(),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this._x=Math.floor(this._x),this._y=Math.floor(this._y),this._z=Math.floor(this._z),this._onChangeCallback(),this}},{key:"ceil",value:function(){return this._x=Math.ceil(this._x),this._y=Math.ceil(this._y),this._z=Math.ceil(this._z),this._onChangeCallback(),this}},{key:"round",value:function(){return this._x=Math.round(this._x),this._y=Math.round(this._y),this._z=Math.round(this._z),this._onChangeCallback(),this}},{key:"roundToZero",value:function(){return this._x=this._x<0?Math.ceil(this._x):Math.floor(this._x),this._y=this._y<0?Math.ceil(this._y):Math.floor(this._y),this._z=this._z<0?Math.ceil(this._z):Math.floor(this._z),this._onChangeCallback(),this}},{key:"negate",value:function(){return this._x=-this._x,this._y=-this._y,this._z=-this._z,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e.x+this._y*e.y+this._z*e.z}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)}},{key:"manhattanLength",value:function(){return Math.abs(this._x)+Math.abs(this._y)+Math.abs(this._z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this._x+=(e.x-this._x)*t,this._y+=(e.y-this._y)*t,this._z+=(e.z-this._z)*t,this._onChangeCallback(),this}},{key:"lerpVectors",value:function(e,t,n){return this._x=e.x+(t.x-e.x)*n,this._y=e.y+(t.y-e.y)*n,this._z=e.z+(t.z-e.z)*n,this._onChangeCallback(),this}},{key:"cross",value:function(e){return this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this._x=r*s-i*o,this._y=i*a-n*s,this._z=n*o-r*a,this._onChangeCallback(),this}},{key:"projectOnVector",value:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}},{key:"projectOnPlane",value:function(t){return e._vector.copy(this).projectOnVector(t),this.sub(e._vector)}},{key:"reflect",value:function(t){return this.sub(e._vector.copy(t).multiplyScalar(2*this.dot(t)))}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos((0,u.qE)(n,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this._x-e.x,n=this._y-e.y,r=this._z-e.z;return t*t+n*n+r*r}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this._x-e.x)+Math.abs(this._y-e.y)+Math.abs(this._z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,t,n){var r=Math.sin(t)*e;return this._x=r*Math.sin(n),this._y=Math.cos(t)*e,this._z=r*Math.cos(n),this._onChangeCallback(),this}},{key:"setFromCylindricalCoords",value:function(e,t,n){return this._x=e*Math.sin(t),this._y=n,this._z=e*Math.cos(t),this._onChangeCallback(),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this._x=t[12],this._y=t[13],this._z=t[14],this._onChangeCallback(),this}},{key:"setFromMatrixScale",value:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this._x=t,this._y=n,this._z=r,this._onChangeCallback(),this}},{key:"setFromMatrixColumn",value:function(e,t){return this.fromArray(e.elements,4*t)}},{key:"setFromMatrix3Column",value:function(e,t){return this.fromArray(e.elements,3*t)}},{key:"equals",value:function(e){return e.x===this._x&&e.y===this._y&&e.z===this._z}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._onChangeCallback(),this}},{key:"toggleCoordSystem",value:function(){return this.z*=-1,this}},{key:"random",value:function(){return this._x=Math.random(),this._y=Math.random(),this._z=Math.random(),this._onChangeCallback(),this}},{key:"_onChangeCallback",value:function(){this.onChange.next()}}],[{key:"Zero",value:function(){return new e(0,0,0)}},{key:"One",value:function(){return new e(1,1,1)}},{key:"Forward",value:function(){return new e(0,0,-1)}},{key:"Back",value:function(){return new e(0,0,1)}},{key:"Up",value:function(){return new e(0,1,0)}},{key:"Down",value:function(){return new e(0,-1,0)}},{key:"Left",value:function(){return new e(-1,0,0)}},{key:"Right",value:function(){return new e(1,0,0)}},{key:"AxisX",value:function(){return new e(1,0,0)}},{key:"AxisY",value:function(){return new e(0,1,0)}},{key:"AxisZ",value:function(){return new e(0,0,1)}}])}();r=l,(0,o.A)(l,"_quaternion",new s.P),(0,o.A)(l,"_vector",new r)},90597:function(e,t,n){"use strict";n.d(t,{I:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=(n(16280),function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;(0,r.A)(this,e),(0,a.A)(this,"x",0),(0,a.A)(this,"y",0),(0,a.A)(this,"z",0),(0,a.A)(this,"w",0),this.x=t,this.y=n,this.z=i,this.w=o}return(0,i.A)(e,[{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}},{key:"set",value:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: ".concat(e))}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: ".concat(e))}}},{key:"clone",value:function(){return new e(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,n,r,i,a=.01,o=.1,s=e.elements,u=s[0],c=s[4],l=s[8],h=s[1],f=s[5],m=s[9],p=s[2],d=s[6],v=s[10];if(Math.abs(c-h)<a&&Math.abs(l-p)<a&&Math.abs(m-d)<a){if(Math.abs(c+h)<o&&Math.abs(l+p)<o&&Math.abs(m+d)<o&&Math.abs(u+f+v-3)<o)return this.set(1,0,0,0),this;t=Math.PI;var y=(u+1)/2,g=(f+1)/2,b=(v+1)/2,A=(c+h)/4,_=(l+p)/4,M=(m+d)/4;return y>g&&y>b?y<a?(n=0,r=.707106781,i=.707106781):(r=A/(n=Math.sqrt(y)),i=_/n):g>b?g<a?(n=.707106781,r=0,i=.707106781):(n=A/(r=Math.sqrt(g)),i=M/r):b<a?(n=.707106781,r=.707106781,i=0):(n=_/(i=Math.sqrt(b)),r=M/i),this.set(n,r,i,t),this}var k=Math.sqrt((d-m)*(d-m)+(l-p)*(l-p)+(h-c)*(h-c));return Math.abs(k)<.001&&(k=1),this.x=(d-m)/k,this.y=(l-p)/k,this.z=(h-c)/k,this.w=Math.acos((u+f+v-1)/2),this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}],[{key:"Zero",value:function(){return new e(0,0,0,0)}},{key:"One",value:function(){return new e(1,1,1,1)}}])}())},1208:function(e,t,n){"use strict";n.d(t,{X:function(){return h},c:function(){return r}});var r,i=n(23029),a=n(92901),o=n(64467),s=n(68263),u=n(47928),c=n(90597),l=n(37842);!function(e){e[e.Linear=0]="Linear",e[e.EaseIn=1]="EaseIn",e[e.EaseOut=2]="EaseOut",e[e.EaseInOut=3]="EaseInOut",e[e.Bezier=4]="Bezier",e[e.Parametric=5]="Parametric"}(r||(r={}));var h=function(){return(0,a.A)((function e(t,n,a){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:r.Linear,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];(0,i.A)(this,e),(0,o.A)(this,"mStart",void 0),(0,o.A)(this,"mEnd",void 0),(0,o.A)(this,"mTarget",void 0),(0,o.A)(this,"mDuration",0),(0,o.A)(this,"mDelay",0),(0,o.A)(this,"mAutoStart",!1),(0,o.A)(this,"mEffect",void 0),(0,o.A)(this,"mStarted",!1),(0,o.A)(this,"mFinished",!1),(0,o.A)(this,"mDelayTimer",0),(0,o.A)(this,"mDelta",0),this.mStart=n,this.mEnd=a,this.mTarget=t,this.mDuration=s,this.mEffect=u,this.mDelay=c,this.mAutoStart=l,this.mAutoStart&&this.start()}),[{key:"update",value:function(e){if(!this.mStarted)return this.mStart;if(this.mFinished)return this.mEnd;if(this.mDelayTimer<this.mDelay)return this.mDelayTimer+=e,this.mStart;if(this.mDelta+=e,this.mDelta>=this.mDuration)return this.mFinished=!0,this.updateTarget(1),this.mEnd;var t=this.mDelta/this.mDuration;switch(this.mEffect){case r.EaseIn:t=Math.sin(t*Math.PI*.5);break;case r.EaseOut:t=Math.cos(t*(.5*Math.PI)+Math.PI)+1;break;case r.EaseInOut:t=.5*Math.sin(t*Math.PI-.5*Math.PI)+.5;break;case r.Bezier:t=t*t*(3-2*t);break;case r.Parametric:var n=t*t;t=n/(2*(n-t)+1);case r.Linear:}return this.updateTarget(t)}},{key:"start",value:function(){this.mStarted=!0,this.mDelayTimer=0,this.mDelta=0,this.mFinished=!1}},{key:"finish",value:function(){this.mFinished=!0,this.updateTarget(1)}},{key:"isStarted",value:function(){return this.mStarted&&!this.mFinished}},{key:"isFinished",value:function(){return this.mFinished}},{key:"updateTarget",value:function(e){return this.mTarget instanceof l.P&&this.mStart instanceof l.P&&this.mEnd instanceof l.P?this.mTarget.slerpQuaternions(this.mStart,this.mEnd,e):this.mTarget instanceof u.P&&this.mStart instanceof u.P&&this.mEnd instanceof u.P||this.mTarget instanceof s.I&&this.mStart instanceof s.I&&this.mEnd instanceof s.I||this.mTarget instanceof c.I&&this.mStart instanceof c.I&&this.mEnd instanceof c.I?this.mTarget.lerpVectors(this.mStart,this.mEnd,e):"number"==typeof this.mTarget&&"number"==typeof this.mStart&&"number"==typeof this.mEnd&&(this.mTarget=this.mStart+(this.mEnd-this.mStart)*e),this.mTarget}}])}()},43423:function(e,t,n){"use strict";n.d(t,{$:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(96264);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,h()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"mComponentName",void 0),(0,u.A)(n,"mParentObject",null),(0,u.A)(n,"mDisposed",!1),n.mComponentName=e,n.OnCreate(),n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getComponentName",value:function(){return this.mComponentName}},{key:"getParentObject",value:function(){return this.mParentObject}},{key:"_setObject",value:function(e){this.mParentObject=e}},{key:"OnCreate",value:function(){}},{key:"OnAttached",value:function(){}},{key:"OnDetached",value:function(){}},{key:"OnDestroy",value:function(){}},{key:"dispose",value:function(){this.mDisposed||(this.OnDestroy(),this.mDisposed=!0)}},{key:"isDisposed",value:function(){return this.mDisposed}}])}(l.R);(0,u.A)(f,"TypeRTTI",new c.O("Component",l.R.TypeRTTI))},28001:function(e,t,n){"use strict";n.d(t,{b:function(){return p}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=(n(28706),n(2008),n(50113),n(48980),n(44114),n(54554),n(26099),n(17333),n(3064),n(9920),n(98992),n(54520),n(72577),n(3949),n(23500),n(44889)),l=n(96264),h=n(43423),f=n(63805);function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(m=function(){return!!e})()}var p=function(e){function t(){var e,n,i,s;(0,r.A)(this,t);for(var c=arguments.length,l=new Array(c),h=0;h<c;h++)l[h]=arguments[h];return n=this,i=t,s=[].concat(l),i=(0,o.A)(i),e=(0,a.A)(n,m()?Reflect.construct(i,s||[],(0,o.A)(n).constructor):i.apply(n,s)),(0,u.A)(e,"mComponents",[]),e}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"catchUnhandledMessage",value:function(e){this.dispatchMessageToComponents(e)}},{key:"dispatchMessageToComponents",value:function(e){this.mComponents.forEach((function(t){t.dispatchMessage(e)}))}},{key:"addComponent",value:function(e){return e.getParentObject()?(f.UX.error("Component is already assigned"),!1):e.isDisposed()?(f.UX.error("Cannot attach disposed component."),!1):e.isAttachable(this)?this.getComponent(e.getComponentName())?(f.UX.error("Object already contains component:",e.getComponentName()),!1):(e._setObject(this),this.mComponents.push(e),e.OnAttached(),!0):(f.UX.error("can not attach component ",e.getType().getTypeName()," to object ",this.getType().getTypeName()),!1)}},{key:"removeComponent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.mComponents.findIndex((function(t){return t.getComponentName()===e}));if(n>=0){var r=this.mComponents[n];return r.OnDetached(),r._setObject(null),this.mComponents.splice(n,1),t&&r.dispose(),!0}return!1}},{key:"removeComponents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getComponents(e).forEach((function(e){t.removeComponent(e.getComponentName(),n)}))}},{key:"removeAllComponents",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.removeComponents(h.$.TypeRTTI,e)}},{key:"getComponent",value:function(e){return this.mComponents.find((function(t){return t.getComponentName()===e}))}},{key:"getComponents",value:function(e){return this.mComponents.filter((function(t){return!e||t.isDerivedTypeOf(e)}))}}])}(l.R);(0,u.A)(p,"TypeRTTI",new c.O("BaseObject",l.R.TypeRTTI))},81226:function(e,t,n){"use strict";n.d(t,{z:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=function(){return(0,i.A)((function e(){(0,r.A)(this,e),(0,a.A)(this,"mMask",void 0),this.mMask=1}),[{key:"mask",get:function(){return this.mMask}},{key:"enable",value:function(e){return this.mMask|=1<<e,this}},{key:"disable",value:function(e){return this.mMask&=~(1<<e),this}},{key:"set",value:function(e){return this.mMask=1<<e>>>0,this}},{key:"test",value:function(e){return!!(this.mMask&e.mMask)}},{key:"isEnabled",value:function(e){return!!(this.mMask&1<<e)}},{key:"toggle",value:function(e){return this.mMask^=1<<e,this}},{key:"enableAll",value:function(){return this.mMask=-1,this}},{key:"disableAll",value:function(){return this.mMask=0,this}},{key:"enableByLayer",value:function(e){return this.mMask|=e.mMask,this}},{key:"setMask",value:function(e){return this.mMask=e,this}}])}()},96264:function(e,t,n){"use strict";n.d(t,{R:function(){return m}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=(n(28706),n(44889)),l=n(97869),h=n(63805);function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}var m=function(e){function t(){var e,n,i,s;(0,r.A)(this,t);for(var c=arguments.length,l=new Array(c),h=0;h<c;h++)l[h]=arguments[h];return n=this,i=t,s=[].concat(l),i=(0,o.A)(i),e=(0,a.A)(n,f()?Reflect.construct(i,s||[],(0,o.A)(n).constructor):i.apply(n,s)),(0,u.A)(e,"mMessageHandlers",{}),e}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"registerMessageHandler",value:function(e,t){this.handlesMessageType(e)?h.UX.error("Failed to re-register message handler:",e.getTypeName()):this.mMessageHandlers[e.getTypeName()]=t}},{key:"unregisterFromAllMessages",value:function(){this.mMessageHandlers={}}},{key:"unregisterMessageHandler",value:function(e){this.handlesMessageType(e)&&delete this.mMessageHandlers[e.getTypeName()]}},{key:"dispatchMessage",value:function(e){e.isDismissed()||(this.handlesMessageType(e.getType())?(0,this.mMessageHandlers[e.getType().getTypeName()])(e):this.catchUnhandledMessage(e))}},{key:"catchUnhandledMessage",value:function(e){}},{key:"handlesMessageType",value:function(e){return e.getTypeName()in this.mMessageHandlers}}])}(l.p);(0,u.A)(m,"TypeRTTI",new c.O("BaseMessageHandler",l.p.TypeRTTI))},1393:function(e,t,n){"use strict";n.d(t,{Q:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=(n(28706),n(44889)),l=n(97869);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(){var e,n,i,s;(0,r.A)(this,t);for(var c=arguments.length,l=new Array(c),f=0;f<c;f++)l[f]=arguments[f];return n=this,i=t,s=[].concat(l),i=(0,o.A)(i),e=(0,a.A)(n,h()?Reflect.construct(i,s||[],(0,o.A)(n).constructor):i.apply(n,s)),(0,u.A)(e,"mDismissed",!1),e}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"dismiss",value:function(){this.mDismissed=!0}},{key:"isDismissed",value:function(){return this.mDismissed}}])}(l.p);(0,u.A)(f,"TypeRTTI",new c.O("Message",l.p.TypeRTTI))},97869:function(e,t,n){"use strict";n.d(t,{p:function(){return l}});var r=n(23029),i=n(92901),a=n(64467),o=(n(28706),n(44889)),s=n(49571),u=n(40537),c=n(63805),l=function(){function e(){(0,r.A)(this,e),(0,a.A)(this,"mObjectId",void 0),(0,a.A)(this,"mObjectUUID",void 0),this.mObjectId=++e.ObjectIdCount,this.mObjectUUID=s.V.guid()}return(0,i.A)(e,[{key:"getType",value:function(){return e.TypeRTTI}},{key:"id",get:function(){return this.getObjectId()}},{key:"uuid",get:function(){return this.mObjectUUID}},{key:"getObjectId",value:function(){return this.mObjectId}},{key:"getObjectUUID",value:function(){return this.mObjectUUID}},{key:"_setObjectUUID",value:function(e){!(0,u.isNullOrUndefined)(e)&&"null"!==e&&e.length>16?this.mObjectUUID=e:c.UX.warn("tying to set object '".concat(this.mObjectId,"' uuid to invalid value: ").concat(e))}},{key:"isTypeName",value:function(e){return this.getType().isTypeName(e)}},{key:"isDerivedOfTypeName",value:function(e){return this.getType().isDerivedOfTypeName(e)}},{key:"isTypeOf",value:function(e){return this.getType().isTypeOf(e)}},{key:"isDerivedTypeOf",value:function(e){return this.getType().isDerivedTypeOf(e)}}])}();(0,a.A)(l,"TypeRTTI",new o.O("RttiObject")),(0,a.A)(l,"ObjectIdCount",0)},44889:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=function(){return(0,i.A)((function e(t,n){(0,r.A)(this,e),(0,a.A)(this,"mTypeName",void 0),(0,a.A)(this,"mParentClass",void 0),this.mTypeName=t,this.mParentClass=n}),[{key:"getTypeName",value:function(){return this.mTypeName}},{key:"isTypeName",value:function(e){return e===this.mTypeName}},{key:"isDerivedOfTypeName",value:function(e){return!!this.isTypeName(e)||void 0!==this.getParent()&&this.getParent().isDerivedOfTypeName(e)}},{key:"isTypeOf",value:function(e){return this.mTypeName===e.getTypeName()}},{key:"isDerivedTypeOf",value:function(e){return!!this.isTypeOf(e)||void 0!==this.getParent()&&this.getParent().isDerivedTypeOf(e)}},{key:"getParent",value:function(){return this.mParentClass}}])}()},52550:function(e,t,n){"use strict";n.d(t,{d:function(){return h}});var r=n(23029),i=n(92901),a=n(64467),o=n(47928),s=n(37842),u=n(209),c=n(94695),l=n(27291),h=function(){function e(){var t=this;(0,r.A)(this,e),(0,a.A)(this,"mPosition",void 0),(0,a.A)(this,"mQuaternion",void 0),(0,a.A)(this,"mRotation",void 0),(0,a.A)(this,"mScale",void 0),(0,a.A)(this,"mMatrixLocal",void 0),(0,a.A)(this,"mMatrixCache",void 0),(0,a.A)(this,"mMatrixWorld",void 0),(0,a.A)(this,"matrixNeedsUpdate",!0),(0,a.A)(this,"matrixWorldNeedsUpdate",!0),(0,a.A)(this,"onChange",new l.B),this.mPosition=o.P.Zero(),this.mQuaternion=s.P.identity(),this.mRotation=new u.O,this.mScale=o.P.One(),this.mMatrixLocal=new c.k,this.mMatrixCache=new c.k,this.mMatrixWorld=new c.k,this.mPosition.onChange.subscribe((function(){t.matrixNeedsUpdate=!0,t.onChangeCallback()})),this.mRotation.onChange.subscribe((function(){t.mQuaternion.setFromEuler(t.mRotation,!1),t.matrixNeedsUpdate=!0,t.onChangeCallback()})),this.mQuaternion.onChange.subscribe((function(){t.mRotation.setFromQuaternion(t.mQuaternion,void 0,!1),t.matrixNeedsUpdate=!0,t.onChangeCallback()})),this.mScale.onChange.subscribe((function(){t.matrixNeedsUpdate=!0,t.onChangeCallback()}))}return(0,i.A)(e,[{key:"markDirty",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrixNeedsUpdate=!!e||this.matrixNeedsUpdate,this.matrixWorldNeedsUpdate=!!t||this.matrixWorldNeedsUpdate}},{key:"dispose",value:function(){this.mPosition.onChange.unsubscribe(),this.mRotation.onChange.unsubscribe(),this.mQuaternion.onChange.unsubscribe(),this.mScale.onChange.unsubscribe(),this.onChange.unsubscribe()}},{key:"position",get:function(){return this.mPosition},set:function(e){this.mPosition.copy(e)}},{key:"rotation",get:function(){return this.mRotation},set:function(e){this.mRotation.copy(e)}},{key:"quaternion",get:function(){return this.mQuaternion},set:function(e){this.mQuaternion.copy(e)}},{key:"scale",get:function(){return this.mScale},set:function(e){this.mScale.copy(e)}},{key:"matrix",get:function(){return this.mMatrixLocal},set:function(e){this.mMatrixLocal.copy(e)}},{key:"matrixCache",get:function(){return this.mMatrixCache},set:function(e){this.mMatrixCache.copy(e),this.matrixWorldNeedsUpdate=!0}},{key:"matrixWorld",get:function(){return this.mMatrixWorld},set:function(e){this.mMatrixWorld.copy(e)}},{key:"updateMatrix",value:function(){(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||this.matrixNeedsUpdate)&&(this.mMatrixLocal.compose(this.mPosition,this.mQuaternion,this.mScale),this.matrixWorldNeedsUpdate=!0),this.mMatrixCache.copy(this.mMatrixLocal)}},{key:"updateMatrixWorld",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!(!this.matrixWorldNeedsUpdate&&!t)&&(e?this.mMatrixWorld.multiplyMatrices(e,this.mMatrixCache):this.mMatrixWorld.copy(this.mMatrixCache),this.matrixWorldNeedsUpdate=!1,!0)}},{key:"copy",value:function(e){return this.position.copy(e.position),this.rotation.copy(e.rotation),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixNeedsUpdate=e.matrixNeedsUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this}},{key:"clone",value:function(){return(new e).copy(this)}},{key:"getWorldPosition",value:function(e){e.setFromMatrixPosition(this.mMatrixWorld)}},{key:"getWorldQuaternion",value:function(t){this.matrixWorld.decompose(e._position,t,e._scale)}},{key:"getWorldScale",value:function(t){this.matrixWorld.decompose(e._position,e._quaternion,t)}},{key:"getWorldDirection",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.matrixWorld.elements;e.set(n[8],n[9],n[10]).normalize(),t&&e.multiplyScalar(-1)}},{key:"onChangeCallback",value:function(){this.onChange.next()}}],[{key:"create",value:function(t,n,r){var i=new e;return i.position.copy(t),i.quaternion.copy(n),i.scale.copy(r),i}}])}();(0,a.A)(h,"_position",new o.P),(0,a.A)(h,"_quaternion",new s.P),(0,a.A)(h,"_scale",new o.P)},71197:function(e,t,n){"use strict";var r;n.d(t,{k:function(){return r}}),function(e){e[e.Dynamic=1]="Dynamic",e[e.Static=2]="Static",e[e.Kinematic=3]="Kinematic"}(r||(r={}))},99720:function(e,t,n){"use strict";var r;n.d(t,{B:function(){return r}}),function(e){e[e.Sphere=0]="Sphere",e[e.Box=1]="Box"}(r||(r={}))},11345:function(e,t,n){"use strict";n.d(t,{F:function(){return M}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(90991),u=n(85501),c=n(64467),l=n(85690),h=(n(23792),n(44114),n(54743),n(26099),n(34594),n(61740),n(48140),n(81630),n(72170),n(75044),n(69539),n(31694),n(89955),n(21903),n(91134),n(33206),n(44496),n(66651),n(12887),n(19369),n(66812),n(8995),n(31575),n(36072),n(88747),n(28845),n(29423),n(57301),n(373),n(86614),n(41405),n(37467),n(44732),n(33684),n(79577),n(26280),n(27913),n(47801),n(47350),n(23241),n(67302),n(55871),n(41840)),f=n(47928),m=n(92981),p=n(71699),d=n(70123),v=function(){return(0,i.A)((function e(){(0,r.A)(this,e)}),null,[{key:"Create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;arguments.length>7&&void 0!==arguments[7]||m.k.Front;t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));for(var s=Math.min(a+o,Math.PI),u=0,c=[],l=new f.P,v=new f.P,y=[],g=[],b=[],A=[],_=0;_<=n;_++){var M=[],k=_/n,w=0;0==_&&0==a?w=.5/t:_==n&&s==Math.PI&&(w=-.5/t);for(var T=0;T<=t;T++){var x=T/t;l.x=-e*Math.cos(r+x*i)*Math.sin(a+k*o),l.y=e*Math.cos(a+k*o),l.z=e*Math.sin(r+x*i)*Math.sin(a+k*o),g.push(l.x,l.y,l.z),v.copy(l).normalize(),b.push(v.x,v.y,v.z),A.push(x+w,1-k),M.push(u++)}c.push(M)}for(var S=0;S<n;S++)for(var C=0;C<t;C++){var E=c[S][C+1],R=c[S][C],I=c[S+1][C],O=c[S+1][C+1];(0!==S||a>0)&&y.push(E,R,O),(S!==n-1||s<Math.PI)&&y.push(R,I,O)}var D=h.K.renderer().getRenderEngine().createBuffer();return D.setIndexData(new p.T(new Uint32Array(y),1)),D.setVertexData(d.P.POSITION,new p.T(new Float32Array(g),3)),D.setVertexData(d.P.NORMAL,new p.T(new Float32Array(b),3)),D.setVertexData(d.P.UV,new p.T(new Float32Array(A),2)),D}}])}(),y=(n(9920),n(98992),n(3949),n(23500),function(){return(0,i.A)((function e(){(0,r.A)(this,e)}),null,[{key:"Create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;arguments.length>6&&void 0!==arguments[6]||m.k.Front;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);var o=[],s=[],u=[],c=[],l=0;[{u:2,v:1,w:0,udir:-1,vdir:-1,width:n,height:t,depth:e,gridX:a,gridY:i},{u:2,v:1,w:0,udir:1,vdir:-1,width:n,height:t,depth:-e,gridX:a,gridY:i},{u:0,v:2,w:1,udir:1,vdir:1,width:e,height:n,depth:t,gridX:r,gridY:a},{u:0,v:2,w:1,udir:1,vdir:-1,width:e,height:n,depth:-t,gridX:r,gridY:a},{u:0,v:1,w:2,udir:1,vdir:-1,width:e,height:t,depth:n,gridX:r,gridY:i},{u:0,v:1,w:2,udir:-1,vdir:-1,width:e,height:t,depth:-n,gridX:r,gridY:i}].forEach((function(e){for(var t=e.width/e.gridX,n=e.height/e.gridY,r=e.width/2,i=e.height/2,a=e.depth/2,h=e.gridX+1,m=e.gridY+1,p=0,d=new f.P,v=0;v<m;v++)for(var y=v*n-i,g=0;g<h;g++){var b=g*t-r;d.setComponent(e.u,b*e.udir),d.setComponent(e.v,y*e.vdir),d.setComponent(e.w,a),s.push(d.x,d.y,d.z),d.setComponent(e.u,0),d.setComponent(e.v,0),d.setComponent(e.w,e.depth>0?1:-1),u.push(d.x,d.y,d.z),c.push(g/e.gridX),c.push(1-v/e.gridY),p+=1}for(var A=0;A<e.gridY;A++)for(var _=0;_<e.gridX;_++){var M=l+_+h*A,k=l+_+h*(A+1),w=l+(_+1)+h*(A+1),T=l+(_+1)+h*A;o.push(M,k,T),o.push(k,w,T)}l+=p}));var v=h.K.renderer().getRenderEngine().createBuffer();return v.setIndexData(new p.T(new Uint32Array(o),1)),v.setVertexData(d.P.POSITION,new p.T(new Float32Array(s),3)),v.setVertexData(d.P.NORMAL,new p.T(new Float32Array(u),3)),v.setVertexData(d.P.UV,new p.T(new Float32Array(c),2)),v}}])}()),g=n(22098),b=n(44889),A=n(99720);function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_=function(){return!!e})()}var M=function(e){function t(e){var n,i,s,u;(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,_()?Reflect.construct(s,u||[],(0,o.A)(i).constructor):s.apply(i,u)),(0,c.A)(n,"mBody",void 0),n.mName="body-helper",n.mBody=e,n.layers.enable(2),n.layers.enable(4),n.layers.enable(5),n.layers.enable(6),n.pickable=!1,n.castShadow=!1,n.receiveShadow=!1,n.updateChanges();var l=h.K.renderer().getRenderEngine().createMaterialPBR("body-helper");return l.setUnlit(!0),l.setDiffuseColor(g.v.Black()),l.setEmissiveColor(g.v.Yellow()),l.setWireframe(!0),n.setMaterial(l),n}return(0,u.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"updateChanges",value:function(){var e=this.mBody.getShape();e.getShapeType()===A.B.Sphere?this.setGeometry(v.Create(e.getRadius(),32,32),void 0,!0):e.getShapeType()===A.B.Box&&this.setGeometry(y.Create(e.getWidth(),e.getHeight(),e.getDepth(),1,1,1),void 0,!0)}},{key:"update",value:function(e){var n,r,i,a,u;(n=t,r="update",i=this,a=3,u=(0,s.A)((0,o.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof u?function(e){return u.apply(i,e)}:u)([e]),this.transform.position.copy(this.mBody.getPosition()),this.transform.quaternion.copy(this.mBody.getQuaternion())}}])}(l.F);(0,c.A)(M,"TypeRTTI",new b.O("BodyHelper",l.F.TypeRTTI))},23518:function(e,t,n){"use strict";n.d(t,{K:function(){return r},R:function(){return o}});var r,i=n(92901),a=n(23029);!function(e){e[e.clipping_plane=0]="clipping_plane",e[e.LAST_INDEX=1]="LAST_INDEX"}(r||(r={}));var o=(0,i.A)((function e(){(0,a.A)(this,e)}))},3834:function(e,t,n){"use strict";n.d(t,{nX:function(){return r},UP:function(){return i},L_:function(){return C},_1:function(){return a}});n(60825);var r,i,a,o=n(80296),s=n(23029),u=n(92901),c=n(50388),l=n(53954),h=n(85501),f=n(64467),m=(n(48980),n(44114),n(34782),n(54554),n(5506),n(79432),n(26099),n(9920),n(98992),n(3949),n(23500),n(58794)),p=n(63805),d=n(47792),v=n(28919),y=n(27291),g=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,f.A)(this,"onUiSelected",new y.B),(0,f.A)(this,"mRenderDom",void 0),(0,f.A)(this,"mWidth",2),(0,f.A)(this,"mHeight",2),this.mRenderDom=t}),[{key:"dispose",value:function(){this.mRenderDom.remove()}},{key:"add",value:function(e){p.UX.print("ui-renderer append child:",e),this.mRenderDom.appendChild(e)}},{key:"remove",value:function(e){p.UX.print("ui-renderer remove child:",e),this.mRenderDom.removeChild(e)}},{key:"enableEvents",value:function(){this.mRenderDom.style.pointerEvents="auto"}},{key:"disableEvents",value:function(){this.mRenderDom.style.pointerEvents="none"}},{key:"eventsEnabled",value:function(){return"none"!==this.mRenderDom.style.pointerEvents}},{key:"getSize",value:function(){return{width:this.mWidth,height:this.mHeight}}},{key:"resize",value:function(e,t){this.mWidth=e,this.mHeight=t}},{key:"getRenderDom",value:function(){return this.mRenderDom}}])}(),b=n(23518),A=n(54538),_=n(73097),M=n(94273),k=n(33153),w=n(41840),T=n(28001),x=n(44889);function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(S=function(){return!!e})()}!function(e){e.perspective="perspective"}(r||(r={})),function(e){e.ambient="ambient",e.directional="directional",e.hemisphere="hemisphere",e.point="point",e.spot="spot",e.rectArea="rect-area"}(i||(i={})),function(e){e.effect_ao_plane="effect_ao_plane",e.effect_glare="effect_glare",e.effect_flare="effect_flare",e.effect_fire="effect_fire",e.effect_skycube="effect_skycube",e.effect_skyequirect="effect_skyequirect",e.effect_reflector="effect_reflector",e.effect_water="effect_water",e.grid_area="grid_area",e.primitive_line="primitive_line",e.primitive_box="primitive_box",e.primitive_plane="primitive_plane",e.primitive_sphere="primitive_sphere",e.draw_ui="draw_ui",e.mesh="mesh",e.mesh_line="mesh_line",e.transform_controls_gizmo="transform_controls_gizmo"}(a||(a={}));var C=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,l.A)(a),r=(0,c.A)(i,S()?Reflect.construct(a,o||[],(0,l.A)(i).constructor):a.apply(i,o)),(0,f.A)(r,"mUiRenderer",void 0),(0,f.A)(r,"mCatalogueSettings",new d.n),(0,f.A)(r,"mCameraTechniques",{}),(0,f.A)(r,"mLightTechniques",{}),(0,f.A)(r,"mRenderTechniques",{}),(0,f.A)(r,"mGlobalStateTechniques",{}),(0,f.A)(r,"mSceneStateTechniques",{}),(0,f.A)(r,"mSceneStateCollection",new _.m),(0,f.A)(r,"mEnabledSceneStates",{}),(0,f.A)(r,"mDeltaTime",1/60),(0,f.A)(r,"mRenderCache",{}),(0,f.A)(r,"mRenderPoolChecksum",void 0),(0,f.A)(r,"mFrameCache",{}),(0,f.A)(r,"mRendererInProgress",!1),r.mCatalogueSettings=n,r.mUiRenderer=new g(e),r.registerDefaultTechniques(),r}return(0,h.A)(t,e),(0,u.A)(t,[{key:"getUiRenderer",value:function(){return this.mUiRenderer}},{key:"getSettings",value:function(){return this.mCatalogueSettings}},{key:"getDeviceSceneSettings",value:function(){return this.mCatalogueSettings.getSceneDeviceSettings((0,m.Fr)()?v.RB.Mobile:v.RB.Desktop)}},{key:"registerDefaultTechniques",value:function(){this.registerCameraTechnique(r.perspective,this.enablePerspectiveCamera.bind(this)),this.registerLightTechnique(i.ambient,this.enableAmbientLight.bind(this)),this.registerLightTechnique(i.hemisphere,this.enableHemisphericLight.bind(this)),this.registerLightTechnique(i.directional,this.enableDirectionalLight.bind(this)),this.registerLightTechnique(i.point,this.enablePointLight.bind(this)),this.registerLightTechnique(i.spot,this.enableSpotLight.bind(this)),this.registerLightTechnique(i.rectArea,this.enableRectAreaLight.bind(this)),this.registerRenderTechnique(a.mesh,this.drawMesh.bind(this)),this.registerRenderTechnique(a.mesh_line,this.drawMeshLine.bind(this)),this.registerRenderTechnique(a.draw_ui,this.drawUI.bind(this)),this.registerRenderTechnique(a.primitive_line,this.drawPrimitiveLine.bind(this)),this.registerRenderTechnique(a.primitive_box,this.drawPrimitiveBox.bind(this)),this.registerRenderTechnique(a.primitive_plane,this.drawPrimitivePlane.bind(this)),this.registerRenderTechnique(a.primitive_sphere,this.drawPrimitiveSphere.bind(this)),this.registerRenderTechnique(a.grid_area,this.drawGridArea.bind(this)),this.registerRenderTechnique(a.effect_water,this.drawEffectWater.bind(this)),this.registerRenderTechnique(a.effect_reflector,this.drawEffectReflector.bind(this)),this.registerRenderTechnique(a.effect_skyequirect,this.drawEffectSkyEquirect.bind(this)),this.registerRenderTechnique(a.effect_skycube,this.drawEffectSkyCube.bind(this)),this.registerRenderTechnique(a.effect_flare,this.drawEffectFlare.bind(this)),this.registerRenderTechnique(a.effect_fire,this.drawEffectFire.bind(this)),this.registerRenderTechnique(a.effect_glare,this.drawEffectGlare.bind(this)),this.registerRenderTechnique(a.effect_ao_plane,this.drawEffectAoPlane.bind(this)),this.registerRenderTechnique(a.transform_controls_gizmo,this.drawTransformControlsGizmo.bind(this)),this.registerGlobalStateTechnique(b.K.clipping_plane,this.enableClippingPlane.bind(this)),this.registerSceneStateTechnique(A.n.background,this.enableSceneBackground.bind(this)),this.registerSceneStateTechnique(A.n.environment,this.enableEnvironment.bind(this)),this.registerSceneStateTechnique(A.n.environment_intensity,this.enableEnvironmentIntensity.bind(this)),this.registerSceneStateTechnique(A.n.environment_rotation,this.enableEnvironmentRotation.bind(this))}},{key:"registerCameraTechnique",value:function(e,t){e in this.mCameraTechniques&&p.UX.warn("overriding existing technique: ",e),this.mCameraTechniques[e]=t}},{key:"registerLightTechnique",value:function(e,t){e in this.mLightTechniques&&p.UX.warn("overriding existing technique: ",e),this.mLightTechniques[e]=t}},{key:"registerRenderTechnique",value:function(e,t){e in this.mRenderTechniques&&p.UX.warn("overriding existing technique: ",e),this.mRenderTechniques[e]=t}},{key:"registerGlobalStateTechnique",value:function(e,t){e in this.mGlobalStateTechniques&&p.UX.warn("overriding existing technique: ",e),this.mGlobalStateTechniques[e]=t}},{key:"registerSceneStateTechnique",value:function(e,t){e in this.mSceneStateTechniques&&p.UX.warn("overriding existing technique: ",e),this.mSceneStateTechniques[e]=t}},{key:"render",value:function(e,t){this.mDeltaTime=t,this.mFrameCache={};var n=e.checksum;this.mRenderPoolChecksum!==n&&(this.mRenderPoolChecksum=n),this.clear(!0,!0,!0),this.beforeRender(e),this.pushSceneStates(e.getCurrentSceneStates()),this.syncSceneStates(),this.renderLights(e.getLights()),this.renderCameras(e.getCameras()),this.renderDrawables(e.getDrawables()),this.popSceneStates(e.getCurrentSceneStates()),this.afterRender(e),this.updateProgress()}},{key:"updateProgress",value:function(){if(this.renderCacheReady(!0))this.mRendererInProgress?(this.mRendererInProgress=!1,w.K.eventBus().dispatch(new M.r(k.E.RendererBuildProgress,1)),w.K.eventBus().dispatch(new M.r(k.E.RendererBuildFinished))):w.K.eventBus().dispatch(new M.r(k.E.RendererBuildIdle));else{this.mRendererInProgress||(this.mRendererInProgress=!0,w.K.eventBus().dispatch(new M.r(k.E.RendererBuildStarted)));var e=0,t=0;for(var n in this.mRenderCache){var r=this.mRenderCache[n];t++,r.ready&&!r.disposed&&e++}var i=0===t?0:e/t;w.K.eventBus().dispatch(new M.r(k.E.RendererBuildProgress,i))}}},{key:"pushSceneStates",value:function(e){var t=this;e.forEach((function(e){t.mSceneStateCollection.push(e)}))}},{key:"popSceneStates",value:function(e){var t=this;e.forEach((function(e){t.mSceneStateCollection.pop(e.getType())}))}},{key:"syncSceneStates",value:function(){for(var e=this,t=this.mSceneStateCollection.currentStates().slice(),n=function(){var n=(0,o.A)(i[r],2),a=n[0],s=n[1],u=t.findIndex((function(e){return e.equals(s.state)}));u<0?(s.restore(),delete e.mEnabledSceneStates[a]):t.splice(u,1)},r=0,i=Object.entries(this.mEnabledSceneStates);r<i.length;r++)n();t.forEach((function(t){if(t.getType()in e.mSceneStateTechniques){var n=e.mSceneStateTechniques[t.getType()](t,e);n&&(e.mEnabledSceneStates[t.getType()]=n)}else p.UX.print("State technique not supported: ",t.getType())}))}},{key:"restoreAllSceneStates",value:function(){var e=this;Object.keys(this.mEnabledSceneStates).forEach((function(t){e.mEnabledSceneStates[t].restore(),delete e.mEnabledSceneStates[t]}))}},{key:"renderLights",value:function(e){var t=this;e.forEach((function(e){var n=e.getLightTechnique();n in t.mLightTechniques?t.mLightTechniques[n](e,t):p.UX.print("Light technique not supported: ",n)}))}},{key:"renderCameras",value:function(e){var t=this;e.forEach((function(e){var n=e.getCameraTechnique();n in t.mCameraTechniques?t.mCameraTechniques[n](e,t):p.UX.print("Camera technique not supported:",n)}))}},{key:"renderDrawables",value:function(e){var t=this;e.forEach((function(e){var n=e.getRenderTechnique();n in t.mRenderTechniques?(t.pushGlobalStates(),e.getWorldGlobalStates().forEach((function(n){n.getType()in t.mGlobalStateTechniques?t.mGlobalStateTechniques[n.getType()](n,e,t):p.UX.print("State technique not supported: ",n.getType())})),t.mRenderTechniques[n](e,t),t.popGlobalStates()):p.UX.print("Draw technique not supported: ",n)}))}},{key:"renderCacheReady",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t="render_cache_ready";if(void 0!==this.mFrameCache[t]&&!e)return this.mFrameCache[t];for(var n in this.mRenderCache){var r=this.mRenderCache[n];if(!r.ready&&!r.disposed)return this.mFrameCache[t]=!1,!1}return this.mFrameCache[t]=!0,!0}},{key:"isBackgroundAllowed",value:function(e){return!0}}])}(T.b);(0,f.A)(C,"TypeRTTI",new x.O("RenderEngine",T.b.TypeRTTI)),(0,f.A)(C,"MAX_RENDERINGGROUPS",16)},73097:function(e,t,n){"use strict";n.d(t,{m:function(){return c}});var r=n(80296),i=n(23029),a=n(92901),o=n(64467),s=(n(2008),n(62062),n(44114),n(5506),n(26099),n(17333),n(41393),n(98992),n(54520),n(81454),n(63805)),u=function(){return(0,a.A)((function e(){(0,i.A)(this,e),(0,o.A)(this,"mStates",[])}),[{key:"push",value:function(e){this.mStates.push(e)}},{key:"pop",value:function(){return this.mStates.pop()}},{key:"top",value:function(){if(0!==this.mStates.length)return this.mStates[this.mStates.length-1]}}])}(),c=function(){return(0,a.A)((function e(){(0,i.A)(this,e),(0,o.A)(this,"mCollection",{})}),[{key:"push",value:function(e){var t=e.getType();t in this.mCollection||(this.mCollection[t]=new u),this.mCollection[t].push(e)}},{key:"pop",value:function(e){if(e in this.mCollection)return this.mCollection[e].pop();s.UX.error("can not push unregistered state of type: '".concat(e,"'"))}},{key:"_getCollection",value:function(){return this.mCollection}},{key:"currentStates",value:function(){return Object.entries(this.mCollection).map((function(e){var t=(0,r.A)(e,2);t[0];return t[1].top()})).filter((function(e){return void 0!==e}))}}])}()},54538:function(e,t,n){"use strict";n.d(t,{E:function(){return o},n:function(){return r}});var r,i=n(92901),a=n(23029);!function(e){e[e.background=0]="background",e[e.environment=1]="environment",e[e.environment_intensity=2]="environment_intensity",e[e.environment_rotation=3]="environment_rotation",e[e.LAST_INDEX=4]="LAST_INDEX"}(r||(r={}));var o=(0,i.A)((function e(){(0,a.A)(this,e)}))},43995:function(e,t,n){"use strict";n.d(t,{X:function(){return g}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=(n(16280),n(2892),n(27495),n(90906),n(5746),n(48814)),l=n(63805),h=n(74461),f=n(44889),m=n(48477),p=n(39741),d=n(28689),v=n(41840);function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}var g=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,l=[e],c=(0,o.A)(c),i=(0,a.A)(s,y()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"mImageLoader",void 0),(0,u.A)(i,"mTexture",void 0),(0,u.A)(i,"mTextureReady",new p.m(1)),i.mImageLoader=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return m.e.TypeRTTI}},{key:"getTexture",value:function(){return this.mTexture}},{key:"onTextureReady",value:function(){return this.mTextureReady}},{key:"loadTexture",value:function(e,t,n){var r=this,i=e.search(/\.(jpg|jpeg)$/)>0||0===e.search(/^data:image\/jpeg/)?d.nC.RGB:d.nC.RGBA;return this.mTexture=v.K.renderer().getRenderEngine().createTexture2D(e,void 0,void 0===t.flipY||t.flipY,void 0!==t.mapping?t.mapping:d.C$.UV,void 0!==t.wrapU?t.wrapU:d.qC.Repeat,void 0!==t.wrapV?t.wrapV:d.qC.Repeat,void 0!==t.magFilter?t.magFilter:d.wm.Linear,void 0!==t.minFilter?t.minFilter:d.wm.Linear,void 0!==t.mipmapFilter?t.mipmapFilter:d.wm.Linear,void 0===t.generateMipmaps||Boolean(t.generateMipmaps),void 0!==t.format?t.format:i,void 0!==t.dataType?t.dataType:void 0,void 0!==t.anisotropy?Number(t.anisotropy):4,void 0!==t.encoding?t.encoding:void 0),void 0!==t.uvChannel&&this.mTexture.setUVChannel(Number(t.uvChannel)),void 0!==t.level?this.mTexture.setLevel(Number(t.level)):void 0!==t.intensity&&this.mTexture.setLevel(Number(t.intensity)),void 0!==t.useRGBasAlpha&&this.mTexture.useRGBasAlpha(Boolean(t.useRGBasAlpha)),void 0!==t.renderMode&&this.mTexture.setTextureRenderMode(t.renderMode),this.mImageLoader.load(e,(function(e){if(!r.mTexture)return n(),void r.mTextureReady.error(new Error("Failed to load the texture"));r.mTexture.updateSource(e),r.mTexture.markDirty(),n(r.mTexture),r.mTextureReady.next(r.mTexture)}),(function(){}),(function(e){l.UX.error(e),n(),r.mTextureReady.error(e)})),this.mTexture}},{key:"unload",value:function(){this.mTexture.dispose(),this.mTexture=void 0,this.mTextureReady.unsubscribe(),this.mTextureReady=new p.m(1)}}],[{key:"isSupported",value:function(e){return h.N5.isValidURL(e)&&/\.(jpg|jpeg|png)$/gm.test(e)}}])}(c.M);(0,u.A)(g,"TypeRTTI",new f.O("TextureSVGController",c.M.TypeRTTI))},48477:function(e,t,n){"use strict";n.d(t,{e:function(){return D}});n(52675),n(89463),n(2259),n(16280),n(34782),n(62010),n(60825);var r,i=n(45458),a=n(80296),o=n(10467),s=n(23029),u=n(92901),c=n(50388),l=n(53954),h=n(85501),f=n(64467),m=n(54756),p=n.n(m),d=(n(28706),n(2008),n(48980),n(23418),n(23792),n(48598),n(62062),n(44114),n(54554),n(33110),n(5506),n(26099),n(16034),n(3362),n(27495),n(90906),n(38781),n(31415),n(47764),n(11392),n(46058),n(17333),n(9920),n(41393),n(98992),n(54520),n(3949),n(81454),n(25509),n(65223),n(43375),n(60321),n(41927),n(11632),n(64377),n(39225),n(66771),n(13972),n(12516),n(99209),n(68931),n(25714),n(52514),n(35694),n(52774),n(49536),n(21926),n(17561),n(16864),n(66197),n(16215),n(23500),n(62953),n(48814)),v=n(63805),y=n(40537),g=n(74461),b=n(44889),A=n(39741),_=n(27291),M=n(27046),k=n(28689),w=n(68263),T=n(41840),x=n(58794);!function(e,t,n,r,i,a,o){e[e.Tablet=null!==(t=null===(n=window.xpv_settings)||void 0===n||null===(n=n.canvas_resolution)||void 0===n?void 0:n.tablet)&&void 0!==t?t:2048]="Tablet",e[e.Desktop=null!==(r=null===(i=window.xpv_settings)||void 0===i||null===(i=i.canvas_resolution)||void 0===i?void 0:i.desktop)&&void 0!==r?r:2048]="Desktop",e[e.Mobile=null!==(a=null===(o=window.xpv_settings)||void 0===o||null===(o=o.canvas_resolution)||void 0===o?void 0:o.mobile)&&void 0!==a?a:1024]="Mobile"}(r||(r={}));var S,C=n(69567),E=n(49571);function R(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return I(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(O=function(){return!!e})()}var D=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,l.A)(r),e=(0,c.A)(n,O()?Reflect.construct(r,i||[],(0,l.A)(n).constructor):r.apply(n,i)),(0,f.A)(e,"mTexture",void 0),(0,f.A)(e,"mTextureReady",new A.m(1)),(0,f.A)(e,"svgEngine",void 0),(0,f.A)(e,"throttleTextureHandle",void 0),(0,f.A)(e,"printReadyFileStore",{}),(0,f.A)(e,"onElementUpdated",new _.B),(0,f.A)(e,"mStickerPathChecksum",void 0),e}return(0,h.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getTexture",value:function(){return this.mTexture}},{key:"onTextureReady",value:function(){return this.mTextureReady}},{key:"loadTexture",value:function(e,n,r){var i=this;this.svgEngine=new M.L;var a=document.createElement("canvas");return a.width=t.RENDER_RESOLUTION,a.height=t.RENDER_RESOLUTION,a.style.display="none",document.body.appendChild(a),this.mTexture=T.K.renderer().getRenderEngine().createTextureCanvas(e,a,!0,void 0,void 0,void 0,k.wm.Linear,k.wm.Linear,k.wm.Linear,!0,k.nC.RGBA,void 0,4),this.loadSVGFile(e).then(function(){var e=(0,o.A)(p().mark((function e(n){var a,o,s;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.svgEngine){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,i.svgEngine.create(n,t.RENDER_RESOLUTION,i.mTexture);case 4:if(a=e.sent,o=a.width,s=a.height,i.svgEngine){e.next=9;break}return e.abrupt("return");case 9:i.svgEngine.render(),i.mTexture.setRepeat(new w.I(o/t.RENDER_RESOLUTION,s/t.RENDER_RESOLUTION)),i.mTexture.setOffset(new w.I(0,1-s/t.RENDER_RESOLUTION)),i.mTexture.markDirty(),r(i.mTexture),i.mTextureReady.next(i.mTexture);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){v.UX.error(e),r(),i.mTextureReady.error("Failed to load the texture"),i.mTextureReady.next(null)})),this.mTexture}},{key:"getBoundaries",value:(L=(0,o.A)(p().mark((function e(t){var n,r=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]&&r[1],e.abrupt("return",this.svgEngine.getBoundaries(t,n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return L.apply(this,arguments)})},{key:"getBoundariesSync",value:function(e,t,n){return this.svgEngine.getBoundariesSync(e,t,n)}},{key:"getCanvasBoundaries",value:function(){return this.svgEngine.getCanvasBoundaries()}},{key:"checkPointInsideObject",value:function(e,t,n,r){return this.svgEngine.checkPointInsideObject(e,t,n,r)}},{key:"getSourceFromMedia",value:function(e){return null==e?null:"string"!=typeof e?e.source_url:e}},{key:"getCoverageType",value:function(e,t){return(0,y.isNullOrUndefined)(e)||(0,y.isNullOrUndefined)(e.size)?(0,y.isNullOrUndefined)(t)||(0,y.isNullOrUndefined)(t.size_type)?"cover":t.size_type:e.size}},{key:"updateImage",value:(N=(0,o.A)(p().mark((function e(t,n,r,i,o){var s,u,c,l,h,f;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.svgEngine.resolveObject(t,r.clipping_element);case 2:if(s=e.sent,u=this.getSourceFromMedia(n),c=this.getCoverageType(r,i),i.allow_palletization&&o&&(u=o.canvas.toDataURL()),(0,y.isNullOrUndefined)(r)||(0,y.isNullOrUndefined)(s)){e.next=10;break}return l=(0,a.A)(r.offset,2),h=l[0],f=l[1],e.next=10,this.svgEngine.updateImageProperties(s,u,c,h,f,i.offset_unit,r.rotation,r.scale,r.flipX,r.flipY);case 10:return e.abrupt("return",this.renderTexture());case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i){return N.apply(this,arguments)})},{key:"generateStickerSvgPath",value:(F=(0,o.A)(p().mark((function e(t,n,r){var i;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.svgEngine.getGroupWrapped(n,t);case 2:if(i=e.sent){e.next=5;break}return e.abrupt("return");case 5:return e.abrupt("return",this.svgEngine.generateStickerForGroup(i.group,r.type,r));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return F.apply(this,arguments)})},{key:"updateCanvas",value:(B=(0,o.A)(p().mark((function e(t,n,r,a,s){var u,c,l,h,f,m,d,y,g,b,A,_=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.svgEngine.getGroupWrapped(n,t);case 2:if(u=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:c=(0,i.A)(u.group._objects),l=R(r.canvas.objects),e.prev=7,f=p().mark((function e(){var t,n,r,i,l,f;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=h.value,(n=c.findIndex((function(e){return e.id===t.id})))>=0&&c.splice(n,1),a.allow_palletization&&"image"===t.type&&t.id in s&&(t.imageSrc=s[t.id].canvas.toDataURL()),"i-text"!==t.type&&"text"!==t.type&&"textbox"!==t.type){e.next=18;break}if(r=[],t.multiline?t.styles&&(i=new Set,Object.values(t.styles).forEach((function(e){Object.values(e).forEach((function(e){"string"==typeof e.fontFamily&&i.add(e.fontFamily)}))})),Array.from(i).forEach((function(e){r.push(C.N.getInstance().resolveFontFace(e))}))):t.fontFamily&&r.push(C.N.getInstance().resolveFontFace(t.fontFamily)),l=r.filter((function(e){return!e.loaded&&!e.failed})).map(function(){var e=(0,o.A)(p().mark((function e(t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",C.N.getInstance().waitFontFaceLoaded(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),!(l.length>0)){e.next=18;break}return e.prev=9,e.next=12,Promise.all(l);case 12:e.next=18;break;case 14:e.prev=14,e.t0=e.catch(9),f=r.filter((function(e){return e.failed})).map((function(e){return"'".concat(e.family,"'")})).join(","),v.UX.error("TextureSvgController:updateCanvas: Unable to load font(s): ".concat(f,"."),e.t0);case 18:return e.next=20,_.svgEngine.upSertObjectToGroupOnCanvas(t,u.group);case 20:case"end":return e.stop()}}),e,null,[[9,14]])})),l.s();case 10:if((h=l.n()).done){e.next=14;break}return e.delegateYield(f(),"t0",12);case 12:e.next=10;break;case 14:e.next=19;break;case 16:e.prev=16,e.t1=e.catch(7),l.e(e.t1);case 19:return e.prev=19,l.f(),e.finish(19);case 22:m=r.sticker_path,(d=(null==m?void 0:m.data)&&E.V.checksum(JSON.stringify(m)))&&d!==this.mStickerPathChecksum?(this.mStickerPathChecksum=d,this.svgEngine.upsertStickerToGroup(u.group,m)):!d&&this.mStickerPathChecksum&&(this.svgEngine.removeStickerFromGroup(u.group),delete this.mStickerPathChecksum),y=R(c),e.prev=26,y.s();case 28:if((g=y.n()).done){e.next=35;break}if(A=g.value,null===(b=A.id)||void 0===b||!b.startsWith("XPV_SYSTEM")){e.next=32;break}return e.abrupt("continue",33);case 32:this.svgEngine.removeFromGroup(A,n);case 33:e.next=28;break;case 35:e.next=40;break;case 37:e.prev=37,e.t2=e.catch(26),y.e(e.t2);case 40:return e.prev=40,y.f(),e.finish(40);case 43:return e.abrupt("return",this.renderTexture());case 44:case"end":return e.stop()}}),e,this,[[7,16,19,22],[26,37,40,43]])}))),function(e,t,n,r,i){return B.apply(this,arguments)})},{key:"updateVisibility",value:(P=(0,o.A)(p().mark((function e(t){var n,r,i,o,s,u,c,l,h;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0,r=Object.entries(t);case 1:if(!(n<r.length)){e.next=11;break}return i=(0,a.A)(r[n],2),o=i[0],s=i[1],e.next=5,this.svgEngine.resolveObjectsLike(o);case 5:u=e.sent,c=R(u);try{for(c.s();!(l=c.n()).done;)(h=l.value).visible=s,this.svgEngine.updateElementVisibility(h,s)}catch(e){c.e(e)}finally{c.f()}case 8:n++,e.next=1;break;case 11:return e.abrupt("return",this.renderTexture());case 12:case"end":return e.stop()}}),e,this)}))),function(e){return P.apply(this,arguments)})},{key:"updatePattern",value:(D=(0,o.A)(p().mark((function e(t,n,r){var i,a,o;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.svgEngine.resolveObject(t);case 2:return i=e.sent,a=this.getSourceFromMedia(n),o=i.src,e.next=7,this.svgEngine.updatePattern(i,a,r.scale);case 7:return o!==a&&g.N5.isSvg(a)&&this.onElementUpdated.next(),e.abrupt("return",this.renderTexture());case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return D.apply(this,arguments)})},{key:"updateText",value:(I=(0,o.A)(p().mark((function e(t,n,r){var i,a,s,u,c,l,h,f,m,d,y,g,b,A;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.svgEngine.resolveObject(t,n.clipping_element);case 2:if(m=e.sent,d=n.text,m){e.next=7;break}return v.UX.warn("TextureSvgController: Unable to find text object:",t),e.abrupt("return",this.renderTexture());case 7:if(y=[],n.multiline?n.styles&&(g=new Set,Object.values(n.styles).forEach((function(e){Object.values(e).forEach((function(e){"string"==typeof e.fontFamily&&g.add(e.fontFamily)}))})),Array.from(g).forEach((function(e){y.push(C.N.getInstance().resolveFontFace(e))}))):n.font&&y.push(C.N.getInstance().resolveFontFace(n.font)),b=y.filter((function(e){return!e.loaded&&!e.failed})).map(function(){var e=(0,o.A)(p().mark((function e(t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",C.N.getInstance().waitFontFaceLoaded(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),!(b.length>0)){e.next=20;break}return e.prev=11,e.next=14,Promise.all(b);case 14:e.next=20;break;case 16:e.prev=16,e.t0=e.catch(11),A=y.filter((function(e){return e.failed})).map((function(e){return"'".concat(e.family,"'")})).join(","),v.UX.error("TextureSvgController:updateText: Unable to load font(s): ".concat(A,"."),e.t0);case 20:return this.svgEngine.updateTextProperty(m,d,n.multiline,n.autoScale,n.autoScaleFitRatio,{color:n.color,opacity:null!==(i=n.opacity)&&void 0!==i?i:1,fontSize:n.size,fontFamily:n.font,fontWeight:null!==(a=n.fontWeight)&&void 0!==a?a:"normal",fontStyle:null!==(s=n.fontStyle)&&void 0!==s?s:"normal",textAlign:n.align,underline:null!==(u=n.underline)&&void 0!==u&&u,styles:n.styles,lineHeight:n.lineHeight,charSpacing:n.charSpacing},{offsetX:null!==(c=null===(l=n.offset)||void 0===l?void 0:l[0])&&void 0!==c?c:0,offsetY:null!==(h=null===(f=n.offset)||void 0===f?void 0:f[1])&&void 0!==h?h:0,offsetUnit:r.offset_unit,rotation:n.rotation,scaleX:n.scale,scaleY:n.scale,flipX:n.flipX,flipY:n.flipY}),e.abrupt("return",this.renderTexture());case 22:case"end":return e.stop()}}),e,this,[[11,16]])}))),function(e,t,n){return I.apply(this,arguments)})},{key:"updateElement",value:(S=(0,o.A)(p().mark((function e(t,n){var r,i,a,o,s;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.svgEngine.resolveObjectsLike(t);case 2:if(r=e.sent,null!==n.value&&void 0!==n.value){e.next=5;break}return e.abrupt("return",this.renderTexture());case 5:i="style."===n.attribute.substring(0,6)?n.attribute.substring(6):n.attribute,a=R(r);try{for(a.s();!(o=a.n()).done;)s=o.value,this.svgEngine.updateElementProperty(s,i,n.value)}catch(e){a.e(e)}finally{a.f()}return e.abrupt("return",this.renderTexture());case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"updateGradient",value:(b=(0,o.A)(p().mark((function e(t,n){var r,i,a,o;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.svgEngine.resolveObjectsLike(t,n.clipping_element);case 2:r=e.sent,i=R(r),e.prev=4,i.s();case 6:if((a=i.n()).done){e.next=12;break}return o=a.value,e.next=10,this.svgEngine.updateGradientProperty(o,n.primary_color,n.secondary_color,n.direction);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),i.e(e.t0);case 17:return e.prev=17,i.f(),e.finish(17);case 20:return e.abrupt("return",this.renderTexture());case 21:case"end":return e.stop()}}),e,this,[[4,14,17,20]])}))),function(e,t){return b.apply(this,arguments)})},{key:"getCurrentRawTextFromObject",value:(d=(0,o.A)(p().mark((function e(t,n){var r,i;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.svgEngine.resolveObject(t,n.clipping_element);case 2:return r=e.sent,(i=this.svgEngine.initTextObject(r,n.multiline)).element.set({text:n.text.toString()}),e.abrupt("return",i.element._textLines.map((function(e){return e.join("")})).join("\n")||n.text);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"renderTexture",value:function(){var e=this;return this.throttleTextureHandle||(this.throttleTextureHandle=window.setTimeout((function(){delete e.throttleTextureHandle,e.svgEngine&&e.svgEngine.render(),e.mTexture&&e.mTexture.markDirty()}),16)),this.mTexture}},{key:"loadSVGFile",value:(m=(0,o.A)(p().mark((function e(t){var n=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){window.fetch(t,{method:"GET",mode:"cors",cache:"no-cache",credentials:"omit",redirect:"follow"}).then((function(t){if(!n.mTexture||!n.svgEngine)return r("Texture is unloaded");t&&t.ok?e(t.text()):r("Could not download SVG file")}),(function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return m.apply(this,arguments)})},{key:"unload",value:function(){this.mTexture&&(this.mTexture.dispose(),delete this.mTexture),this.mTextureReady&&(this.mTextureReady.complete(),this.mTextureReady.unsubscribe()),this.mTextureReady=new A.m(1),this.onElementUpdated&&(this.onElementUpdated.complete(),this.onElementUpdated.unsubscribe()),this.onElementUpdated=new _.B,this.svgEngine&&(this.svgEngine.destroy(),delete this.svgEngine),this.printReadyFileStore&&(this.printReadyFileStore={})}},{key:"addWatermark",value:(n=(0,o.A)(p().mark((function e(t,n){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.svgEngine.resolveObject(n);case 2:return(r=e.sent).element.set("isWatermark",!0),e.next=6,this.svgEngine.updateImageProperties(r,this.printReadyFileStore[t].watermarkMedia.source_url,"contain",0,0,"pixels",0,1);case 6:this.renderTexture();case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getSvgCanvasAsBase64",value:function(){var e=this.mTexture;if(e){this.svgEngine&&this.svgEngine.render();var t=this.mTexture.getCanvas(),n=document.createElement("canvas");n.width=t.width,n.height=t.height,n.setAttribute("crossorigin","anonymous"),n.style.display="none",document.body.appendChild(n);var r=n.getContext("2d");r.resetTransform(),r.clearRect(0,0,n.width,n.height);var i=t.width/e.getRepeat().x,a=t.height/e.getRepeat().y;r.drawImage(t,0,0,t.width,t.height,0,0,i,a);var o=n.toDataURL("image/png");return n.width=0,n.height=0,n.remove(),o}}}],[{key:"isSupported",value:function(e){return g.N5.isValidURL(e)&&/\.(svg)$/gm.test(e)}},{key:"getRenderResolution",value:function(){return(0,x.v1)()?r.Tablet:(0,x.Fr)()?r.Mobile:r.Desktop}}]);var n,m,d,b,S,I,D,P,B,F,N,L}(d.M);S=D,(0,f.A)(D,"TypeRTTI",new b.O("TextureSVGController",d.M.TypeRTTI)),(0,f.A)(D,"RENDER_RESOLUTION",S.getRenderResolution())},48814:function(e,t,n){"use strict";n.d(t,{M:function(){return h}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889);function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}var h=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,l()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"mTextureKey",void 0),n.mTextureKey=e,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getTextureKey",value:function(){return this.mTextureKey}}],[{key:"isSupported",value:function(e){return!1}}])}(n(97869).p);(0,u.A)(h,"TypeRTTI",new c.O("TextureController"))},94051:function(e,t,n){"use strict";var r;n.d(t,{$:function(){return r}}),function(e){e.DIFFUSE="DiffuseMap",e.ALPHA="AlphaMap",e.ENVIRONMENT="EnvironmentMap",e.BUMP="BumpMap",e.DISPLACEMENT="DisplacementMap",e.NORMAL="NormalMap",e.METALNESS="MetalnessMap",e.ROUGHNESS="RoughnessMap",e.AO="AOMap",e.LIGHTMAP="LightMap",e.EMISSIVE="EmissiveMap",e.GLOSSINESS="GlossinessMap"}(r||(r={}))},92981:function(e,t,n){"use strict";var r;n.d(t,{k:function(){return r}}),function(e){e[e.Front=0]="Front",e[e.Back=1]="Back",e[e.Double=2]="Double"}(r||(r={}))},71699:function(e,t,n){"use strict";n.d(t,{T:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=function(){return(0,i.A)((function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,r.A)(this,e),(0,a.A)(this,"mData",void 0),(0,a.A)(this,"mItemSize",void 0),(0,a.A)(this,"mNormalized",void 0),this.mData=t,this.mItemSize=n,this.mNormalized=i}),[{key:"getData",value:function(){return this.mData}},{key:"getItemSize",value:function(){return this.mItemSize}},{key:"isNormalized",value:function(){return this.mNormalized}}])}()},70123:function(e,t,n){"use strict";n.d(t,{L:function(){return h},P:function(){return r}});n(60825);var r,i=n(92901),a=n(23029),o=n(50388),s=n(53954),u=n(85501),c=n(82344);function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}!function(e){e[e.POSITION=0]="POSITION",e[e.NORMAL=1]="NORMAL",e[e.TANGENT=2]="TANGENT",e[e.UV=3]="UV",e[e.UV2=4]="UV2",e[e.COLOR=5]="COLOR"}(r||(r={}));var h=function(e){function t(){return(0,a.A)(this,t),e=this,n=t,r=arguments,n=(0,s.A)(n),(0,o.A)(e,l()?Reflect.construct(n,r||[],(0,s.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,u.A)(t,e),(0,i.A)(t)}(c.F)},55178:function(e,t,n){"use strict";n.d(t,{_:function(){return c}});n(60825);var r=n(92901),i=n(23029),a=n(50388),o=n(53954),s=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var c=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,o.A)(n),(0,a.A)(e,u()?Reflect.construct(n,r||[],(0,o.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,s.A)(t,e),(0,r.A)(t)}(n(39485).im)},14933:function(e,t,n){"use strict";n.d(t,{r:function(){return c}});n(60825);var r=n(92901),i=n(23029),a=n(50388),o=n(53954),s=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var c=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,o.A)(n),(0,a.A)(e,u()?Reflect.construct(n,r||[],(0,o.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,s.A)(t,e),(0,r.A)(t)}(n(39485).im)},4976:function(e,t,n){"use strict";n.d(t,{S:function(){return c}});n(60825);var r=n(92901),i=n(23029),a=n(50388),o=n(53954),s=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var c=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,o.A)(n),(0,a.A)(e,u()?Reflect.construct(n,r||[],(0,o.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,s.A)(t,e),(0,r.A)(t)}(n(39485).im)},28288:function(e,t,n){"use strict";n.d(t,{j:function(){return r},o:function(){return h}});n(60825);var r,i=n(92901),a=n(23029),o=n(50388),s=n(53954),u=n(85501),c=n(39485);function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}!function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High"}(r||(r={}));var h=function(e){function t(){return(0,a.A)(this,t),e=this,n=t,r=arguments,n=(0,s.A)(n),(0,o.A)(e,l()?Reflect.construct(n,r||[],(0,s.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,u.A)(t,e),(0,i.A)(t)}(c.im)},17632:function(e,t,n){"use strict";n.d(t,{t:function(){return c}});n(60825);var r=n(92901),i=n(23029),a=n(50388),o=n(53954),s=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var c=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,o.A)(n),(0,a.A)(e,u()?Reflect.construct(n,r||[],(0,o.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,s.A)(t,e),(0,r.A)(t)}(n(4946).u)},4946:function(e,t,n){"use strict";n.d(t,{u:function(){return c}});n(60825);var r=n(92901),i=n(23029),a=n(50388),o=n(53954),s=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var c=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,o.A)(n),(0,a.A)(e,u()?Reflect.construct(n,r||[],(0,o.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,s.A)(t,e),(0,r.A)(t)}(n(55178)._)},72713:function(e,t,n){"use strict";n.d(t,{K:function(){return c}});n(60825);var r=n(92901),i=n(23029),a=n(50388),o=n(53954),s=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var c=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,o.A)(n),(0,a.A)(e,u()?Reflect.construct(n,r||[],(0,o.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,s.A)(t,e),(0,r.A)(t)}(n(8015).l)},8015:function(e,t,n){"use strict";n.d(t,{l:function(){return c}});n(60825);var r=n(92901),i=n(23029),a=n(50388),o=n(53954),s=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var c=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,o.A)(n),(0,a.A)(e,u()?Reflect.construct(n,r||[],(0,o.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,s.A)(t,e),(0,r.A)(t)}(n(15307).r)},29928:function(e,t,n){"use strict";n.d(t,{k:function(){return c}});n(60825);var r=n(92901),i=n(23029),a=n(50388),o=n(53954),s=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var c=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,o.A)(n),(0,a.A)(e,u()?Reflect.construct(n,r||[],(0,o.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,s.A)(t,e),(0,r.A)(t)}(n(39485).im)},15307:function(e,t,n){"use strict";n.d(t,{r:function(){return c}});n(60825);var r=n(92901),i=n(23029),a=n(50388),o=n(53954),s=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var c=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,o.A)(n),(0,a.A)(e,u()?Reflect.construct(n,r||[],(0,o.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,s.A)(t,e),(0,r.A)(t)}(n(39485).im)},39485:function(e,t,n){"use strict";n.d(t,{Am:function(){return a},Xn:function(){return i},im:function(){return m},r_:function(){return r}});n(60825);var r,i,a,o=n(92901),s=n(23029),u=n(50388),c=n(53954),l=n(85501),h=n(82344);function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}!function(e){e[e.Disable=0]="Disable",e[e.Add=1]="Add",e[e.Combine=2]="Combine",e[e.Subtract=3]="Subtract",e[e.Multiply=4]="Multiply",e[e.Maximized=5]="Maximized",e[e.OneOne=6]="OneOne",e[e.Interpolate=7]="Interpolate",e[e.ScreenMode=8]="ScreenMode",e[e.PreMultiplied=9]="PreMultiplied"}(r||(r={})),function(e){e[e.Opaque=0]="Opaque",e[e.AlphaTest=1]="AlphaTest",e[e.AlphaBlend=2]="AlphaBlend",e[e.AlphaBlendAndTest=3]="AlphaBlendAndTest"}(i||(i={})),function(e){e[e.Multiply=0]="Multiply",e[e.Mix=1]="Mix",e[e.Add=2]="Add"}(a||(a={}));var m=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,c.A)(n),(0,u.A)(e,f()?Reflect.construct(n,r||[],(0,c.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,l.A)(t,e),(0,o.A)(t)}(h.F)},82344:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=(n(44435),function(){return(0,i.A)((function e(){(0,r.A)(this,e),(0,a.A)(this,"mUniqueId",void 0),this.mUniqueId=++e.sResourceCount}),[{key:"getUniqueId",value:function(){return this.mUniqueId}}])}());(0,a.A)(o,"sResourceCount",Number.MIN_SAFE_INTEGER)},98168:function(e,t,n){"use strict";n.d(t,{M:function(){return c}});n(60825);var r=n(92901),i=n(23029),a=n(50388),o=n(53954),s=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var c=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,o.A)(n),(0,a.A)(e,u()?Reflect.construct(n,r||[],(0,o.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,s.A)(t,e),(0,r.A)(t)}(n(28689).gP)},28689:function(e,t,n){"use strict";n.d(t,{C$:function(){return o},Gs:function(){return r},fG:function(){return s},gP:function(){return y},nC:function(){return i},qC:function(){return c},vv:function(){return a},wm:function(){return u}});n(60825);var r,i,a,o,s,u,c,l=n(92901),h=n(23029),f=n(50388),m=n(53954),p=n(85501),d=n(82344);function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}!function(e){e[e.UnsignedByte=1009]="UnsignedByte",e[e.Byte=1010]="Byte",e[e.Short=1011]="Short",e[e.UnsignedShort=1012]="UnsignedShort",e[e.Int=1013]="Int",e[e.UnsignedInt=1014]="UnsignedInt",e[e.Float=1015]="Float",e[e.HalfFloat=1016]="HalfFloat",e[e.UnsignedShort4444=1017]="UnsignedShort4444",e[e.UnsignedShort5551=1018]="UnsignedShort5551",e[e.UnsignedShort565=1019]="UnsignedShort565",e[e.UnsignedInt248=1020]="UnsignedInt248"}(r||(r={})),function(e){e[e.Alpha=1021]="Alpha",e[e.Red=1028]="Red",e[e.RedInt=1029]="RedInt",e[e.RG=1030]="RG",e[e.RGInt=1031]="RGInt",e[e.RGB=1022]="RGB",e[e.RGBInt=1032]="RGBInt",e[e.RGBA=1023]="RGBA",e[e.RGBAInt=1033]="RGBAInt",e[e.Luminance=1024]="Luminance",e[e.LuminanceAlpha=1025]="LuminanceAlpha",e[e.Depth=1026]="Depth",e[e.DepthStencil=1027]="DepthStencil"}(i||(i={})),function(e){e[e.Linear=3e3]="Linear",e[e.sRGB=3001]="sRGB",e[e.Gamma=3007]="Gamma",e[e.RGBE=3002]="RGBE",e[e.LogLuv=3003]="LogLuv",e[e.RGBM7=3004]="RGBM7",e[e.RGBM16=3005]="RGBM16",e[e.RGBD=3006]="RGBD",e[e.BasicDepthPacking=3200]="BasicDepthPacking",e[e.RGBADepthPacking=3201]="RGBADepthPacking"}(a||(a={})),function(e){e[e.UV=300]="UV",e[e.Cube=301]="Cube",e[e.Equirectangular=303]="Equirectangular",e[e.Spherical=305]="Spherical"}(o||(o={})),function(e){e[e.Reflect=1]="Reflect",e[e.Refract=2]="Refract",e[e.ReflectRefract=3]="ReflectRefract"}(s||(s={})),function(e){e[e.None=-1]="None",e[e.Nearest=1003]="Nearest",e[e.Linear=1006]="Linear"}(u||(u={})),function(e){e[e.Repeat=1e3]="Repeat",e[e.ClampToEdge=1001]="ClampToEdge",e[e.MirrorRepeat=1002]="MirrorRepeat"}(c||(c={}));var y=function(e){function t(){return(0,h.A)(this,t),e=this,n=t,r=arguments,n=(0,m.A)(n),(0,f.A)(e,v()?Reflect.construct(n,r||[],(0,m.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,p.A)(t,e),(0,l.A)(t)}(d.F)},47185:function(e,t,n){"use strict";n.d(t,{J:function(){return qe},n:function(){return ze}});var r=n(80296),i=n(23029),a=n(92901),o=n(64467),s=(n(2892),n(5506),n(52675),n(83851),n(81278),n(60825),n(10467)),u=n(50388),c=n(53954),l=n(90991),h=n(85501),f=n(54756),m=n.n(f),p=(n(2008),n(48980),n(44114),n(33110),n(79432),n(26099),n(3362),n(17333),n(9920),n(98992),n(54520),n(3949),n(58335),n(23500),n(67138)),d=n(63805),v=(n(16280),n(23792),n(96167),n(47764),n(62953),n(74461)),y=n(44889),g=n(97869);function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(b=function(){return!!e})()}var A=function(e){function t(e,n,r){var a,s,l,h;return(0,i.A)(this,t),s=this,l=t,l=(0,c.A)(l),a=(0,u.A)(s,b()?Reflect.construct(l,h||[],(0,c.A)(s).constructor):l.apply(s,h)),(0,o.A)(a,"mHandleType",void 0),(0,o.A)(a,"mHandle",void 0),(0,o.A)(a,"mPoolKey",void 0),a.mHandleType=e,a.mHandle=n,a.mPoolKey=r,a}return(0,h.A)(t,e),(0,a.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"_setHandle",value:function(e){this.mHandle=e}},{key:"_getHandle",value:function(){return this.mHandle}},{key:"_setHandleType",value:function(e){this.mHandleType=e}},{key:"getHandleType",value:function(){return this.mHandleType}},{key:"_setPoolKey",value:function(e){this.mPoolKey=e}},{key:"getPoolKey",value:function(){return this.mPoolKey}},{key:"validateHandle",value:function(e){return e&&this.getObjectId()===e.getObjectId()&&this.getPoolKey()===e.getPoolKey()}},{key:"clone",value:function(e){return new t(this.mHandleType,this.mHandle,void 0!==e?e:this.mPoolKey)}}])}(g.p);(0,o.A)(A,"TypeRTTI",new y.O("ResourceHandle",g.p.TypeRTTI));var _=function(){return(0,a.A)((function e(t){(0,i.A)(this,e),(0,o.A)(this,"mGenericPoolKey",void 0),(0,o.A)(this,"mPools",void 0),this.mGenericPoolKey=t,this.init()}),[{key:"add",value:function(e,t){var n=e._getHandle(),r=this.resolvePoolKey(n,t);r in this.mPools||(this.mPools[r]={});var i=n._getHandle();return!(i in this.mPools[r])&&(this.mPools[r][i]=e,!0)}},{key:"remove",value:function(e,t){var n=this.resolvePoolKey(e,t);if(n in this.mPools){var r="string"==typeof e?e:e._getHandle();if(r in this.mPools[n]){var i=this.mPools[n][r];return delete this.mPools[n][r],i}}}},{key:"move",value:function(e,t,n){var r=this.remove(e,n);if(r){t in this.mPools||(this.mPools[t]={});var i="string"==typeof e?e:e._getHandle();this.mPools[t][i]=r}}},{key:"clone",value:function(e,t,n){var r=this.findByHandle(e,n);if(r){t in this.mPools||(this.mPools[t]={});var i="string"==typeof e?e:e._getHandle(),a=r.clone();return a._setHandle(r._getHandle().clone(t)),this.mPools[t][i]=a,a}}},{key:"find",value:function(e){for(var t in this.mPools)for(var n in this.mPools[t])if(e(this.mPools[t][n],Number(t)))return this.mPools[t][n]}},{key:"findAll",value:function(e){var t=[];for(var n in this.mPools)for(var r in this.mPools[n])e(this.mPools[n][r],Number(n))&&t.push(this.mPools[n][r]);return t}},{key:"findByHandle",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.resolvePoolKey(e,t),i="string"==typeof e?e:e._getHandle();if(r in this.mPools&&i in this.mPools[r])return this.mPools[r][i];n&&Object.entries(this.mPools).forEach((function(e){var t=e[1];if(i in t)return t[i]}))}},{key:"has",value:function(e,t){var n=this.resolvePoolKey(e,t),r="string"==typeof e?e:e._getHandle();return n in this.mPools&&r in this.mPools[n]}},{key:"validate",value:function(e){var t=e.getPoolKey(),n=e._getHandle();return t in this.mPools&&(n in this.mPools[t]&&this.mPools[t][n]._getHandle().validateHandle(e))}},{key:"init",value:function(){this.mPools={},this.mPools[this.mGenericPoolKey]={}}},{key:"dispose",value:function(e){var t=this;Object.keys(this.mPools).forEach((function(n){Object.keys(t.mPools[n]).forEach((function(r){e(t.mPools[n][r]),delete t.mPools[n][r]})),delete t.mPools[n]})),delete this.mPools}},{key:"resolvePoolKey",value:function(e,t){return"string"!=typeof e?e.getPoolKey():void 0!==t?t:this.mGenericPoolKey}}])}(),M=function(){function e(){(0,i.A)(this,e),(0,o.A)(this,"mResourcePool",void 0),this.mResourcePool=new _(e._poolKey)}return(0,a.A)(e,[{key:"cleanup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.mResourcePool.dispose((function(e){e.dispose(!0)})),e&&this.mResourcePool.init()}},{key:"validateHandle",value:function(e){if(!this.mResourcePool.validate(e))throw new Error("Invalid handle")}},{key:"validatePoolKey",value:function(t,n){var r=void 0!==n?n:e._poolKey;return t.getPoolKey()===r}},{key:"findResourceWithHandleKey",value:function(e,t){return this.mResourcePool.findByHandle(e,t,!1)}},{key:"findResourceWithHandle",value:function(e){return this.mResourcePool.findByHandle(e,void 0,!1)}},{key:"makeResource",value:function(t,n,r){if(null!=t){var i=this.makeHandleKey(t,n),a=this.findResourceWithHandleKey(i,r);if(a)return a._increaseReferenceCount(),a._getHandle();var o=v.N5.isNumeric(r)?r:e._poolKey,s=new A(this.getResourceGroupType(),i,o),u=this.createResource(t,s,n);return u._increaseReferenceCount(),u._setHandle(s),this.mResourcePool.add(u,o),d.UX.print("Resource created:",s._getHandle(),s.getPoolKey()),s}d.UX.warn("Trying to make a resource with none-numeric model id: '".concat(t,"'"))}},{key:"makeResourceRaw",value:function(t,n){var r=t.getUniqueId(),i=this.makeHandleKey(r,{}),a=this.findResourceWithHandleKey(i,n);if(a)return a._increaseReferenceCount(),a._getHandle();var o=v.N5.isNumeric(n)?n:e._poolKey,s=new A(this.getResourceGroupType(),i,o),u=this.createResource(t,s,{});return u._increaseReferenceCount(),u._lockDisposable(!0),u._setHandle(s),this.mResourcePool.add(u,o),d.UX.print("Resource (raw) created:",s._getHandle(),s.getPoolKey()),s}},{key:"resolveResource",value:(r=(0,s.A)(m().mark((function e(t,n,r){var i,a,o,s,u,c,l,h,f,p,d=arguments;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=d.length>3&&void 0!==d[3]&&d[3],e.prev=1,t){e.next=4;break}throw new Error("Undefined handle");case 4:return this.validateHandle(t),a=this.mResourcePool.findByHandle(t),e.next=8,this.onBeforeResolve(a);case 8:return s=new Promise((function(e){o=e})),u=function(e){o()},l=new Promise((function(e){c=e})),h=function(e){c()},e.next=14,a.resolve(u,r);case 14:return f=e.sent,i&&a._increaseReferenceCount(),e.next=18,this.onAfterResolve(a,f,h);case 18:return(p=e.sent).overridden||h(p.resource),e.next=22,Promise.allSettled([s,l]);case 22:return n&&n(p.resource),e.abrupt("return",p.resource);case 26:throw e.prev=26,e.t0=e.catch(1),n&&n(),e.t0;case 30:case"end":return e.stop()}}),e,this,[[1,26]])}))),function(e,t,n){return r.apply(this,arguments)})},{key:"disposeResource",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t||this.validateHandle(e);var n=this.mResourcePool.findByHandle(e);n&&(n._decreaseReferenceCount(),n.dispose(t)&&this.mResourcePool.remove(e))}},{key:"onBeforeResolve",value:(n=(0,s.A)(m().mark((function e(t){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.isDisposed()){e.next=2;break}throw new Error("Resolving resource after dispose.");case 2:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"onAfterResolve",value:(t=(0,s.A)(m().mark((function e(t,n,r){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve({resource:n,overridden:!1}));case 1:case"end":return e.stop()}}),e)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"makeHandleKey",value:function(e,t){return String(e)}}]);var t,n,r}();(0,o.A)(M,"_poolKey",2147483647);var k,w=n(22098),T=n(65638),x=(n(50113),n(74423),n(54554),n(62010),n(21699),n(3064),n(72577),n(38975));!function(e){e[e.Unloaded=0]="Unloaded",e[e.InProgress=1]="InProgress",e[e.Ready=2]="Ready",e[e.Error=3]="Error"}(k||(k={}));var S=n(39741),C=(n(62062),n(89463),n(2259),n(23418),n(34782),n(27495),n(90906),n(38781),n(41393),n(81454),n(55178)),E=n(28288),R=n(4946),I=n(17632),O=n(8015),D=n(72713),P=n(15307),B=(n(28706),n(48598),function(){return(0,a.A)((function e(){(0,i.A)(this,e)}),[{key:"canHandle",value:function(e){return this.hasGroupInPropertyName(e)?this.canHandleGroup(this.getGroup(e)):this.canHandleKey(e)}},{key:"canHandleKey",value:function(e){return this.mSupportedProperties.includes(this.mapKey((0,v.fL)(e)))}},{key:"canHandleGroup",value:function(e){return this.mSupportedGroups.includes(this.mapGroupKey((0,v.fL)(e)))}},{key:"intToColor3",value:function(e){var t="string"==typeof e?parseInt(e,10):e,n=255&t,r=t>>8&255,i=t>>16&255;return new w.v(i/255,r/255,n/255)}},{key:"loadTexture2d",value:(e=(0,s.A)(m().mark((function e(t,n,r,i,a){var o,s;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=n){e.next=2;break}throw new Error("Undefined texture id.");case 2:return r.forceShared=!(!i||void 0===i.force_shared)&&i.force_shared,o=t.makeResource(n,r,a),e.next=6,new Promise((function(e,n){t.resolveResource(o,(function(t){if(!t)return n(new Error("Failed to load texture"));e(t)})).then((function(){})).catch((function(e){n(e)}))}));case 6:return s=e.sent,e.abrupt("return",s);case 8:case"end":return e.stop()}}),e)}))),function(t,n,r,i,a){return e.apply(this,arguments)})},{key:"disposeTexture",value:function(e,t,n,r){t&&e.disposeTexture(t,n,r)}},{key:"getGroup",value:function(e){var t=e.split(".");return 1===t.length?t.join(""):t.splice(0,t.length-1).join(".")}},{key:"getPropertyName",value:function(e){var t=e.split(".");return t[t.length-1]}},{key:"hasGroupInPropertyName",value:function(e){return e.includes(".")}}]);var e}()),F=n(39485),N=n(29928),L=n(14933),j=n(68263),U=n(28689),V=n(92981),z=n(4976);function H(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(H=function(){return!!e})()}var G=function(e){function t(){var e,n,r,a;(0,i.A)(this,t);for(var s=arguments.length,l=new Array(s),h=0;h<s;h++)l[h]=arguments[h];return n=this,r=t,a=[].concat(l),r=(0,c.A)(r),e=(0,u.A)(n,H()?Reflect.construct(r,a||[],(0,c.A)(n).constructor):r.apply(n,a)),(0,o.A)(e,"mSupportedProperties",["id","uuid","type","shading","side","combine","blending","alphaMode","transparencyMode","depthPrePass","separateCullingPass","depthTest","depthWrite","fog","premultipliedAlpha","transparent","wireframe","enableFresnelDiff","enableFresnelEnv","enableSpecularGlossiness","alphaTest","opacity","aoMapIntensity","lightMapIntensity","envMapIntensity","reflectivity","refractionRatio","wireframeLineWidth","emissiveIntensity","bumpScale","displacementScale","displacementBias","shininess","metalness","roughness","clearCoat","clearCoatRoughness","envMapScale","fresnelDiffScale","fresnelDiffBias","fresnelDiffPower","fresnelEnvBias","fresnelEnvScale","fresnelEnvPower","glossiness","normalScale","normalMapScale","color","diffuse","diffuseColor","emissive","emissiveColor","specular","specularColor","fresnelDiffColorLeft","alphaMap","aoMap","lightMap","map","diffuseMap","specularMap","emissiveMap","bumpMap","displacementMap","normalMap","metalnessMap","roughnessMap","gradientMap","glossinessMap","envMap","cameraLayer","lights","name","ssrl","renderOrder","userdata","textureSx","textureSy","propertyId","renderLayer"]),(0,o.A)(e,"mSupportedGroups",[]),e}return(0,h.A)(t,e),(0,a.A)(t,[{key:"mapKey",value:function(e){switch(e){case"emissiveMapIntensity":return"emissiveIntensity";case"materialId":return"id"}return e}},{key:"mapGroupKey",value:function(e){return e}},{key:"handle",value:function(e,t,n,r,i,a){var o=this,u=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],c=arguments.length>7?arguments[7]:void 0,l=this.mapKey((0,v.fL)(t));switch(l){case"id":case"uuid":case"name":case"type":return!1;case"cameraLayer":var h=e.getMetaData();return(h=h||{}).cameraLayer=n,h.cameraLayerNeedsUpdate=!0,e.setMetaData(h),!0}switch(l){case"shading":var f="flatshading"===String(n).toLocaleLowerCase();return e.setFlatShading(f),!0;case"side":return"backside"===String(n).toLowerCase()?e.setSide(V.k.Back):"frontside"===String(n).toLowerCase()?e.setSide(V.k.Front):"doubleside"===String(n).toLowerCase()&&e.setSide(V.k.Double),!0;case"combine":if(e instanceof C._||e instanceof L.r)switch(String(n).toLowerCase()){case"multiply":e.setEnvMapCombine(F.Am.Multiply);break;case"mixoperation":e.setEnvMapCombine(F.Am.Mix);break;case"addoperation":e.setEnvMapCombine(F.Am.Add)}return!0;case"alphaMode":case"blending":switch(n.toLowerCase()){case"normalblending":case"combineblending":case"normal":case"combine":e.setAlphaMode(F.r_.Combine);break;case"oneoneblending":case"oneone":e.setAlphaMode(F.r_.OneOne);break;case"additiveblending":case"additive":e.setAlphaMode(F.r_.Add);break;case"subtractiveblending":case"subtractive":e.setAlphaMode(F.r_.Subtract);break;case"multiplyblending":case"multiply":e.setAlphaMode(F.r_.Multiply);break;case"maximizedblending":case"maximized":e.setAlphaMode(F.r_.Maximized);break;case"premultiplied":e.setAlphaMode(F.r_.PreMultiplied)}return!0;case"transparencyMode":switch(n.toLowerCase()){case"opaque":e.setTransparencyMode(F.Xn.Opaque);break;case"alphatest":e.setTransparencyMode(F.Xn.AlphaTest);break;case"alphablend":e.setTransparencyMode(F.Xn.AlphaBlend);break;case"alphablendandtest":e.setTransparencyMode(F.Xn.AlphaBlendAndTest)}return!0}switch(l){case"depthTest":return e.setDepthTest((0,v.Hn)(n)),!0;case"depthWrite":return e.setDepthWrite((0,v.Hn)(n)),!0;case"depthPrePass":return e.setDepthPrePass((0,v.Hn)(n)),!0;case"separateCullingPass":return e.setSeparateCullingPass((0,v.Hn)(n)),!0;case"fog":return e.setFog((0,v.Hn)(n)),!0;case"premultipliedAlpha":return e.setPremultipliedAlpha((0,v.Hn)(n)),!0;case"transparent":return e.setTransparent((0,v.Hn)(n)),!0;case"wireframe":return e.setWireframe((0,v.Hn)(n)),!0;case"enableFresnelDiff":return(e instanceof I.t||e instanceof D.K)&&e.setFresnelDiffuseEnabled((0,v.Hn)(n)),!0;case"enableFresnelEnv":return(e instanceof I.t||e instanceof D.K)&&e.setFresnelEnvMapEnabled((0,v.Hn)(n)),!0;case"enableSpecularGlossiness":return e instanceof D.K&&e.setSpecularGlossinessEnabled((0,v.Hn)(n)),!0}switch(l){case"alphaTest":var p=parseFloat(n);return isNaN(p)||e.setAlphaTest(p),!0;case"opacity":var y=parseFloat(n);return isNaN(y)||e.setOpacity(y),!0;case"aoMapIntensity":if(e instanceof E.o){var g=parseFloat(n);isNaN(g)||e.setAoIntensity(g)}else if(e instanceof C._||e instanceof L.r||e instanceof P.r){var b=parseFloat(n);isNaN(b)||e.setAoIntensity(b)}return!0;case"lightMapIntensity":if(e instanceof E.o){var A=parseFloat(n);isNaN(A)||e.setLightMapIntensity(A)}else if(e instanceof L.r||e instanceof R.u||e instanceof P.r){var _=parseFloat(n);isNaN(_)||e.setLightMapIntensity(_)}return!0;case"envMapIntensity":if(e instanceof E.o){var M=parseFloat(n);isNaN(M)||e.setEnvironmentIntensity(M)}else if(e instanceof L.r||e instanceof R.u||e instanceof P.r){var k=parseFloat(n);isNaN(k)||e.setEnvMapIntensity(k)}return!0;case"reflectivity":if(e instanceof E.o){var T=parseFloat(n);isNaN(T)||e.setReflectionColor(new w.v(T,T,T))}else if(e instanceof L.r||e instanceof C._||e instanceof O.l){var x=parseFloat(n);isNaN(x)||e.setReflectivity(x)}return!0;case"refractionRatio":if(e instanceof E.o){var S=parseFloat(n);isNaN(S)||e.setSubSurfaceConfiguration({indexOfRefraction:S})}else if(e instanceof L.r||e instanceof C._||e instanceof P.r){var B=parseFloat(n);isNaN(B)||e.setIOR(B)}return!0;case"wireframeLinewidth":var H=parseFloat(n);return isNaN(H)||e.setWireframeLineWidth(H),!0;case"emissiveIntensity":if(e instanceof E.o){var G=parseFloat(n);isNaN(G)||e.setEmissiveIntensity(G)}else if(e instanceof L.r||e instanceof R.u||e instanceof P.r){var q=parseFloat(n);isNaN(q)||e.setEmissiveIntensity(q)}return!0;case"bumpScale":if(e instanceof E.o){var W=parseFloat(n);isNaN(W)||e.setNormalScale(new j.I(W,W))}else if(e instanceof R.u||e instanceof P.r){var K=parseFloat(n);isNaN(K)||e.setBumpScale(K)}return!0;case"displacementScale":if(e instanceof E.o){var X=parseFloat(n);isNaN(X)||e.setParallaxScaleBias(X)}else if(e instanceof R.u||e instanceof P.r){var Y=parseFloat(n);isNaN(Y)||e.setDisplacementScale(Y)}return!0;case"displacementBias":if(e instanceof R.u||e instanceof P.r){var $=parseFloat(n);isNaN($)||e.setDisplacementBias($)}return!0;case"metalness":if(e instanceof E.o){var Z=parseFloat(n);isNaN(Z)||e.setMetalness(Z)}else if(e instanceof P.r){var Q=parseFloat(n);isNaN(Q)||e.setMetalness(Q)}return!0;case"roughness":if(e instanceof E.o){var J=parseFloat(n);isNaN(J)||e.setRoughness(J)}else if(e instanceof P.r){var ee=parseFloat(n);isNaN(ee)||e.setRoughness(ee)}return!0;case"clearCoat":if(e instanceof E.o){var te=parseFloat(n);isNaN(te)||e.setClearCoatConfiguration({isEnabled:!0,intensity:te})}else if(e instanceof O.l){var ne=parseFloat(n);isNaN(ne)||e.setClearCoat(ne)}return!0;case"clearCoatRoughness":if(e instanceof E.o){var re=parseFloat(n);isNaN(re)||e.setClearCoatConfiguration({isEnabled:!0,roughness:re})}else if(e instanceof O.l){var ie=parseFloat(n);isNaN(ie)||e.setClearCoatRoughness(ie)}return!0;case"fresnelDiffScale":if(e instanceof I.t||e instanceof D.K){var ae=parseFloat(n);isNaN(ae)||e.setFresnelDiffuseScale(ae)}return!0;case"fresnelDiffBias":if(e instanceof I.t||e instanceof D.K){var oe=parseFloat(n);isNaN(oe)||e.setFresnelDiffuseBias(oe)}return!0;case"fresnelDiffPower":if(e instanceof I.t||e instanceof D.K){var se=parseFloat(n);isNaN(se)||e.setFresnelDiffusePower(se)}return!0;case"fresnelEnvBias":if(e instanceof I.t||e instanceof D.K){var ue=parseFloat(n);isNaN(ue)||e.setFresnelEnvMapBias(ue)}return!0;case"fresnelEnvScale":if(e instanceof I.t||e instanceof D.K){var ce=parseFloat(n);isNaN(ce)||e.setFresnelEnvMapScale(ce)}return!0;case"fresnelEnvPower":if(e instanceof I.t||e instanceof D.K){var le=parseFloat(n);isNaN(le)||e.setFresnelEnvMapPower(le)}return!0;case"glossiness":if(e instanceof E.o){var he=parseFloat(n);isNaN(he)||e.setMicroSurface(he)}else if(e instanceof D.K){var fe=parseFloat(n);isNaN(fe)||e.setGlossiness(fe)}return!0}switch(l){case"shininess":if(e instanceof E.o){var me=parseInt(n,10);if(!isNaN(me)){var pe=me/100;e.setSpecularIntensity(pe)}}else if(e instanceof R.u){var de=parseInt(n,10);isNaN(de)||e.setShininess(de)}return!0;case"renderOrder":var ve=parseInt(n,10);if(!isNaN(ve))(e.getMetaData()||{}).renderOrder=ve;return!0;case"renderLayer":var ye=parseInt(n,10);if(!isNaN(ye))(e.getMetaData()||{}).renderLayer=ye;return!0}switch(l){case"envMapScale":if(e instanceof E.o){var ge=parseFloat(n);isNaN(ge)||e.setEnvironmentBdrfMapScale(new j.I(ge,ge))}else if(e instanceof I.t||e instanceof D.K){var be=parseFloat(n);isNaN(be)||e.setEnvMapScale(new j.I(be,be))}return!0;case"normalScale":case"normalMapScale":if(e instanceof E.o){var Ae=parseFloat(n);isNaN(Ae)||e.setNormalScale(new j.I(Ae,Ae))}else if(e instanceof P.r||e instanceof R.u){var _e=parseFloat(n);isNaN(_e)||e.setNormalScale(new j.I(_e,_e))}return!0}switch(l){case"color":case"diffuse":case"diffuseColor":return(e instanceof N.k||e instanceof E.o||e instanceof L.r||e instanceof C._||e instanceof P.r||e instanceof z.S)&&(isNaN(n)||e.setDiffuseColor(this.intToColor3(n))),!0;case"emissive":case"emissiveColor":return(e instanceof E.o||e instanceof L.r||e instanceof R.u||e instanceof P.r)&&(isNaN(n)||e.setEmissiveColor(this.intToColor3(n))),!0;case"specular":case"specularColor":return e instanceof E.o?isNaN(n)||e.setSpecularColor(this.intToColor3(n)):(e instanceof R.u||e instanceof D.K)&&(isNaN(n)||e.setSpecular(this.intToColor3(n))),!0;case"fresnelDiffColorLeft":return(e instanceof I.t||e instanceof D.K)&&(isNaN(n)||e.setFresnelDiffuseColor(this.intToColor3(n))),!0}switch(l){case"alphaMap":return a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a={properties:{useRGBasAlpha:!0}};if(e instanceof E.o){var s=e.getAlphaMap();if(s&&u&&o.disposeTexture(i,s,c),null==n)return e.setAlphaMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setAlphaMap(t)}),(function(t){d.UX.error(t),e.setAlphaMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else if(e instanceof L.r||e instanceof C._||e instanceof P.r){var l=e.getAlphaMap();if(l&&u&&o.disposeTexture(i,l,c),null==n)return e.setAlphaMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setAlphaMap(t)}),(function(t){d.UX.error(t),e.setAlphaMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else t(!1)})));case 1:case"end":return t.stop()}}),t)})))),!0;case"aoMap":return a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a={properties:{uvChannel:1}};if(e instanceof E.o){a.properties.level=e.getAoIntensity();var s=e.getAoMap();if(s&&u&&o.disposeTexture(i,s,c),null==n)return e.setAoMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setAoMap(t)}),(function(t){d.UX.error(t),e.setAoMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else if(e instanceof L.r||e instanceof C._||e instanceof P.r){a.properties.level=e.getAoIntensity();var l=e.getAoMap();if(l&&u&&o.disposeTexture(i,l,c),null==n)return e.setAoMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setAoMap(t)}),(function(t){d.UX.error(t),e.setAoMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else t(!1)})));case 1:case"end":return t.stop()}}),t)})))),!0;case"lightMap":return a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a={properties:{uvChannel:1}};if(e instanceof E.o){a.properties.level=e.getLightMapIntensity();var s=e.getLightMap();if(s&&u&&o.disposeTexture(i,s,c),null==n)return e.setLightMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setLightMap(t)}),(function(t){d.UX.error(t),e.setLightMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else if(e instanceof L.r||e instanceof R.u||e instanceof P.r){a.properties.level=e.getLightMapIntensity();var l=e.getLightMap();if(l&&u&&o.disposeTexture(i,l,c),null==n)return e.setLightMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setLightMap(t)}),(function(t){d.UX.error(t),e.setLightMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else t(!1)})));case 1:case"end":return t.stop()}}),t)})))),!0;case"map":case"diffuseMap":return a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a={properties:{}};if(e instanceof E.o){var s=e.getDiffuseMap();if(s&&u&&o.disposeTexture(i,s,c),null==n)return e.setDiffuseMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setDiffuseMap(t)}),(function(t){d.UX.error(t),e.setDiffuseMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else if(e instanceof L.r||e instanceof C._||e instanceof P.r){var l=e.getDiffuseMap();if(l&&u&&o.disposeTexture(i,l,c),null==n)return e.setDiffuseMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setDiffuseMap(t)}),(function(t){d.UX.error(t),e.setDiffuseMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else t(!1)})));case 1:case"end":return t.stop()}}),t)})))),!0;case"specularMap":return a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a={properties:{}};if(e instanceof E.o){a.properties.level=e.getSpecularIntensity();var s=e.getSpecularMap();if(s&&u&&o.disposeTexture(i,s,c),null==n)return e.setSpecularMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setSpecularMap(t)}),(function(t){d.UX.error(t),e.setSpecularMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else if(e instanceof L.r||e instanceof C._){var l=e.getSpecularMap();if(l&&u&&o.disposeTexture(i,l,c),null==n)return e.setSpecularMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setSpecularMap(t)}),(function(t){d.UX.error(t),e.setSpecularMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else t(!1)})));case 1:case"end":return t.stop()}}),t)})))),!0;case"emissiveMap":return a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a={properties:{}};if(e instanceof E.o){a.properties.level=e.getEmissiveIntensity();var s=e.getEmissiveMap();if(s&&u&&o.disposeTexture(i,s,c),null==n)return e.setEmissiveMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setEmissiveMap(t)}),(function(t){d.UX.error(t),e.setEmissiveMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else if(e instanceof L.r||e instanceof R.u||e instanceof P.r){a.properties.level=e.getEmissiveIntensity();var l=e.getEmissiveMap();if(l&&u&&o.disposeTexture(i,l,c),null==n)return e.setEmissiveMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setEmissiveMap(t)}),(function(t){d.UX.error(t),e.setEmissiveMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else t(!1)})));case 1:case"end":return t.stop()}}),t)})))),!0;case"bumpMap":return a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a={properties:{}};if(e instanceof E.o){a.properties.level=e.getNormalScale().x;var s=e.getNormalMap();if(s&&u&&o.disposeTexture(i,s,c),null==n)return e.setNormalMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setNormalMap(t)}),(function(t){d.UX.error(t),e.setNormalMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else if(e instanceof R.u||e instanceof P.r){a.properties.level=e.getBumpScale();var l=e.getBumpMap();if(l&&u&&o.disposeTexture(i,l,c),null==n)return e.setBumpMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setBumpMap(t)}),(function(t){d.UX.error(t),e.setBumpMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else t(!1)})));case 1:case"end":return t.stop()}}),t)})))),!0;case"displacementMap":return a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a={properties:{}};if(e instanceof E.o){if(a.properties.level=e.getParallaxScaleBias(),!e.getNormalMap()){if(null==n)return e.setFlags({useParallax:!1}),e.setNormalMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setFlags({useParallax:!0,useParallaxOcclusion:!1}),e.setNormalMap(t)}),(function(t){d.UX.error(t),e.setFlags({useParallax:!1}),e.setNormalMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}}else if(e instanceof R.u||e instanceof P.r){a.properties.level=e.getDisplacementScale();var s=e.getDisplacementMap();if(s&&u&&o.disposeTexture(i,s,c),null==n)return e.setDisplacementMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setDisplacementMap(t)}),(function(t){d.UX.error(t),e.setDisplacementMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else t(!1)})));case 1:case"end":return t.stop()}}),t)})))),!0;case"normalMap":return a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a={properties:{}};if(e instanceof E.o){a.properties.level=e.getNormalScale().x;var s=e.getNormalMap();if(s&&u&&o.disposeTexture(i,s,c),null==n)return e.setNormalMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setNormalMap(t)}),(function(t){d.UX.error(t),e.setNormalMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else if(e instanceof R.u||e instanceof P.r){a.properties.level=e.getNormalScale().x;var l=e.getNormalMap();if(l&&u&&o.disposeTexture(i,l,c),null==n)return e.setNormalMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setNormalMap(t)}),(function(t){d.UX.error(t),e.setNormalMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else t(!1)})));case 1:case"end":return t.stop()}}),t)})))),!0;case"metalnessMap":return a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a={properties:{level:1}};if(e instanceof E.o){a.properties.level=e.getMetalness();var s=e.getMetalnessMap();if(s&&u&&o.disposeTexture(i,s,c),null==n)return e.setMetalnessMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setMetalnessMap(t)}),(function(t){d.UX.error(t),e.setMetalnessMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else if(e instanceof P.r){a.properties.level=e.getMetalness();var l=e.getMetalnessMap();if(l&&u&&o.disposeTexture(i,l,c),null==n)return e.setMetalnessMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setMetalnessMap(t)}),(function(t){d.UX.error(t),e.setMetalnessMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else t(!1)})));case 1:case"end":return t.stop()}}),t)})))),!0;case"roughnessMap":return a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a={properties:{level:1}};if(e instanceof E.o){a.properties.level=e.getRoughness();var s=e.getMicroSurfaceMap();if(s&&u&&o.disposeTexture(i,s,c),null==n)return e.setMicroSurfaceMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setMicroSurfaceMap(t)}),(function(t){d.UX.error(t),e.setMicroSurfaceMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else if(e instanceof P.r){a.properties.level=e.getRoughness();var l=e.getRoughnessMap();if(l&&u&&o.disposeTexture(i,l,c),null==n)return e.setRoughnessMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setRoughnessMap(t)}),(function(t){d.UX.error(t),e.setRoughnessMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else t(!1)})));case 1:case"end":return t.stop()}}),t)})))),!0;case"gradientMap":return!1;case"glossinessMap":return a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a={properties:{}};if(e instanceof E.o){a.properties.level=e.getMicroSurface();var s=e.getMicroSurfaceMap();if(s&&u&&o.disposeTexture(i,s,c),null==n)return e.setMicroSurfaceMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setMicroSurfaceMap(t)}),(function(t){d.UX.error(t),e.setMicroSurfaceMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else if(e instanceof D.K){a.properties.level=e.getGlossiness();var l=e.getGlossinessMap();if(l&&u&&o.disposeTexture(i,l,c),null==n)return e.setGlossinessMap(null),t(!0);o.loadTexture2d(i,n,a,r,c).then((function(t){e.setGlossinessMap(t)}),(function(t){d.UX.error(t),e.setGlossinessMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else t(!1)})));case 1:case"end":return t.stop()}}),t)})))),!0;case"envMap":return a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a=(r&&r.name?r.name:"").includes("enable_refraction_e"),s={properties:{mapping:U.C$.Equirectangular,renderMode:a?U.fG.Refract:U.fG.Reflect}};if(e instanceof E.o){s.properties.level=e.getEnvironmentIntensity();var l=e.getReflectionMap();if(l&&u&&o.disposeTexture(i,l,c),null==n)return e.setReflectionMap(null),t(!0);o.loadTexture2d(i,n,s,r,c).then((function(t){e.setReflectionMap(t)}),(function(t){d.UX.error(t),e.setReflectionMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else if(e instanceof L.r||e instanceof C._||e instanceof P.r){(e instanceof R.u||e instanceof P.r)&&(s.properties.level=e.getEnvMapIntensity());var h=e.getEnvMap();if(h&&u&&o.disposeTexture(i,h,c),null==n)return e.setEnvMap(null),t(!0);o.loadTexture2d(i,n,s,r,c).then((function(t){e.setEnvMap(t)}),(function(t){d.UX.error(t),e.setEnvMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))}else t(!1)})));case 1:case"end":return t.stop()}}),t)})))),!0}return!1}}])}(B),q=n(32221),W=n(41840),K=n(94273),X=n(33153);n(25428);function Y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Y=function(){return!!e})()}var $=function(e){function t(){var e,n,r,a;(0,i.A)(this,t);for(var s=arguments.length,l=new Array(s),h=0;h<s;h++)l[h]=arguments[h];return n=this,r=t,a=[].concat(l),r=(0,c.A)(r),e=(0,u.A)(n,Y()?Reflect.construct(r,a||[],(0,c.A)(n).constructor):r.apply(n,a)),(0,o.A)(e,"mSupportedProperties",["useAlphaFromDiffuseMap","ambientColor","aoMapImpactOnAnalyticalLights","directLightIntensity","environmentIntensity","environmentBrdfMap","environmentBrdfMapScale","parallaxScaleBias","reflectionColor","reflectionMap","specularIntensity","twoSidedLighting","unlit","reflectanceMap","microSurface","microSurfaceMap","metalnessF0Factor","metallicReflectanceColor","metallicReflectanceMap","useSpecularGlossinessWorkflow","brdfConfiguration","detailMapConfiguration","clearCoatConfiguration","sheenConfiguration","anisotropicConfiguration","subSurfaceConfiguration","iridescenceConfiguration","flags"]),(0,o.A)(e,"mSupportedGroups",["brdfConfiguration","detailMapConfiguration","clearCoatConfiguration","sheenConfiguration","anisotropicConfiguration","subSurfaceConfiguration","iridescenceConfiguration","flags"]),e}return(0,h.A)(t,e),(0,a.A)(t,[{key:"mapKey",value:function(e){return e}},{key:"mapGroupKey",value:function(e){return e}},{key:"handle",value:function(e,t,n,r,i,a){var u=this,c=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],l=arguments.length>7?arguments[7]:void 0,h=this.mapKey((0,v.fL)(t)),f=this.getGroup(h);if(!(e instanceof E.o))return!0;switch(f){case"ambientColor":return e.setAmbientColor(this.intToColor3(n)),!0;case"useAlphaFromDiffuseMap":return e.useAlphaFromDiffuseMap((0,v.Hn)(n)),!0;case"aoMapImpactOnAnalyticalLights":return(0,v.yA)(n)<=0?e.setAoMapImpactOnAnalyticalLights(0):e.setAoMapImpactOnAnalyticalLights(1),!0;case"directLightIntensity":var p=(0,v.nC)(n);return isNaN(p)||e.setDirectLightIntensity(p),!0;case"environmentIntensity":var y=(0,v.nC)(n);return isNaN(y)||e.setEnvironmentIntensity(y),!0;case"environmentBrdfMapScale":var g=(0,v.nC)(n);return isNaN(g)||e.setEnvironmentBdrfMapScale(new j.I(g,g)),!0;case"parallaxScaleBias":var b=(0,v.nC)(n);return isNaN(b)||e.setParallaxScaleBias(b),!0;case"reflectionColor":return e.setReflectionColor(this.intToColor3(n)),!0;case"specularIntensity":var A=(0,v.nC)(n);return isNaN(A)||e.setSpecularIntensity(A),!0;case"twoSidedLighting":return e.setTwoSidedLighting((0,v.Hn)(n)),!0;case"unlit":return e.setUnlit((0,v.Hn)(n)),!0;case"reflectanceMap":return(0,v.hX)(n)||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a=e.getReflectanceMap();a&&c&&u.disposeTexture(i,a,l),u.loadTexture2d(i,n,{},r,l).then((function(t){e.setReflectanceMap(t)}),(function(t){d.UX.error(t),e.setReflectanceMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)})))),!0;case"microSurface":var _=(0,v.nC)(n);return isNaN(_)||e.setMicroSurface(_),!0;case"metalnessF0Factor":var M=(0,v.nC)(n);return isNaN(M)||e.setMetalnessF0Factor(M),!0;case"metallicReflectanceColor":return e.setMetallicReflectanceColor(this.intToColor3(n)),!0;case"useSpecularGlossinessWorkflow":return e.useSpecularGlossinessWorkflow((0,v.Hn)(n)),!0;case"metallicReflectanceMap":return(0,v.hX)(n)||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a=e.getMetallicReflectanceMap();a&&c&&u.disposeTexture(i,a,l),u.loadTexture2d(i,n,{},r,l).then((function(t){e.setMetallicReflectanceMap(t)}),(function(t){d.UX.error(t),e.setMetallicReflectanceMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)})))),!0;case"environmentBrdfMap":return(0,v.hX)(n)||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a=e.getEnvironmentBrdfMap();a&&c&&u.disposeTexture(i,a,l),u.loadTexture2d(i,n,{},r,l).then((function(t){e.setEnvironmentBrdfMap(t)}),(function(t){d.UX.error(t),e.setEnvironmentBrdfMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)})))),!0;case"reflectionMap":return(0,v.hX)(n)||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a=e.getReflectionMap();a&&c&&u.disposeTexture(i,a,l),u.loadTexture2d(i,n,{},r,l).then((function(t){e.setReflectionMap(t)}),(function(t){d.UX.error(t),e.setReflectionMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)})))),!0;case"microSurfaceMap":return(0,v.hX)(n)||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var a=e.getMicroSurfaceMap();a&&c&&u.disposeTexture(i,a,l),u.loadTexture2d(i,n,{},r,l).then((function(t){e.setMicroSurfaceMap(t)}),(function(t){d.UX.error(t),e.setMicroSurfaceMap(null)})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)})))),!0}switch(f){case"brdfConfiguration":return(this.hasGroupInPropertyName(this.mapKey((0,v.fL)(t)))?[(0,o.A)({},this.getPropertyName(h),n)]:Object.entries(n||{}).map((function(e){return(0,o.A)({},(0,v.fL)(e[0]),e[1])}))).forEach((function(t){var n=Object.entries(t)[0],r=n[0],i=n[1];switch(r){case"useEnergyConservation":e.setBrdfConfiguration({useEnergyConservation:(0,v.Hn)(i)});break;case"useSpecularGlossinessInputEnergyConservation":e.setBrdfConfiguration({useSpecularGlossinessInputEnergyConservation:(0,v.Hn)(i)})}})),!0;case"detailMapConfiguration":return(this.hasGroupInPropertyName(this.mapKey((0,v.fL)(t)))?[(0,o.A)({},this.getPropertyName(h),n)]:Object.entries(n||{}).map((function(e){return(0,o.A)({},(0,v.fL)(e[0]),e[1])}))).forEach((function(t){var n=Object.entries(t)[0],o=n[0],h=n[1];switch(o){case"isEnabled":e.setDetailMapConfiguration({isEnabled:(0,v.Hn)(h)});break;case"map":(0,v.hX)(h)&&!e.getDetailMapConfiguration().map||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=e.getDetailMapConfiguration().map;if(n&&c&&u.disposeTexture(i,n,l),(0,v.hX)(h))return e.setDetailMapConfiguration({map:null}),t(!0);u.loadTexture2d(i,h,{},r,l).then((function(t){return e.setDetailMapConfiguration({map:t})}),(function(t){d.UX.error(t),e.setDetailMapConfiguration({map:null})})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)}))));break;case"diffuseBlendLevel":e.setDetailMapConfiguration({diffuseBlendLevel:(0,v.nC)(h)});break;case"roughnessBlendLevel":e.setDetailMapConfiguration({roughnessBlendLevel:(0,v.nC)(h)});break;case"bumpLevel":e.setDetailMapConfiguration({bumpLevel:(0,v.nC)(h)});break;case"normalBlendMethod":e.setDetailMapConfiguration({normalBlendMethod:(0,v.nC)(h)})}})),!0;case"clearCoatConfiguration":return(this.hasGroupInPropertyName(this.mapKey((0,v.fL)(t)))?[(0,o.A)({},this.getPropertyName(h),n)]:Object.entries(n||{}).map((function(e){return(0,o.A)({},(0,v.fL)(e[0]),e[1])}))).forEach((function(t){var n=Object.entries(t)[0],o=n[0],h=n[1];switch(o){case"isEnabled":e.setClearCoatConfiguration({isEnabled:(0,v.Hn)(h)});break;case"intensity":e.setClearCoatConfiguration({intensity:(0,v.nC)(h)});break;case"roughness":e.setClearCoatConfiguration({roughness:(0,v.nC)(h)});break;case"indexOfRefraction":e.setClearCoatConfiguration({indexOfRefraction:(0,v.nC)(h)});break;case"map":(0,v.hX)(h)&&!e.getClearCoatConfiguration().map||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=e.getClearCoatConfiguration().map;if(n&&c&&u.disposeTexture(i,n,l),(0,v.hX)(h))return e.setClearCoatConfiguration({map:null}),t(!0);u.loadTexture2d(i,h,{},r,l).then((function(t){return e.setClearCoatConfiguration({map:t})}),(function(t){d.UX.error(t),e.setClearCoatConfiguration({map:null})})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)}))));break;case"useRoughnessFromMainMap":e.setClearCoatConfiguration({useRoughnessFromMainMap:(0,v.Hn)(h)});break;case"roughnessMap":(0,v.hX)(h)&&!e.getClearCoatConfiguration().roughnessMap||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=e.getClearCoatConfiguration().roughnessMap;if(n&&c&&u.disposeTexture(i,n,l),(0,v.hX)(h))return e.setClearCoatConfiguration({roughnessMap:null}),t(!0);u.loadTexture2d(i,h,{},r,l).then((function(t){return e.setClearCoatConfiguration({roughnessMap:t})}),(function(t){d.UX.error(t),e.setClearCoatConfiguration({roughnessMap:null})})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)}))));break;case"remapF0OnInterfaceChange":e.setClearCoatConfiguration({remapF0OnInterfaceChange:(0,v.Hn)(h)});break;case"bumpMap":(0,v.hX)(h)&&!e.getClearCoatConfiguration().bumpMap||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=e.getClearCoatConfiguration().bumpMap;if(n&&c&&u.disposeTexture(i,n,l),(0,v.hX)(h))return e.setClearCoatConfiguration({bumpMap:null}),t(!0);u.loadTexture2d(i,h,{},r,l).then((function(t){return e.setClearCoatConfiguration({bumpMap:t})}),(function(t){d.UX.error(t),e.setClearCoatConfiguration({bumpMap:null})})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)}))));break;case"isTintEnabled":e.setClearCoatConfiguration({isTintEnabled:(0,v.Hn)(h)});break;case"tintColor":e.setClearCoatConfiguration({tintColor:u.intToColor3(h)});break;case"tintColorAtDistance":e.setClearCoatConfiguration({tintColorAtDistance:(0,v.nC)(h)});break;case"tintThickness":e.setClearCoatConfiguration({tintThickness:(0,v.nC)(h)});break;case"tintMap":(0,v.hX)(h)&&!e.getClearCoatConfiguration().tintMap||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=e.getClearCoatConfiguration().tintMap;if(n&&c&&u.disposeTexture(i,n,l),(0,v.hX)(h))return e.setClearCoatConfiguration({tintMap:null}),t(!0);u.loadTexture2d(i,h,{},r,l).then((function(t){return e.setClearCoatConfiguration({tintMap:t})}),(function(t){d.UX.error(t),e.setClearCoatConfiguration({tintMap:null})})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)}))))}})),!0;case"sheenConfiguration":return(this.hasGroupInPropertyName(this.mapKey((0,v.fL)(t)))?[(0,o.A)({},this.getPropertyName(h),n)]:Object.entries(n||{}).map((function(e){return(0,o.A)({},(0,v.fL)(e[0]),e[1])}))).forEach((function(t){var n=Object.entries(t)[0],o=n[0],h=n[1];switch(o){case"isEnabled":e.setSheenConfiguration({isEnabled:(0,v.Hn)(h)});break;case"linkSheenWithDiffuse":e.setSheenConfiguration({linkSheenWithDiffuse:(0,v.Hn)(h)});break;case"intensity":e.setSheenConfiguration({intensity:(0,v.nC)(h)});break;case"color":e.setSheenConfiguration({color:u.intToColor3(h)});break;case"map":(0,v.hX)(h)&&!e.getSheenConfiguration().map||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=e.getSheenConfiguration().map;if(n&&c&&u.disposeTexture(i,n,l),(0,v.hX)(h))return e.setSheenConfiguration({map:null}),t(!0);u.loadTexture2d(i,h,{},r,l).then((function(t){return e.setSheenConfiguration({map:t})}),(function(t){d.UX.error(t),e.setSheenConfiguration({map:null})})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)}))));break;case"useRoughnessFromMainMap":e.setSheenConfiguration({useRoughnessFromMainMap:(0,v.Hn)(h)});break;case"roughness":var f=(0,v.nC)(h);e.setSheenConfiguration({roughness:isNaN(f)?null:f});break;case"roughnessMap":(0,v.hX)(h)&&!e.getSheenConfiguration().roughnessMap||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=e.getSheenConfiguration().roughnessMap;if(n&&c&&u.disposeTexture(i,n,l),(0,v.hX)(h))return e.setSheenConfiguration({roughnessMap:null}),t(!0);u.loadTexture2d(i,h,{},r,l).then((function(t){return e.setSheenConfiguration({roughnessMap:t})}),(function(t){d.UX.error(t),e.setSheenConfiguration({roughnessMap:null})})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)}))));break;case"diffuseScaling":e.setSheenConfiguration({diffuseScaling:(0,v.Hn)(h)})}})),!0;case"anisotropicConfiguration":return(this.hasGroupInPropertyName(this.mapKey((0,v.fL)(t)))?[(0,o.A)({},this.getPropertyName(h),n)]:Object.entries(n||{}).map((function(e){return(0,o.A)({},(0,v.fL)(e[0]),e[1])}))).forEach((function(t){var n=Object.entries(t)[0],o=n[0],h=n[1];switch(o){case"isEnabled":e.setAnisotropicConfiguration({isEnabled:(0,v.Hn)(h)});break;case"intensity":e.setAnisotropicConfiguration({intensity:(0,v.nC)(h)});break;case"direction":var f=new j.I(1,0);Array.isArray(h)?(f.x=(0,v.nC)(h[0]),f.y=(0,v.nC)(h[1])):Number.isFinite((0,v.nC)(null==h?void 0:h.direction_x))&&(f.x=(0,v.nC)(h.direction_x),f.y=(0,v.nC)(h.direction_y)),e.setAnisotropicConfiguration({direction:f});break;case"map":(0,v.hX)(h)&&!e.getAnisotropicConfiguration().map||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=e.getAnisotropicConfiguration().map;if(n&&c&&u.disposeTexture(i,n,l),(0,v.hX)(h))return e.setAnisotropicConfiguration({map:null}),t(!0);u.loadTexture2d(i,h,{},r,l).then((function(t){return e.setAnisotropicConfiguration({map:t})}),(function(t){d.UX.error(t),e.setAnisotropicConfiguration({map:null})})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)}))))}})),!0;case"subSurfaceConfiguration":return(this.hasGroupInPropertyName(this.mapKey((0,v.fL)(t)))?[(0,o.A)({},this.getPropertyName(h),n)]:Object.entries(n||{}).map((function(e){return(0,o.A)({},(0,v.fL)(e[0]),e[1])}))).forEach((function(t){var n=Object.entries(t)[0],o=n[0],h=n[1];switch(o){case"isRefractionEnabled":e.setSubSurfaceConfiguration({isRefractionEnabled:(0,v.Hn)(h)});break;case"isTranslucencyEnabled":e.setSubSurfaceConfiguration({isTranslucencyEnabled:(0,v.Hn)(h)});break;case"isScatteringEnabled":e.setSubSurfaceConfiguration({isScatteringEnabled:(0,v.Hn)(h)});break;case"scatteringDiffusionProfile":var f=(0,v.kf)(h);e.setSubSurfaceConfiguration({scatteringDiffusionProfile:f?u.intToColor3(h):null});break;case"refractionIntensity":e.setSubSurfaceConfiguration({refractionIntensity:(0,v.nC)(h)});break;case"translucencyIntensity":e.setSubSurfaceConfiguration({translucencyIntensity:(0,v.nC)(h)});break;case"useDiffuseToTintRefraction":e.setSubSurfaceConfiguration({useDiffuseToTintRefraction:(0,v.Hn)(h)});break;case"useDiffuseToTintTranslucency":e.setSubSurfaceConfiguration({useDiffuseToTintTranslucency:(0,v.Hn)(h)});break;case"thicknessMap":(0,v.hX)(h)&&!e.getSubSurfaceConfiguration().thicknessMap||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=e.getSubSurfaceConfiguration().thicknessMap;if(n&&c&&u.disposeTexture(i,n,l),(0,v.hX)(h))return e.setSubSurfaceConfiguration({thicknessMap:null}),t(!0);u.loadTexture2d(i,h,{},r,l).then((function(t){return e.setSubSurfaceConfiguration({thicknessMap:t})}),(function(t){d.UX.error(t),e.setSubSurfaceConfiguration({thicknessMap:null})})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)}))));break;case"indexOfRefraction":e.setSubSurfaceConfiguration({indexOfRefraction:(0,v.nC)(h)});break;case"volumeIndexOfRefraction":e.setSubSurfaceConfiguration({volumeIndexOfRefraction:(0,v.nC)(h)});break;case"linkRefractionWithTransparency":e.setSubSurfaceConfiguration({linkRefractionWithTransparency:(0,v.Hn)(h)});break;case"minimumThickness":e.setSubSurfaceConfiguration({minimumThickness:(0,v.nC)(h)});break;case"maximumThickness":e.setSubSurfaceConfiguration({maximumThickness:(0,v.nC)(h)});break;case"useThicknessAsDepth":e.setSubSurfaceConfiguration({useThicknessAsDepth:(0,v.Hn)(h)});break;case"tintColor":e.setSubSurfaceConfiguration({tintColor:u.intToColor3(h)});break;case"tintColorAtDistance":e.setSubSurfaceConfiguration({tintColorAtDistance:(0,v.nC)(h)});break;case"diffusionDistance":e.setSubSurfaceConfiguration({diffusionDistance:u.intToColor3(h)});break;case"useMaskFromThicknessMap":e.setSubSurfaceConfiguration({useMaskFromThicknessMap:(0,v.Hn)(h)});break;case"translucencyIntensityMap":(0,v.hX)(h)&&!e.getSubSurfaceConfiguration().translucencyIntensityMap||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=e.getSubSurfaceConfiguration().translucencyIntensityMap;if(n&&c&&u.disposeTexture(i,n,l),(0,v.hX)(h))return e.setSubSurfaceConfiguration({translucencyIntensityMap:null}),t(!0);u.loadTexture2d(i,h,{},r,l).then((function(t){return e.setSubSurfaceConfiguration({translucencyIntensityMap:t})}),(function(t){d.UX.error(t),e.setSubSurfaceConfiguration({translucencyIntensityMap:null})})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)}))))}})),!0;case"iridescenceConfiguration":return(this.hasGroupInPropertyName(this.mapKey((0,v.fL)(t)))?[(0,o.A)({},this.getPropertyName(h),n)]:Object.entries(n||{}).map((function(e){return(0,o.A)({},(0,v.fL)(e[0]),e[1])}))).forEach((function(t){var n=Object.entries(t)[0],o=n[0],h=n[1];switch(o){case"isEnabled":e.setIridescenceConfiguration({isEnabled:(0,v.Hn)(h)});break;case"intensity":e.setIridescenceConfiguration({intensity:(0,v.nC)(h)});break;case"minimumThickness":e.setIridescenceConfiguration({minimumThickness:(0,v.nC)(h)});break;case"maximumThickness":e.setIridescenceConfiguration({maximumThickness:(0,v.nC)(h)});break;case"indexOfRefraction":e.setIridescenceConfiguration({indexOfRefraction:(0,v.nC)(h)});break;case"map":(0,v.hX)(h)&&!e.getIridescenceConfiguration().map||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=e.getIridescenceConfiguration().map;if(n&&c&&u.disposeTexture(i,n,l),(0,v.hX)(h))return e.setIridescenceConfiguration({map:null}),t(!0);u.loadTexture2d(i,h,{},r,l).then((function(t){return e.setIridescenceConfiguration({map:t})}),(function(t){d.UX.error(t),e.setIridescenceConfiguration({map:null})})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)}))));break;case"thicknessMap":(0,v.hX)(h)&&!e.getIridescenceConfiguration().thicknessMap||a.push((0,s.A)(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=e.getIridescenceConfiguration().thicknessMap;if(n&&c&&u.disposeTexture(i,n,l),(0,v.hX)(h))return e.setIridescenceConfiguration({thicknessMap:null}),t(!0);u.loadTexture2d(i,h,{},r,l).then((function(t){return e.setIridescenceConfiguration({thicknessMap:t})}),(function(t){d.UX.error(t),e.setIridescenceConfiguration({thicknessMap:null})})).then((function(){return t(!0)}),(function(){return t(!1)}))})));case 1:case"end":return t.stop()}}),t)}))))}})),!0;case"flags":return(this.hasGroupInPropertyName(this.mapKey((0,v.fL)(t)))?[(0,o.A)({},this.getPropertyName(h),n)]:Object.entries(n||{}).map((function(e){return(0,o.A)({},(0,v.fL)(e[0]),e[1])}))).forEach((function(t){var n=Object.entries(t)[0],r=n[0],i=n[1];switch(r){case"useAlphaFresnel":e.setFlags({useAlphaFresnel:(0,v.Hn)(i)});break;case"useAlphaFromDiffuseMap":e.setFlags({useAlphaFromDiffuseMap:(0,v.Hn)(i)});break;case"useAmbientInGrayScale":e.setFlags({useAmbientInGrayScale:(0,v.Hn)(i)});break;case"useAmbientOcclusionFromMetallicMapRed":e.setFlags({useAmbientOcclusionFromMetallicMapRed:(0,v.Hn)(i)});break;case"useAutoMicroSurfaceFromReflectivityMap":e.setFlags({useAutoMicroSurfaceFromReflectivityMap:(0,v.Hn)(i)});break;case"useLightmapAsShadowmap":e.setFlags({useLightmapAsShadowmap:(0,v.Hn)(i)});break;case"useLinearAlphaFresnel":e.setFlags({useLinearAlphaFresnel:(0,v.Hn)(i)});break;case"useMetalnessFromMetallicMapBlue":e.setFlags({useMetalnessFromMetallicMapBlue:(0,v.Hn)(i)});break;case"useMicroSurfaceFromReflectivityMapAlpha":e.setFlags({useMicroSurfaceFromReflectivityMapAlpha:(0,v.Hn)(i)});break;case"useParallax":e.setFlags({useParallax:(0,v.Hn)(i)});break;case"useParallaxOcclusion":e.setFlags({useParallaxOcclusion:(0,v.Hn)(i)});break;case"useHorizonOcclusion":e.setFlags({useHorizonOcclusion:(0,v.Hn)(i)});break;case"useRadianceOcclusion":e.setFlags({useRadianceOcclusion:(0,v.Hn)(i)});break;case"useRadianceOverAlpha":e.setFlags({useRadianceOverAlpha:(0,v.Hn)(i)});break;case"useRoughnessFromMetallicMapAlpha":e.setFlags({useRoughnessFromMetallicMapAlpha:(0,v.Hn)(i)});break;case"useRoughnessFromMetallicMapGreen":e.setFlags({useRoughnessFromMetallicMapGreen:(0,v.Hn)(i)});break;case"useSpecularAntiAliasing":e.setFlags({useSpecularAntiAliasing:(0,v.Hn)(i)});break;case"useSpecularOverAlpha":e.setFlags({useSpecularOverAlpha:(0,v.Hn)(i)});break;case"invertNormalMapX":e.setFlags({invertNormalMapX:(0,v.Hn)(i)});break;case"invertNormalMapY":e.setFlags({invertNormalMapY:(0,v.Hn)(i)});break;case"useOnlyMetallicFromMetallicReflectanceMap":e.setFlags({useOnlyMetallicFromMetallicReflectanceMap:(0,v.Hn)(i)});break;case"usePhysicalLightFalloff":e.setFlags({usePhysicalLightFalloff:(0,v.Hn)(i)})}})),!0}return!1}}])}(B);function Z(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Q(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Q(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var J=function(){function e(){(0,i.A)(this,e)}return(0,a.A)(e,null,[{key:"parseModel",value:(t=(0,s.A)(m().mark((function t(n,r,i){var a,o,s,u=arguments;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=!(u.length>3&&void 0!==u[3])||u[3],o=u.length>4?u[4]:void 0,s=[],Object.keys(r).forEach((function(t){e.setMaterialProperty(n,t,r[t],r,i,s,a,o)&&W.K.eventBus().dispatch(new K.r(X.E.RequestFrame))})),t.prev=4,t.next=7,new Promise((function(e){q.N.resolveAll(s,(function(){e()}))}));case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(4),d.UX.error("Failed to parse material:",t.t0);case 12:return n.markDirty(),W.K.eventBus().dispatch(new K.r(X.E.RequestFrame)),t.abrupt("return",r);case 15:case"end":return t.stop()}}),t,null,[[4,9]])}))),function(e,n,r){return t.apply(this,arguments)})},{key:"setMaterialProperty",value:function(t,n,r,i,a,o){var s,u=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],c=arguments.length>7?arguments[7]:void 0,l=Z(e.mMaterialPropertyHandlers);try{for(l.s();!(s=l.n()).done;){var h=s.value;if(h.canHandle(n))return h.handle(t,n,r,i,a,o,u,c)}}catch(e){l.e(e)}finally{l.f()}return!1}},{key:"disposeMaterial",value:function(t,n,r){if(t instanceof E.o){e.disposeTexture(n,t.getDiffuseMap(),r),t.setDiffuseMap(null),e.disposeTexture(n,t.getAlphaMap(),r),t.setAlphaMap(null),e.disposeTexture(n,t.getNormalMap(),r),t.setNormalMap(null),e.disposeTexture(n,t.getAoMap(),r),t.setAoMap(null),e.disposeTexture(n,t.getEmissiveMap(),r),t.setEmissiveMap(null),e.disposeTexture(n,t.getEnvironmentBrdfMap(),r),t.setEnvironmentBrdfMap(null),e.disposeTexture(n,t.getLightMap(),r),t.setLightMap(null),e.disposeTexture(n,t.getReflectionMap(),r),t.setReflectionMap(null),e.disposeTexture(n,t.getSpecularMap(),r),t.setSpecularMap(null),e.disposeTexture(n,t.getReflectanceMap(),r),t.setReflectanceMap(null),e.disposeTexture(n,t.getMicroSurfaceMap(),r),t.setMicroSurfaceMap(null),e.disposeTexture(n,t.getMetalnessMap(),r),t.setMetalness(null),e.disposeTexture(n,t.getMetallicReflectanceMap(),r),t.setMetallicReflectanceMap(null);var i=t.getDetailMapConfiguration();e.disposeTexture(n,i.map,r),t.setDetailMapConfiguration({map:null});var a=t.getClearCoatConfiguration();e.disposeTexture(n,a.map,r),e.disposeTexture(n,a.bumpMap,r),e.disposeTexture(n,a.tintMap,r),e.disposeTexture(n,a.roughnessMap,r),t.setClearCoatConfiguration({map:null,bumpMap:null,tintMap:null,roughnessMap:null});var o=t.getSheenConfiguration();e.disposeTexture(n,o.map,r),e.disposeTexture(n,o.roughnessMap,r),t.setSheenConfiguration({map:null,roughnessMap:null});var s=t.getAnisotropicConfiguration();e.disposeTexture(n,s.map,r),t.setAnisotropicConfiguration({map:null});var u=t.getSubSurfaceConfiguration();e.disposeTexture(n,u.thicknessMap,r),e.disposeTexture(n,u.translucencyIntensityMap,r),t.setSubSurfaceConfiguration({thicknessMap:null,translucencyIntensityMap:null});var c=t.getIridescenceConfiguration();e.disposeTexture(n,c.map,r),e.disposeTexture(n,c.thicknessMap,r),t.setIridescenceConfiguration({map:null,thicknessMap:null})}t instanceof C._&&(e.disposeTexture(n,t.getDiffuseMap(),r),t.setDiffuseMap(null),e.disposeTexture(n,t.getAoMap(),r),t.setAoMap(null),e.disposeTexture(n,t.getSpecularMap(),r),t.setSpecularMap(null),e.disposeTexture(n,t.getAlphaMap(),r),t.setAlphaMap(null),e.disposeTexture(n,t.getEnvMap(),r),t.setEnvMap(null)),t instanceof R.u&&(e.disposeTexture(n,t.getBumpMap(),r),t.setBumpMap(null),e.disposeTexture(n,t.getNormalMap(),r),t.setNormalMap(null),e.disposeTexture(n,t.getDisplacementMap(),r),t.setDisplacementMap(null),e.disposeTexture(n,t.getLightMap(),r),t.setLightMap(null),e.disposeTexture(n,t.getEmissiveMap(),r),t.setEmissiveMap(null)),I.t,t instanceof P.r&&(e.disposeTexture(n,t.getDiffuseMap(),r),t.setDiffuseMap(null),e.disposeTexture(n,t.getAlphaMap(),r),t.setAlphaMap(null),e.disposeTexture(n,t.getAoMap(),r),t.setAoMap(null),e.disposeTexture(n,t.getBumpMap(),r),t.setBumpMap(null),e.disposeTexture(n,t.getDisplacementMap(),r),t.setDisplacementMap(null),e.disposeTexture(n,t.getEmissiveMap(),r),t.setEmissiveMap(null),e.disposeTexture(n,t.getEnvMap(),r),t.setEnvMap(null),e.disposeTexture(n,t.getLightMap(),r),t.setLightMap(null),e.disposeTexture(n,t.getMetalnessMap(),r),t.setMetalnessMap(null),e.disposeTexture(n,t.getNormalMap(),r),t.setNormalMap(null),e.disposeTexture(n,t.getRoughnessMap(),r),t.setRoughnessMap(null)),O.l,t instanceof D.K&&(e.disposeTexture(n,t.getSpecularMap(),r),t.setSpecularMap(null),e.disposeTexture(n,t.getGlossinessMap(),r),t.setGlossinessMap(null)),z.S,t.dispose()}},{key:"disposeTexture",value:function(e,t,n){t&&t instanceof U.gP&&e.disposeTexture(t,n)}}]);var t}();(0,o.A)(J,"mMaterialPropertyHandlers",[new G,new $]);var ee=n(94051),te=function(){return(0,a.A)((function e(){(0,i.A)(this,e),(0,o.A)(this,"mHandle",void 0),(0,o.A)(this,"mReferenceCount",0),(0,o.A)(this,"mLockDisposable",!1),(0,o.A)(this,"mDisposed",!1)}),[{key:"_setHandle",value:function(e){this.mHandle=e}},{key:"_getHandle",value:function(){return this.mHandle}},{key:"_increaseReferenceCount",value:function(){return++this.mReferenceCount}},{key:"_decreaseReferenceCount",value:function(){return this.mReferenceCount=Math.max(--this.mReferenceCount,0),this.mReferenceCount}},{key:"dispose",value:function(e){return!!this.mDisposed||!(this.mLockDisposable&&!e)&&(d.UX.print("Resource disposed:",this.mHandle._getHandle(),this.mHandle.getPoolKey(),this.mReferenceCount,e),!(0!==this.mReferenceCount&&!e)&&(this.mDisposed=!0,this.onDispose(e),!0))}},{key:"isDisposed",value:function(){return this.mDisposed}},{key:"_lockDisposable",value:function(e){this.mLockDisposable=e}},{key:"isLockedForDisposal",value:function(){return this.mLockDisposable}}])}(),ne=n(98168),re=n(49571);function ie(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ie=function(){return!!e})()}var ae=function(e){function t(e,n,r,a){var s,l,h,f;return(0,i.A)(this,t),l=this,h=t,h=(0,c.A)(h),s=(0,u.A)(l,ie()?Reflect.construct(h,f||[],(0,c.A)(l).constructor):h.apply(l,f)),(0,o.A)(s,"mId",void 0),(0,o.A)(s,"mForcedType",void 0),(0,o.A)(s,"mModel",void 0),(0,o.A)(s,"mMaterial",void 0),(0,o.A)(s,"mState",void 0),(0,o.A)(s,"mReadySubscriptions",[]),(0,o.A)(s,"mMaterialLoader",void 0),(0,o.A)(s,"mTextureManager",void 0),(0,o.A)(s,"mColorOverwrite",void 0),(0,o.A)(s,"mMapOverwrite",[]),(0,o.A)(s,"mForceSharedTextures",!1),"number"==typeof e?(s.mId=e,s.mState=k.Unloaded):(s.mMaterial=e,s.mState=k.Ready),s.mModel=r,s.mForcedType=a,s.mTextureManager=n,s}return(0,h.A)(t,e),(0,a.A)(t,[{key:"getModelId",value:function(){return this.mId}},{key:"setColorOverwrite",value:function(e){this.mColorOverwrite=e}},{key:"applyColorOverwrite",value:function(){if(this.mMaterial)if(this.mMaterial instanceof N.k||this.mMaterial instanceof E.o){var e=this.mColorOverwrite?this.mColorOverwrite:w.v.White();this.mMaterial.setDiffuseColor(e),this.mMaterial.markDirty()}else if(this.mMaterial instanceof L.r||this.mMaterial instanceof C._||this.mMaterial instanceof P.r){var t=this.mColorOverwrite?this.mColorOverwrite:w.v.White();this.mMaterial.setDiffuseColor(t),this.mMaterial.markDirty()}else d.UX.warn("Material not found to apply color overwrite.")}},{key:"setMapOverwrite",value:function(e,t){var n=this.getTextureProperties(e),r=this.mTextureManager.makeResource(t,n,this.mHandle.getPoolKey()),i=this.mMapOverwrite.findIndex((function(t){return t.type===e}));if(i>=0)return this.mMapOverwrite[i].handle&&this.mTextureManager.disposeResource(this.mMapOverwrite[i].handle),void(this.mMapOverwrite[i].handle=r);this.mMapOverwrite.push({type:e,handle:r})}},{key:"applyMapOverwrite",value:(r=(0,s.A)(m().mark((function e(t){var n=this;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){if(!n.mMaterial)return r(new Error("Material is not ready"));var i=n.mMapOverwrite.find((function(e){return e.type===t}));return i?i.handle?void n.mTextureManager.resolveResource(i.handle,(function(i){if(!i)return r(new Error("Disposed before applying overwrite!"));i instanceof ne.M&&n.applyMapOverwriteTexture(t,i),e()})).then((function(){})).catch((function(e){r(e)})):(n.applyMapOverwriteTexture(t),e()):r(new Error("No overwrite for type ".concat(t)))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"applyMapOverwriteTexture",value:function(e,t){try{switch(e){case ee.$.DIFFUSE:(this.mMaterial instanceof N.k||this.mMaterial instanceof E.o||this.mMaterial instanceof L.r||this.mMaterial instanceof C._||this.mMaterial instanceof P.r)&&this.mMaterial.setDiffuseMap(t);break;case ee.$.ALPHA:(this.mMaterial instanceof E.o||this.mMaterial instanceof L.r||this.mMaterial instanceof C._||this.mMaterial instanceof P.r)&&this.mMaterial.setAlphaMap(t);break;case ee.$.ENVIRONMENT:this.mMaterial instanceof E.o?this.mMaterial.setReflectionMap(t):(this.mMaterial instanceof L.r||this.mMaterial instanceof C._||this.mMaterial instanceof P.r)&&this.mMaterial.setEnvMap(t);break;case ee.$.BUMP:this.mMaterial instanceof E.o?this.mMaterial.setNormalMap(t):(this.mMaterial instanceof R.u||this.mMaterial instanceof P.r)&&this.mMaterial.setBumpMap(t);break;case ee.$.DISPLACEMENT:this.mMaterial instanceof E.o?this.mMaterial.setFlags({useParallax:!0}):(this.mMaterial instanceof R.u||this.mMaterial instanceof P.r)&&this.mMaterial.setDisplacementMap(t);break;case ee.$.NORMAL:(this.mMaterial instanceof E.o||this.mMaterial instanceof R.u||this.mMaterial instanceof P.r)&&this.mMaterial.setNormalMap(t);break;case ee.$.METALNESS:(this.mMaterial instanceof E.o||this.mMaterial instanceof P.r)&&this.mMaterial.setMetalnessMap(t);break;case ee.$.ROUGHNESS:this.mMaterial instanceof E.o?this.mMaterial.setMicroSurfaceMap(t):this.mMaterial instanceof P.r&&this.mMaterial.setRoughnessMap(t);break;case ee.$.AO:(this.mMaterial instanceof E.o||this.mMaterial instanceof L.r||this.mMaterial instanceof C._||this.mMaterial instanceof P.r)&&this.mMaterial.setAoMap(t);break;case ee.$.LIGHTMAP:(this.mMaterial instanceof E.o||this.mMaterial instanceof L.r||this.mMaterial instanceof R.u||this.mMaterial instanceof P.r)&&this.mMaterial.setLightMap(t);break;case ee.$.EMISSIVE:(this.mMaterial instanceof E.o||this.mMaterial instanceof L.r||this.mMaterial instanceof R.u||this.mMaterial instanceof P.r)&&this.mMaterial.setEmissiveMap(t);break;case ee.$.GLOSSINESS:this.mMaterial instanceof E.o?this.mMaterial.setMicroSurfaceMap(t):this.mMaterial instanceof D.K&&this.mMaterial.setGlossinessMap(t)}this.mMaterial.markDirty()}catch(e){}}},{key:"getTextureProperties",value:function(e){var t={properties:{},forceShared:!(!this.mModel||void 0===this.mModel.force_shared)&&this.mModel.force_shared};switch(e){case ee.$.ALPHA:t.properties.useRGBasAlpha=!0;break;case ee.$.AO:var n=1;(this.mMaterial instanceof E.o||this.mMaterial instanceof L.r||this.mMaterial instanceof C._||this.mMaterial instanceof P.r)&&(n=this.mMaterial.getAoIntensity()),t.properties.level=n,t.properties.uvChannel=1;break;case ee.$.LIGHTMAP:var r=1;(this.mMaterial instanceof E.o||this.mMaterial instanceof L.r||this.mMaterial instanceof R.u||this.mMaterial instanceof P.r)&&(r=this.mMaterial.getLightMapIntensity()),t.properties.level=r,t.properties.uvChannel=1;break;case ee.$.EMISSIVE:var i=1;(this.mMaterial instanceof E.o||this.mMaterial instanceof L.r||this.mMaterial instanceof R.u||this.mMaterial instanceof P.r)&&(i=this.mMaterial.getEmissiveIntensity()),t.properties.level=i;break;case ee.$.BUMP:var a=1;this.mMaterial instanceof E.o?a=this.mMaterial.getNormalScale().x:(this.mMaterial instanceof R.u||this.mMaterial instanceof P.r)&&(a=this.mMaterial.getBumpScale()),t.properties.level=a;break;case ee.$.NORMAL:var o=1;(this.mMaterial instanceof E.o||this.mMaterial instanceof R.u||this.mMaterial instanceof P.r)&&(o=this.mMaterial.getNormalScale().x),t.properties.level=o;break;case ee.$.DISPLACEMENT:var s=1;this.mMaterial instanceof E.o?s=this.mMaterial.getParallaxScaleBias():(this.mMaterial instanceof R.u||this.mMaterial instanceof P.r)&&(s=this.mMaterial.getDisplacementScale()),t.properties.level=s;break;case ee.$.GLOSSINESS:var u=1;this.mMaterial instanceof E.o?u=this.mMaterial.getMicroSurface():this.mMaterial instanceof D.K&&(u=this.mMaterial.getGlossiness()),t.properties.level=u;break;case ee.$.METALNESS:var c=this.mMaterial instanceof E.o||this.mMaterial instanceof P.r?this.mMaterial.getMetalness():1;t.properties.level=c;break;case ee.$.ROUGHNESS:var l=this.mMaterial instanceof E.o||this.mMaterial instanceof P.r?this.mMaterial.getRoughness():1;t.properties.level=l;break;case ee.$.ENVIRONMENT:var h,f=((null===(h=this.mModel)||void 0===h?void 0:h.name)||"").includes("enable_refraction_e");t.properties.mapping=U.C$.Equirectangular,t.properties.renderMode=f?U.fG.Refract:U.fG.Reflect;var m=1;this.mMaterial instanceof E.o?m=this.mMaterial.getEnvironmentIntensity():(this.mMaterial instanceof R.u||this.mMaterial instanceof P.r)&&(m=this.mMaterial.getEnvMapIntensity()),t.properties.level=m}return t}},{key:"resolve",value:(n=(0,s.A)(m().mark((function e(t,n){var r=this;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){if("function"==typeof t)switch(r.mState){case k.Ready:t(r.mMaterial);break;case k.Error:t();break;case k.Unloaded:case k.InProgress:default:r.mReadySubscriptions.push(t)}return r.mState===k.Ready?("function"==typeof n&&n(1),d.UX.print("Material resource resolved:",r.mHandle._getHandle(),r.mReferenceCount),e(r.mMaterial)):r.mState===k.Error?i("Failed to resolve material id: ".concat(r.mId)):(r.mMaterialLoader||(r.mState=k.InProgress,r.mMaterialLoader=new S.m(1),r.mModel?(void 0!==r.mModel.force_shared&&(r.mForceSharedTextures=r.mModel.force_shared),r.mMaterialLoader.next(r.createMaterial()),r.mMaterialLoader.complete()):T.m.getInstance().resolveModel(r.mId).then((function(e){if(r.mState===k.Unloaded)return i("Material disposed before finished loading!"),void r.dispatchFinalize();r.mModel=e,void 0!==r.mModel.force_shared&&(r.mForceSharedTextures=r.mModel.force_shared);var t=r.createMaterial();if(!t)return r.mState=k.Error,r.mMaterialLoader.error(new Error("Unable to create material!")),void r.dispatchFinalize();r.mMaterialLoader.next(t),r.mMaterialLoader.complete()})).catch((function(e){r.mState=k.Error,r.mMaterialLoader?r.mMaterialLoader.error(e):i(e),r.dispatchFinalize()}))),void r.mMaterialLoader.pipe((0,x.s)(1)).subscribe({next:function(t){"function"==typeof n&&n(1),d.UX.print("Material resource resolved:",r.mHandle._getHandle(),r.mReferenceCount),W.K.eventBus().dispatch(new K.r(X.E.RequestFrame)),e(t)},error:function(e){i(e)}}))})));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)})},{key:"dispatchFinalize",value:function(e){this.mReadySubscriptions.splice(0).forEach((function(t){return t(e)})),W.K.eventBus().dispatch(new K.r(X.E.RequestFrame))}},{key:"createMaterial",value:function(){var e=this,t="res_id:".concat(this.mId),n=this.mForcedType?this.mForcedType:this.mModel.type;if(this.mMaterial=this.resolveMaterialByType(n,t),this.mMaterial)return J.parseModel(this.mMaterial,this.mModel,this.mTextureManager,!0,this.mHandle.getPoolKey()).then((function(){if(e.mState!==k.Unloaded){if(e.mColorOverwrite&&e.applyColorOverwrite(),0===e.mMapOverwrite.length)return e.mState=k.Ready,void e.dispatchFinalize(e.mMaterial);for(var t=[],n=0;n<e.mMapOverwrite.length;n++)t.push(e.applyMapOverwrite(e.mMapOverwrite[n].type));Promise.allSettled(t).then((function(){e.mState!==k.Unloaded?(e.mState=k.Ready,e.dispatchFinalize(e.mMaterial)):e.dispatchFinalize()})).catch((function(t){e.mState!==k.Unloaded?(d.UX.error("MaterialResourceModel: Failed to apply map overwrites:",t),e.mState=k.Ready,e.dispatchFinalize(e.mMaterial)):e.dispatchFinalize()}))}else e.dispatchFinalize()})).catch((function(t){d.UX.error("Failed to parse material resource:",t),e.mState=k.Error,e.dispatchFinalize()})),this.mMaterial;this.dispatchFinalize()}},{key:"onDispose",value:function(e){return d.UX.print("Material resource disposed.",this.mHandle._getHandle()),this.mState=k.Unloaded,this.mMaterial&&(J.disposeMaterial(this.mMaterial,this.mTextureManager,this.mHandle.getPoolKey()),delete this.mMaterial),this.mModel&&delete this.mModel,this.mMaterialLoader&&(this.mMaterialLoader.closed||this.mMaterialLoader.error("Disposed"),delete this.mMaterialLoader),this.dispatchFinalize(),!0}},{key:"resolveMaterialByType",value:function(e,t){switch(e){case"MeshLambertMaterial":return W.K.renderer().getRenderEngine().createMaterialLambert(t);case"MeshBasicMaterial":return W.K.renderer().getRenderEngine().createMaterialBasic(t);case"MeshPhongMaterial":return W.K.renderer().getRenderEngine().createMaterialPhong(t);case"MeshPhongMaterialExt":return W.K.renderer().getRenderEngine().createMaterialPhongExt(t);case"MeshStandardMaterial":return W.K.renderer().getRenderEngine().createMaterialStandard(t);case"MeshPhysicalMaterial":return W.K.renderer().getRenderEngine().createMaterialPhysical(t);case"MeshPhysicalMaterialExt":return W.K.renderer().getRenderEngine().createMaterialPhysicalExt(t);case"MaterialSimple":return W.K.renderer().getRenderEngine().createMaterialSimple(t);case"MaterialPBR":case"PbrMaterial":return W.K.renderer().getRenderEngine().createMaterialPBR(t);default:return}}},{key:"clone",value:function(){var e=new t(this.mId,this.mTextureManager,void 0,this.mForcedType);return e._setHandle(this._getHandle().clone()),e.mColorOverwrite=this.mColorOverwrite?this.mColorOverwrite.clone():void 0,e.mMapOverwrite=JSON.parse(JSON.stringify(this.mMapOverwrite)),this.mModel?(e.mModel=JSON.parse(JSON.stringify(this.mModel)),e.mModel.uuid=re.V.uuidV4(),e.mMaterial=this.mMaterial?this.mMaterial.cloneMaterial():void 0,e.mMaterial?(e.mState=k.InProgress,J.parseModel(e.mMaterial,e.mModel,this.mTextureManager,!1,e._getHandle().getPoolKey()).then((function(){if(e.mState!==k.Unloaded){e.mColorOverwrite&&e.applyColorOverwrite(),e.mMapOverwrite&&0!==e.mMapOverwrite.length||(e.mState=k.Ready);for(var t=[],n=0;n<e.mMapOverwrite.length;n++)t.push(e.applyMapOverwrite(e.mMapOverwrite[n].type));q.N.resolveArray(t,(function(){e.mState!==k.Unloaded&&(e.mState=k.Ready)}))}})).catch((function(e){d.UX.error(e)}))):e.mState=this.mState):(e.mMaterial=this.mMaterial?this.mMaterial.cloneMaterial():void 0,e.mState=this.mState),e}},{key:"isForceSharedTextures",get:function(){return this.mForceSharedTextures}},{key:"getMapOverwrites",value:function(){return this.mMapOverwrite}}]);var n,r}(te),oe=n(18910);function se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ue(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ue=function(){return!!e})()}function ce(e,t,n,r){var i=(0,l.A)((0,c.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var le=function(e){function t(e){var n,r,a,s;return(0,i.A)(this,t),r=this,a=t,a=(0,c.A)(a),n=(0,u.A)(r,ue()?Reflect.construct(a,s||[],(0,c.A)(r).constructor):a.apply(r,s)),(0,o.A)(n,"mTextureManager",void 0),(0,o.A)(n,"mColorOverwrites",{}),(0,o.A)(n,"mMapOverwrites",{}),n.mTextureManager=e,n.mMapOverwrites[t._poolKey]={},n.mColorOverwrites[t._poolKey]={},n}return(0,h.A)(t,e),(0,a.A)(t,[{key:"getResourceGroupType",value:function(){return"Material"}},{key:"getTextureManager",value:function(){return this.mTextureManager}},{key:"loadLibrary",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(d.UX.print("cleanup materials"),T.m.getInstance().resetCache(),this.cleanup(!0)),this}},{key:"cleanup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];ce(t,"cleanup",this,3)([e]),this.mMapOverwrites[t._poolKey]={},this.mColorOverwrites[t._poolKey]={}}},{key:"setColorOverwrite",value:function(e,n,r){var i=void 0!==r?r:t._poolKey;if(this.mColorOverwrites[i]||(this.mColorOverwrites[i]={}),!n&&this.mColorOverwrites[i][e])this.mColorOverwrites[i][e]=void 0;else try{this.mColorOverwrites[i][e]=new w.v(n)}catch(e){d.UX.error("Could not add color overwrite:",e)}var a=this.mColorOverwrites[i][e],o=a||w.v.White();this.applyColorOverwrite(e,o,i)}},{key:"applyColorOverwrite",value:function(e,n,r){var i=void 0!==r?r:t._poolKey;this.resolveResourcePool(e,i);var a=this.findResourceWithHandleKey(String(e),i);a&&(a.setColorOverwrite(n),a.applyColorOverwrite(),W.K.eventBus().dispatch(new K.r(X.E.RequestFrame),void 0,void 0,0))}},{key:"setMapOverwrite",value:(v=(0,s.A)(m().mark((function e(n,r,i,a){var o=this;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,s){if(!r)return s("incorrect type");var u=void 0!==a?a:t._poolKey;o.mMapOverwrites[u]||(o.mMapOverwrites[u]={}),o.mMapOverwrites[u][n]||(o.mMapOverwrites[u][n]=[]);var c=o.mMapOverwrites[u][n].findIndex((function(e){return e.type===r}));if((null==i||i<0)&&o.mMapOverwrites[u][n][c])c>=0&&delete o.mMapOverwrites[u][n][c].textureId;else try{c>=0?o.mMapOverwrites[u][n][c].textureId=i:(o.mMapOverwrites[u][n].push({type:r,textureId:i}),c=o.mMapOverwrites[u][n].length-1)}catch(e){}var l=o.mMapOverwrites[u][n][c].textureId;o.applyMapOverwrite(n,r,l,u).then((function(){e()})).catch((function(e){s(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e,t,n,r){return v.apply(this,arguments)})},{key:"applyMapOverwrite",value:(f=(0,s.A)(m().mark((function e(n,r,i,a){var o=this;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,s){var u=void 0!==a?a:t._poolKey;o.resolveResourcePool(n,u);var c=o.findResourceWithHandleKey(String(n),u);if(!c)return s("Unable to find resource");c.setMapOverwrite(r,i),c.applyMapOverwrite(r).then((function(){W.K.eventBus().dispatch(new K.r(X.E.RequestFrame),void 0,void 0,0),e()})).catch((function(e){s(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e,t,n,r){return f.apply(this,arguments)})},{key:"saveModel",value:(l=(0,s.A)(m().mark((function e(t){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=["id","uuid","name","type","hash","alpha_test","blending","depth_test","depth_write","fog","lights","opacity","premultiplied_alpha","transparency_mode","depth_pre_pass","separate_culling_pass","shading","side","transparent","ssrl","render_order","render_layer","resource_folder_id","camera_layer","created_at","updated_at","deleted_at"],i={};Object.keys(t).filter((function(e){return-1!==r.indexOf(e)})).forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.properties={id:t.properties_id},Object.keys(t).filter((function(e){return-1===r.indexOf(e)})).forEach((function(e){i.properties[e]=t[e]})),(null===i.resource_folder_id||void 0!==i.resource_folder_id&&i.resource_folder_id<0)&&delete i.resource_folder_id,p.k.getInstance().patch("material/".concat(t.id),i).then((function(){e(!0)}),(function(e){return n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return l.apply(this,arguments)})},{key:"deleteModel",value:(r=(0,s.A)(m().mark((function e(t){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.deleteModelById(t.id));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"deleteModelById",value:(n=(0,s.A)(m().mark((function e(t){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){p.k.getInstance().delete("material/".concat(t)).then((function(){return e(!0)}),(function(e){return n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"setOverwritesOnResource",value:function(e,t){var n=e.getModelId(),r=this.mColorOverwrites[t.getPoolKey()]?this.mColorOverwrites[t.getPoolKey()][n]:void 0;r&&e.setColorOverwrite(r);var i=this.mMapOverwrites[t.getPoolKey()]?this.mMapOverwrites[t.getPoolKey()][n]:void 0;if(Array.isArray(i))for(var a=0;a<i.length;a++){var o=i[a],s=o.type,u=o.textureId;e.setMapOverwrite(s,u)}}},{key:"makeOptions",value:function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?se(Object(n),!0).forEach((function(t){(0,o.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({forceType:void 0,forceShared:!0,forceModel:void 0},e)}},{key:"createResource",value:function(e,t,n){var r=this.makeOptions(n),i=new ae("string"==typeof e?+e:e,this.mTextureManager,r.forceModel,r.forceType);return i._setHandle(t),this.setOverwritesOnResource(i,t),i}},{key:"findResourceWithHandleKey",value:function(e,n){return this.resolveResourcePool(Number(e),void 0!==n?n:t._poolKey),ce(t,"findResourceWithHandleKey",this,3)([e,n])}},{key:"resolveResourcePool",value:function(e,n){if(n!==t._poolKey){var r=String(e);if(!this.mResourcePool.has(r,n)&&this.mResourcePool.has(r,t._poolKey)){if(this.mResourcePool.clone(r,n,t._poolKey),t._poolKey in this.mColorOverwrites&&!(n in this.mColorOverwrites))for(var i in this.mColorOverwrites[n]={},this.mColorOverwrites[t._poolKey]){var a=Number(i),o=this.mColorOverwrites[t._poolKey][a];o&&(this.mColorOverwrites[n][a]=o.clone())}t._poolKey in this.mMapOverwrites&&!(n in this.mMapOverwrites)&&(this.mMapOverwrites[n]=JSON.parse(JSON.stringify(this.mMapOverwrites[t._poolKey]))),W.K.messenger().send(new oe.A_(e,n),String(n),0)}else this.mResourcePool.has(r,t._poolKey)||(n in this.mColorOverwrites||(this.mColorOverwrites[n]={}),n in this.mMapOverwrites||(this.mMapOverwrites[n]={}),this.mResourcePool.has(r,n)||W.K.messenger().send(new oe.A_(e,n),String(n),0))}}}]);var n,r,l,f,v}(M),he=n(62112),fe=n(48477),me=n(43995),pe=n(77972);function de(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(de=function(){return!!e})()}var ve=function(e){function t(e,n,r){var a,s,l,h,f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return(0,i.A)(this,t),s=this,l=t,l=(0,c.A)(l),a=(0,u.A)(s,de()?Reflect.construct(l,h||[],(0,c.A)(s).constructor):l.apply(s,h)),(0,o.A)(a,"mId",void 0),(0,o.A)(a,"mResource",void 0),(0,o.A)(a,"mLod",void 0),(0,o.A)(a,"mModel",void 0),(0,o.A)(a,"mMediaLoader",void 0),(0,o.A)(a,"mState",void 0),(0,o.A)(a,"mReadySubscriptions",[]),(0,o.A)(a,"mTextureProperties",void 0),(0,o.A)(a,"mTextureKey",void 0),(0,o.A)(a,"mFactoryControllers",[me.X,fe.e]),(0,o.A)(a,"mController",void 0),(0,o.A)(a,"mImageLoader",void 0),"number"==typeof e?(a.mId=e,a.mState=k.Unloaded):(a.mResource=e,a.mState=k.Ready),a.mLod=Math.max(0,Math.min(2,f)),a.mTextureProperties=r,a.mTextureKey=n,a.mImageLoader=new pe.$,a}return(0,h.A)(t,e),(0,a.A)(t,[{key:"getTextureKey",value:function(){return this.mTextureKey}},{key:"getTexture",value:function(){return this.mResource?this.mResource:this.mController?this.mController.getTexture():void 0}},{key:"getController",value:function(){return this.mController}},{key:"resolve",value:(n=(0,s.A)(m().mark((function e(t,n){var r=this;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){if("function"==typeof t)switch(r.mState){case k.Ready:t(r.getTexture());break;case k.Error:t();break;case k.Unloaded:case k.InProgress:default:r.mReadySubscriptions.push(t)}return r.mState===k.Ready?("function"==typeof n&&n(1),d.UX.print("Texture resource resolved:",r.mHandle._getHandle(),r.mReferenceCount),e(r.getTexture())):r.mState===k.Error?i("Failed to resolve media id:".concat(r.mId)):(r.mMediaLoader||(r.mState=k.InProgress,r.mMediaLoader=new S.m(1),he.u.getInstance().resolveModel(r.mId).then((function(e){if(r.mState===k.Unloaded)return i(new Error("Media disposed before finished loading!")),void r.dispatchFinalize();r.mModel=e;var t=r.createTexture();if(!t)return r.mState=k.Error,r.mMediaLoader.error(new Error("Unable to create texture!")),void r.dispatchFinalize();r.mMediaLoader.next(t),r.mMediaLoader.complete()})).catch((function(e){r.mState=k.Error,r.mMediaLoader?r.mMediaLoader.error(e):i(e),r.dispatchFinalize()}))),void r.mMediaLoader.pipe((0,x.s)(1)).subscribe({next:function(t){"function"==typeof n&&n(1),d.UX.print("Texture resource resolved:",r.mHandle._getHandle(),r.mReferenceCount),W.K.eventBus().dispatch(new K.r(X.E.RequestFrame)),e(t)},error:function(e){i(e)}}))})));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)})},{key:"dispatchFinalize",value:function(e){this.mReadySubscriptions.splice(0).forEach((function(t){return t(e)})),W.K.eventBus().dispatch(new K.r(X.E.RequestFrame))}},{key:"createTexture",value:function(){for(var e,t=this,n=this.mLod;n>=0;n--){var r=encodeURI(this.mModel["lod".concat(n,"_url")]);if(r&&r.length>0){e=r;break}}e||(e=this.mModel.source_url);var i=this.mFactoryControllers.find((function(t){return t.isSupported(e)}));if(i)return this.mController=new i(this.mTextureKey,this.mImageLoader),this.mController.loadTexture(e,this.mTextureProperties,(function(n){return t.mState===k.Unloaded?(d.UX.error("Texture ".concat(e," has finished loading after disposal of ResourceManager.")),void t.dispatchFinalize()):n?(t.mState=k.Ready,n.setName(t.mModel.name),void t.dispatchFinalize(n)):(t.mState=k.Error,void t.dispatchFinalize())})),this.getTexture();this.dispatchFinalize()}},{key:"onDispose",value:function(){return d.UX.print("Texture resource disposed.",this.mHandle._getHandle()),this.mState=k.Unloaded,this.mController&&(this.mController.unload(),delete this.mController),this.mMediaLoader&&(this.mMediaLoader.closed||this.mMediaLoader.error("Disposed"),delete this.mMediaLoader),this.dispatchFinalize(),!0}},{key:"clone",value:function(){return new t(this.mId||this.mResource,this.mTextureKey,JSON.parse(JSON.stringify(this.mTextureProperties)),this.mLod)}},{key:"getId",value:function(){return this.mId}},{key:"isSvg",value:function(){return this.mController instanceof fe.e}},{key:"getTextureProperties",value:function(){return this.mTextureProperties}}]);var n}(te),ye=n(58794);function ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function be(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(be=function(){return!!e})()}var Ae=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,c.A)(n),(0,u.A)(e,be()?Reflect.construct(n,r||[],(0,c.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,h.A)(t,e),(0,a.A)(t,[{key:"getResourceGroupType",value:function(){return"Texture"}},{key:"loadLibrary",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(d.UX.print("cleanup texture cache..."),he.u.getInstance().resetCache(),this.cleanup(!0)),this}},{key:"_getIdPath",value:function(e,t){var n="".concat(e);return t.forceShared||(n+="/".concat(re.V.Md5(JSON.stringify(t.properties)))),n}},{key:"saveModel",value:(f=(0,s.A)(m().mark((function e(t){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){p.k.getInstance().patch("media/".concat(t.id),t).then((function(t){e(!0)}),(function(e){return n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return f.apply(this,arguments)})},{key:"deleteModel",value:(l=(0,s.A)(m().mark((function e(t){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.deleteModelById(t.id));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"deleteModelById",value:(r=(0,s.A)(m().mark((function e(t){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){p.k.getInstance().delete("media/".concat(t)).then((function(t){e(!0)}),(function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"makeOptions",value:function(e){return(0,v.D9)({lod:(0,ye.Fr)()?1:0,properties:{flipY:!0,mapping:U.C$.UV,wrapU:U.qC.Repeat,wrapV:U.qC.Repeat,magFilter:U.wm.Linear,minFilter:U.wm.Linear,mipmapFilter:U.wm.Linear,format:void 0,dataType:U.Gs.UnsignedByte,renderMode:U.fG.Reflect,anisotropy:4,encoding:U.vv.Linear,useRGBasAlpha:!1,uvChannel:0,level:1,generateMipmaps:!0},forceShared:!1},e)}},{key:"makeHandleKey",value:function(e,t){var n=this.makeOptions(t);return this._getIdPath(e,n)}},{key:"createResource",value:function(e,t,n){var r=this.makeOptions(n),i=new ve("string"==typeof e?+e:e,t._getHandle(),function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(n),!0).forEach((function(t){(0,o.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ge(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({forceShared:r.forceShared},r.properties),r.lod);return i}},{key:"onAfterResolve",value:(n=(0,s.A)(m().mark((function e(t,n,r){var i,a,o,s;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=t).isSvg()||i.getTextureProperties().forceShared){e.next=9;break}return a=(0,v.D9)(i.getTextureProperties(),{forceShared:!0}),o=this.makeResource(i.getId(),a),s=this.mResourcePool.findByHandle(o),e.next=7,s.resolve(r);case 7:return e.t0=e.sent,e.abrupt("return",{resource:e.t0,overridden:!0});case 9:return e.abrupt("return",{resource:n,overridden:!1});case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"disposeTexture",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=v.N5.isNumeric(n)?n:t._poolKey,a=this.mResourcePool.find((function(t,n){if(n!==i)return!1;var r=t.getTexture();return!!r&&r.getUniqueId()===e.getUniqueId()}));a?this.disposeResource(a._getHandle(),r):e.dispose()}}]);var n,r,l,f}(M),_e=(n(36033),n(71761),n(71517),n(11379),n(93777),n(14190),n(12359),n(86097),n(17273),n(27415),n(19929),n(37583),n(55122),n(20230),n(57268),n(79733),n(54743),n(34594),n(61740),n(48140),n(81630),n(72170),n(75044),n(69539),n(31694),n(89955),n(21903),n(91134),n(33206),n(44496),n(66651),n(12887),n(19369),n(66812),n(8995),n(31575),n(36072),n(88747),n(28845),n(29423),n(57301),n(373),n(86614),n(41405),n(37467),n(44732),n(33684),n(79577),n(26280),n(27913),n(47801),n(47350),n(23241),n(67302),n(55871),n(40537)),Me=n(70123),ke=n(71699),we=function(){return(0,a.A)((function e(){(0,i.A)(this,e)}),[{key:"loadGeometry",value:(e=(0,s.A)(m().mark((function e(t,n,r,i){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var a=(0,_e.isFunction)(i)?i:function(){};r.load(t,(function(t){try{var r,i=t,a=new Uint32Array(i,0,8),o=a[1],s=a[2],u=a[3],c=a[4],l=a[5],h=a[6],f=a[7],m=new Float32Array(i,c,o),p=new Float32Array(i,l,o),d=new Float32Array(i,h,o/3*2);u>1&&(r=new Float32Array(i,h+o/3*2*4,o/3*2));var v=new Uint32Array(i,f,s),y=W.K.renderer().getRenderEngine().createBuffer();y.setIndexData(new ke.T(v,1)),y.setVertexData(Me.P.POSITION,new ke.T(m,3)),y.setVertexData(Me.P.NORMAL,new ke.T(p,3)),y.setVertexData(Me.P.UV,new ke.T(d,2)),r&&y.setVertexData(Me.P.UV2,new ke.T(r,2)),e(y)}catch(e){n(e)}}),(function(e){a(e.loaded/e.total)}),(function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(t,n,r,i){return e.apply(this,arguments)})},{key:"dispose",value:function(){}}],[{key:"cleanup",value:function(){}}]);var e}(),Te=n(82284),xe=(n(26910),n(46594),n(72107),n(95477),n(21489),n(3690),n(73772),n(67348),n(35644),n(13611),n(3296),n(27208),n(48408),n(98721),n(21997)),Se=(n(2945),n(55815),n(64979),n(79739),n(65040));function Ce(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ce=function(){return!!e})()}var Ee={},Re=function(e){function t(e){return(0,i.A)(this,t),n=this,r=t,a=[e],r=(0,c.A)(r),(0,u.A)(n,Ce()?Reflect.construct(r,a||[],(0,c.A)(n).constructor):r.apply(n,a));var n,r,a}return(0,h.A)(t,e),(0,a.A)(t,[{key:"load",value:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Se.l.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;if(void 0===Ee[e]){var o,s=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(s){var u=s[1],c=!!s[2],l=s[3];l=decodeURIComponent(l),c&&(l=atob(l));try{var h,f=(this.responseType||"").toLowerCase();switch(f){case"arraybuffer":case"blob":for(var m=new Uint8Array(l.length),p=0;p<l.length;p++)m[p]=l.charCodeAt(p);h="blob"===f?new Blob([m.buffer],{type:u}):m.buffer;break;case"document":var d=new DOMParser;h=d.parseFromString(l,u);break;case"json":h=JSON.parse(l);break;default:h=l}setTimeout((function(){t&&t(h),i.manager.itemEnd(e)}),0)}catch(t){setTimeout((function(){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}),0)}}else{for(var v in Ee[e]=[],Ee[e].push({onLoad:t,onProgress:n,onError:r}),(o=new XMLHttpRequest).open("GET",e,!0),o.addEventListener("load",(function(t){var n=this.response,r=Ee[e];if(delete Ee[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Se.l.add(e,n);for(var a=0,o=r.length;a<o;a++){var s=r[a];s.onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else{for(var u=0,c=r.length;u<c;u++){var l=r[u];l.onError&&l.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}}),!1),o.addEventListener("progress",(function(t){for(var n=Ee[e],r=0,i=n.length;r<i;r++){var a=n[r];a.onProgress&&a.onProgress(t)}}),!1),o.addEventListener("error",(function(t){var n=Ee[e];delete Ee[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),!1),o.addEventListener("abort",(function(t){var n=Ee[e];delete Ee[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),!1),void 0!==this.responseType&&(o.responseType=this.responseType),void 0!==this.withCredentials&&(o.withCredentials=this.withCredentials),o.overrideMimeType&&o.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)o.setRequestHeader(v,this.requestHeader[v]);o.send(null)}return i.manager.itemStart(e),o}Ee[e].push({onLoad:t,onProgress:n,onError:r})}},{key:"setResponseType",value:function(e){return this.responseType=e,this}},{key:"setMimeType",value:function(e){return this.mimeType=e,this}}])}(xe.a);function Ie(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ie=function(){return!!e})()}var Oe=new WeakMap,De=function(e){function t(e){var n,r,a,o;return(0,i.A)(this,t),r=this,a=t,o=[e],a=(0,c.A)(a),(n=(0,u.A)(r,Ie()?Reflect.construct(a,o||[],(0,c.A)(r).constructor):a.apply(r,o))).decoderPath="",n.decoderConfig={},n.decoderBinary=null,n.decoderPending=null,n.workerLimit=4,n.workerPool=[],n.workerNextTaskID=1,n.workerSourceURL="",n.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD",uv2:"TEX_COORD"},n.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array",uv2:"Float32Array"},n}return(0,h.A)(t,e),(0,a.A)(t,[{key:"setDecoderPath",value:function(e){return this.decoderPath=e,this}},{key:"setDecoderConfig",value:function(e){return this.decoderConfig=e,this}},{key:"setWorkerLimit",value:function(e){return this.workerLimit=e,this}},{key:"load",value:function(e,t,n,r){var i=this,a=new Re(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(e){var n={attributeIDs:i.defaultAttributeIDs,attributeTypes:i.defaultAttributeTypes,useUniqueIDs:!1,useAttributeByMetaDataName:!0};i.decodeGeometry(e,n).then(t).catch(r)}),n,r)}},{key:"decodeDracoFile",value:function(e,t,n,r){var i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,useAttributeByMetaDataName:!0};this.decodeGeometry(e,i).then(t)}},{key:"decodeGeometry",value:function(e,t){var n=this;for(var r in t.attributeTypes){var i=t.attributeTypes[r];void 0!==i.BYTES_PER_ELEMENT&&(t.attributeTypes[r]=i.name)}var a,o=JSON.stringify(t);if(Oe.has(e)){var s=Oe.get(e);if(s.key===o)return s.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var u=this.workerNextTaskID++,c=e.byteLength,l=this._getWorker(u,c).then((function(n){return a=n,new Promise((function(n,r){a._callbacks[u]={resolve:n,reject:r},a.postMessage({type:"decode",id:u,taskConfig:t,buffer:e},[e])}))})).then((function(e){return n._createGeometry(e.geometry)}));return l.catch((function(){return!0})).then((function(){a&&u&&n._releaseTask(a,u)})),Oe.set(e,{key:o,promise:l}),l}},{key:"_createGeometry",value:function(e){return e}},{key:"_loadLibrary",value:function(e,t){var n=new Re(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((function(t,r){n.load(e,t,void 0,r)}))}},{key:"preload",value:function(){return this._initDecoder(),this}},{key:"_initDecoder",value:function(){var e=this;if(this.decoderPending)return this.decoderPending;var t="object"!==("undefined"==typeof WebAssembly?"undefined":(0,Te.A)(WebAssembly))||"js"===this.decoderConfig.type,n=[];return t?n.push(this._loadLibrary("draco_decoder.js","text")):(n.push(this._loadLibrary("draco_wasm_wrapper.js","text")),n.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(n).then((function(n){var r=n[0];t||(e.decoderConfig.wasmBinary=n[1]);var i=Pe.toString(),a=["/* draco decoder */",r,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");e.workerSourceURL=URL.createObjectURL(new Blob([a]))})),this.decoderPending}},{key:"_getWorker",value:function(e,t){var n=this;return this._initDecoder().then((function(){if(n.workerPool.length<n.workerLimit){var r=new Worker(n.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:n.decoderConfig}),r.onmessage=function(e){var t=e.data;switch(t.type){case"decode":r._callbacks[t.id].resolve(t);break;case"error":r._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},n.workerPool.push(r)}else n.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));var i=n.workerPool[n.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i}))}},{key:"_releaseTask",value:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}},{key:"debug",value:function(){console.log("Task load: ",this.workerPool.map((function(e){return e._taskLoad})))}},{key:"dispose",value:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}])}(xe.a);function Pe(){var e,t;function n(e,t,n,r,i,a){var o=a.num_components(),s=n.num_points()*o,u=s*i.BYTES_PER_ELEMENT,c=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),l=e._malloc(u);t.GetAttributeDataArrayForAllPoints(n,a,c,u,l);var h=new i(e.HEAPF32.buffer,l,s).slice();return e._free(l),{name:r,array:h,itemSize:o}}onmessage=function(r){var i=r.data;switch(i.type){case"init":e=i.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":var a=i.buffer,o=i.taskConfig;t.then((function(e){var t=e.draco,r=new t.Decoder,s=new t.DecoderBuffer;s.Init(new Int8Array(a),a.byteLength);try{var u=function(e,t,r,i){var a,o,s=i.attributeIDs,u=i.attributeTypes,c=t.GetEncodedGeometryType(r);if(c===e.TRIANGULAR_MESH)a=new e.Mesh,o=t.DecodeBufferToMesh(r,a);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new e.PointCloud,o=t.DecodeBufferToPointCloud(r,a)}if(!o.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+o.error_msg());var l={index:null,attributes:[]};for(var h in s){var f=self[u[h]],m=void 0,p=void 0;if(i.useUniqueIDs)p=s[h],m=t.GetAttributeByUniqueId(a,p);else if(i.useAttributeByMetaDataName){if(-1===(p=t.GetAttributeIdByMetadataEntry(a,"name",h)))continue;m=t.GetAttribute(a,p)}else{if(-1===(p=t.GetAttributeId(a,e[s[h]])))continue;m=t.GetAttribute(a,p)}l.attributes.push(n(e,t,a,h,f,m))}c===e.TRIANGULAR_MESH&&(l.index=function(e,t,n){var r=n.num_faces(),i=3*r,a=4*i,o=e._malloc(a);t.GetTrianglesUInt32Array(n,a,o);var s=new Uint32Array(e.HEAPF32.buffer,o,i).slice();return e._free(o),{array:s,itemSize:1}}(e,t,a));return e.destroy(a),l}(t,r,s,o),c=u.attributes.map((function(e){return e.array.buffer}));u.index&&c.push(u.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:u},c)}catch(e){console.error(e),self.postMessage({type:"error",id:i.id,error:e.message})}finally{t.destroy(s),t.destroy(r)}}))}}}var Be,Fe=function(){function e(){(0,i.A)(this,e)}return(0,a.A)(e,[{key:"loadGeometry",value:(t=(0,s.A)(m().mark((function t(n,r,i,a){var o=this;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,r){var i="function"==typeof a?a:function(){};e.sFirstInit&&(e.sFirstInit=!1,e.sDracoLoader=new De,e.sDracoLoader.setDecoderConfig({type:o.isWebAssemblySupported()?void 0:"js"}),e.sDracoLoader.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.4.3/")),e.sDracoLoader.load(n,(function(e){var n=W.K.renderer().getRenderEngine().createBuffer();if(e.index){var i=e.index.array;n.setIndexData(new ke.T(i,1))}if(Array.isArray(e.attributes))for(var a=0;a<e.attributes.length;a++){var o=e.attributes[a].name,s=e.attributes[a].array,u=e.attributes[a].itemSize||0;if(u>0)switch(o){case"position":n.setVertexData(Me.P.POSITION,new ke.T(s,u));break;case"normal":n.setVertexData(Me.P.NORMAL,new ke.T(s,u));break;case"tangent":n.setVertexData(Me.P.TANGENT,new ke.T(s,u));break;case"uv":n.setVertexData(Me.P.UV,new ke.T(s,u));break;case"uv2":n.setVertexData(Me.P.UV2,new ke.T(s,u));break;case"color":n.setVertexData(Me.P.COLOR,new ke.T(s,u))}}try{t(n)}catch(e){r(e)}}),(function(e){i(e.loaded/e.total)}),(function(e){r(e)}))})));case 1:case"end":return t.stop()}}),t)}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"isWebAssemblySupported",value:function(){return"object"===("undefined"==typeof WebAssembly?"undefined":(0,Te.A)(WebAssembly))&&"function"==typeof WebAssembly.instantiate}},{key:"dispose",value:function(){}}],[{key:"cleanup",value:function(){e.sDracoLoader&&(e.sDracoLoader.dispose(),delete e.sDracoLoader,e.sFirstInit=!0)}}]);var t}();(0,o.A)(Fe,"sDracoLoader",void 0),(0,o.A)(Fe,"sFirstInit",!0),function(e){e[e.UNKNOWN=-1]="UNKNOWN",e[e.EBM=0]="EBM",e[e.DRC=1]="DRC"}(Be||(Be={}));var Ne=function(){return(0,a.A)((function e(){(0,i.A)(this,e),(0,o.A)(this,"mLoaders",void 0),this.mLoaders=new Map,this.mLoaders.set(Be.EBM,new we),this.mLoaders.set(Be.DRC,new Fe)}),[{key:"loadGeometry",value:(e=(0,s.A)(m().mark((function e(t,n,r,i){var a,o,s;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=this.getExtension(t))!==Be.UNKNOWN){e.next=3;break}throw new Error("Geometry extension not recognized");case 3:return o=this.mLoaders.get(a),e.next=6,o.loadGeometry(t,n,r,i);case 6:return s=e.sent,e.abrupt("return",s);case 8:case"end":return e.stop()}}),e,this)}))),function(t,n,r,i){return e.apply(this,arguments)})},{key:"getExtension",value:function(e){var t=e.match(/.*\.(drc|ebm)$/i);if(t.length>1)switch(t[1]){case"ebm":return Be.EBM;case"drc":return Be.DRC;default:return Be.UNKNOWN}return Be.UNKNOWN}},{key:"dispose",value:function(){this.mLoaders&&(this.mLoaders.forEach((function(e){e.dispose()})),delete this.mLoaders)}}],[{key:"cleanup",value:function(){we.cleanup(),Fe.cleanup()}}]);var e}();function Le(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Le=function(){return!!e})()}var je=function(e){function t(e,n){var r,a,s,l,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,i.A)(this,t),a=this,s=t,s=(0,c.A)(s),r=(0,u.A)(a,Le()?Reflect.construct(s,l||[],(0,c.A)(a).constructor):s.apply(a,l)),(0,o.A)(r,"mSource",void 0),(0,o.A)(r,"mModel",void 0),(0,o.A)(r,"mResourceResolver",void 0),(0,o.A)(r,"mState",void 0),(0,o.A)(r,"mReadySubscriptions",[]),(0,o.A)(r,"mProperties",void 0),(0,o.A)(r,"mFileLoader",void 0),(0,o.A)(r,"mGeometryLoader",void 0),r._setHandle(e),"string"==typeof n?(r.mSource=n,r.mState=k.Unloaded):(r.mModel=n,r.mState=k.Ready),r.mProperties=h,r.mFileLoader=new Re,r.mFileLoader.setResponseType("arraybuffer"),r.mGeometryLoader=new Ne,r}return(0,h.A)(t,e),(0,a.A)(t,[{key:"getGeometry",value:function(){return this.mModel}},{key:"resolve",value:(n=(0,s.A)(m().mark((function e(t,n){var r=this;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){if("function"==typeof t)switch(r.mState){case k.Ready:t(r.getGeometry());break;case k.Error:t();break;case k.Unloaded:case k.InProgress:default:r.mReadySubscriptions.push(t)}return r.mState===k.Ready?("function"==typeof n&&n(1),d.UX.print("Geometry resource resolved:",r.mHandle._getHandle(),r.mReferenceCount),e(r.getGeometry())):r.mState===k.Error?i("Failed to resolve resource: ".concat(r.mSource)):(r.mResourceResolver||(r.mState=k.InProgress,r.mResourceResolver=new S.m(1),r.mGeometryLoader.loadGeometry(r.mSource,r.mProperties,r.mFileLoader,n).then((function(e){k.Unloaded?i("Geometry disposed before loading!"):(r.mModel=e,r.mState=k.Ready,r.mResourceResolver.next(r.mModel),r.dispatchFinalize(r.getGeometry()))})).catch((function(e){r.mState=k.Error,r.dispatchFinalize(),r.mResourceResolver?r.mResourceResolver.error(e):i(e)}))),void r.mResourceResolver.pipe((0,x.s)(1)).subscribe({next:function(t){"function"==typeof n&&n(1),d.UX.print("Geometry resource resolved:",r.mHandle._getHandle(),r.mReferenceCount),e(t)},error:function(e){i(e)}}))})));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)})},{key:"onDispose",value:function(){return d.UX.print("Geometry resource disposed.",this.mHandle._getHandle()),this.mState=k.Unloaded,this.mModel&&(this.mModel.dispose(),delete this.mModel),this.mGeometryLoader&&(this.mGeometryLoader.dispose(),delete this.mGeometryLoader),this.mResourceResolver&&(this.mResourceResolver.complete(),delete this.mResourceResolver),this.dispatchFinalize(),!0}},{key:"dispatchFinalize",value:function(e){this.mReadySubscriptions.splice(0).forEach((function(t){return t(e)}))}},{key:"clone",value:function(){return new t(this.mHandle,this.mSource||this.mModel,JSON.parse(JSON.stringify(this.mProperties)))}}]);var n}(te);function Ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ve(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ve=function(){return!!e})()}var ze,He=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,c.A)(n),(0,u.A)(e,Ve()?Reflect.construct(n,r||[],(0,c.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,h.A)(t,e),(0,a.A)(t,[{key:"getResourceGroupType",value:function(){return"Geometry"}},{key:"loadLibrary",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(d.UX.print("Cleanup geometry cache..."),this.cleanup(!0)),this}},{key:"makeOptions",value:function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(n),!0).forEach((function(t){(0,o.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ue(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({properties:{}},e)}},{key:"makeHandleKey",value:function(e,t){var n=this.makeOptions(t);return this.getIdPath(e,n.properties)}},{key:"createResource",value:function(e,t,n){var r=this.makeOptions(n);return new je(t,e,r.properties)}},{key:"disposeGeometry",value:function(e,n){var r=v.N5.isNumeric(n)?n:t._poolKey,i=this.mResourcePool.find((function(t,n){return n===r&&t===e}));i&&this.disposeResource(i._getHandle())}},{key:"getIdPath",value:function(e,t){return"".concat(e,"/").concat(re.V.Md5(JSON.stringify(t)))}}])}(M),Ge=n(69567);!function(e){e[e.TextureManager=0]="TextureManager",e[e.MaterialManager=1]="MaterialManager",e[e.GeometryManager=2]="GeometryManager",e[e.MaxTypes=3]="MaxTypes"}(ze||(ze={}));var qe=function(){function e(){(0,i.A)(this,e),(0,o.A)(this,"mManagers",{}),(0,o.A)(this,"mDirty",void 0);var t=new Ae;this.mManagers[ze.TextureManager]=t,this.mManagers[ze.MaterialManager]=new le(t),this.mManagers[ze.GeometryManager]=new He,this.mDirty={}}return(0,a.A)(e,[{key:"resolveManager",value:function(t,n){var r=n||e.isDirty(t);return e.setDirty(t,!1),void 0!==this.mManagers[t].loadLibrary(r)}}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}},{key:"setDirty",value:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.getInstance();if(void 0===t)for(var i in ze)isNaN(Number(i))||Number(i)>=ze.MaxTypes||(r.mDirty[i]=n);else r.mDirty[t]=n}},{key:"isDirty",value:function(t){var n=e.getInstance();if(void 0===t)for(var i=0,a=Object.entries(n.mDirty);i<a.length;i++){if(!0===(0,r.A)(a[i],2)[1])return!0}return!0===n.mDirty[t]}},{key:"getManager",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.getInstance();return r.resolveManager(t,n),r.mManagers[t]}},{key:"destroy",value:function(){if(e.sInstance){for(var t in e.sInstance.mManagers)e.sInstance.mManagers[t].cleanup();delete e.sInstance.mDirty,delete e.sInstance.mManagers,delete e.sInstance}Ge.N.getInstance().cleanup(),Ne.cleanup()}}])}();(0,o.A)(qe,"sInstance",void 0)},27046:function(e,t,n){"use strict";n.d(t,{L:function(){return L}});var r,i=n(10467),a=n(23029),o=n(92901),s=n(64467),u=n(54756),c=n.n(u),l=(n(52675),n(89463),n(2259),n(16280),n(28706),n(33771),n(2008),n(50113),n(23792),n(23418),n(62062),n(44114),n(34782),n(54554),n(69085),n(62010),n(83851),n(81278),n(79432),n(26099),n(3362),n(84864),n(57465),n(27495),n(87745),n(90906),n(38781),n(47764),n(25440),n(11392),n(46058),n(17333),n(3064),n(9920),n(41393),n(98992),n(54520),n(72577),n(3949),n(81454),n(23500),n(62953),n(38685)),h=n(74461),f=n(63805);!function(e){e.LeftRight="left_right",e.TopBottom="top_bottom"}(r||(r={}));var m=n(49571),p=(n(11367),function(){return(0,o.A)((function e(){(0,a.A)(this,e)}),null,[{key:"resizeImageToPowerOfTwo",value:(e=(0,i.A)(c().mark((function e(t){var n,r,i=arguments;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=function(e){return Math.pow(2,Math.floor(Math.log2(e)))},n=i.length>1&&void 0!==i[1]?i[1]:4096,e.abrupt("return",new Promise((function(e,i){var a=new Image;a.crossOrigin="anonymous",a.src=t,a.onload=function(){var t=a.width,o=a.height/t,s=Math.min(r(t),n),u=Math.round(s*o);u>n&&(s=r(Math.round(n/o)),u=Math.round(s*o));var c=document.createElement("canvas");c.width=s,c.height=u;var l=c.getContext("2d");if(l){l.drawImage(a,0,0,s,u);var h=c.toDataURL("image/jpeg");e(h)}else i(new Error("Failed to get canvas context"))},a.onerror=function(e){i(new Error("Failed to load image: "+(e instanceof Error?e.message:String(e))))}})));case 3:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)})}]);var e}()),d=n(41840),v=n(94273),y=n(33153),g=Object.defineProperty,b=(e,t,n)=>(((e,t,n)=>{t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class A{constructor(e,t,n,r){b(this,"cw"),b(this,"ch"),b(this,"data"),b(this,"alphaThreshold"),b(this,"visited"),this.cw=e,this.ch=t,this.data=n,this.alphaThreshold=r,this.visited=Array.from({length:t},(()=>Array(e).fill(!1)))}isNonTransparent(e,t){return!(e<0||t<0||e>=this.cw||t>=this.ch)&&this.data[4*(t*this.cw+e)+3]>this.alphaThreshold}dfsIterative(e,t){const n=[[e,t]],r=[];for(;n.length>0;){const[e,t]=n.pop();e<0||t<0||e>=this.cw||t>=this.ch||this.visited[t][e]||!this.isNonTransparent(e,t)||(this.visited[t][e]=!0,r.push([e,t]),n.push([e-1,t]),n.push([e+1,t]),n.push([e,t-1]),n.push([e,t+1]))}return r}findRegions(){const e=[];for(let t=0;t<this.ch;t++)for(let n=0;n<this.cw;n++)if(!this.visited[t][n]&&this.isNonTransparent(n,t)){const r=this.dfsIterative(n,t);e.push(r)}return e}}class _{constructor(e,t,n){if(b(this,"data"),b(this,"ctxWidth",0),b(this,"ctxHeight",0),e instanceof HTMLCanvasElement){if(this.setDataFromCanvas(e),t||n)throw new Error("Width and Height can not be set on source type HTMLCanvasElement")}else this.setData(e,t,n)}setData(e,t,n){this.data=e,this.ctxWidth=t,this.ctxHeight=n,this.onContextChange()}setDataFromCanvas(e){const t=e.getContext("2d");this.ctxWidth=e.width,this.ctxHeight=e.height;const n=null==t?void 0:t.getImageData(0,0,this.ctxWidth,this.ctxHeight);this.data=null==n?void 0:n.data,this.onContextChange()}onContextChange(){}}class M extends _{getOutline(e){if(!this.data)throw new Error("Data is empty.");return this.generatePaths(e)}}class k extends M{constructor(){super(...arguments),b(this,"contourDx",[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN]),b(this,"contourDy",[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN]),b(this,"localCanvas"),b(this,"localCtx"),b(this,"localData")}updateImageData(){var e;const t=null==(e=this.localCtx)?void 0:e.getImageData(0,0,this.ctxWidth,this.ctxHeight);this.localData=null==t?void 0:t.data}isOpaque(e,t,n){var r;return!(e<0||t<0||e>=this.ctxWidth||t>=this.ctxHeight)&&(null==(r=this.localData)?void 0:r[4*(t*this.ctxWidth+e)+3])>n}generateContour(e,t){const n=[];let[r,i]=t,a=0,o=0,s=NaN,u=NaN,c=0;do{c=0,this.isOpaque(r-1,i-1,e)&&(c+=1),this.isOpaque(r,i-1,e)&&(c+=2),this.isOpaque(r-1,i,e)&&(c+=4),this.isOpaque(r,i,e)&&(c+=8),6===c?(a=-1===u?-1:1,o=0):9===c?(a=0,o=1===s?-1:1):(a=this.contourDx[c],o=this.contourDy[c]),(a!==s||o!==u)&&(n.push([r,i]),s=a,u=o),r+=a,i+=o}while(t[0]!==r||t[1]!==i);return n}findContourStart(e){for(let t=0;t<this.ctxHeight;t++)for(let n=0;n<this.ctxWidth;n++)if(this.isOpaque(n,t,e))return[n,t];return null}generatePaths(e){this.localCanvas=document.createElement("canvas"),this.localCanvas.width=this.ctxWidth,this.localCanvas.height=this.ctxHeight,this.localCtx=this.localCanvas.getContext("2d");const t=new ImageData(this.data,this.ctxWidth,this.ctxHeight);this.localCtx.putImageData(t,0,0);const n=[];this.updateImageData();let r=this.findContourStart(e.alphaThreshold);for(;r;){const t=this.generateContour(e.alphaThreshold,r);n.push(t),this.localCtx.save(),this.localCtx.beginPath(),this.localCtx.moveTo(t[0][0],t[0][1]);for(const[e,n]of t)this.localCtx.lineTo(e,n);this.localCtx.closePath(),this.localCtx.clip(),this.localCtx.clearRect(0,0,this.ctxWidth,this.ctxHeight),this.localCtx.restore(),this.updateImageData(),r=this.findContourStart(e.alphaThreshold)}return n}}class w extends M{createSpans(e,t,n){const r=[];let i=!1;for(let a=0;a<e.length;a+=4){const o=e[a+3],s=a/4,u=s%t,c=Math.floor(s/t);o>n&&!i&&(r[c]=r[c]||[],r[c].push({l:u}),i=!0),(o<=n||u===t-1)&&i&&(i=!1,r[c][r[c].length-1].r=u)}return r}findCorners(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;return e.forEach((([e,a])=>{t=Math.min(t,e),r=Math.max(r,e),n=Math.min(n,a),i=Math.max(i,a)})),{topLeft:[t,n],topRight:[r,n],bottomLeft:[t,i],bottomRight:[r,i]}}findClosestPoints(e,t,n=1){const r=this.getBoundingBoxEdges(e),i=new Set,a=[];for(const{start:e,end:o}of r){let r=0;const s=[o[0]-e[0],o[1]-e[1]],u=Math.sqrt(s[0]**2+s[1]**2),c=[s[0]/u*n,s[1]/u*n];for(;r<=u;){const o=[e[0]+r*c[0],e[1]+r*c[1]],s=this.findClosestPoint(o,t),u=this.getPointKey(s);i.has(u)||(i.add(u),a.push(s)),r+=n}}return a}calculateDistance(e,t){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2)}findClosestPoint(e,t){let n=t[0],r=this.calculateDistance(e,n);for(const i of t){const t=this.calculateDistance(e,i);t<r&&(r=t,n=i)}return n}getBoundingBoxEdges(e){return[{start:e.topLeft,end:e.topRight},{start:e.topRight,end:e.bottomRight},{start:e.bottomRight,end:e.bottomLeft},{start:e.bottomLeft,end:e.topLeft}]}getPointKey(e){return`${e[0]},${e[1]}`}createPathFromSpans(e){const t=Object.keys(e).map(Number).sort(((e,t)=>e-t)),n=[];t.forEach((t=>{const r=e[t];for(const e of r)!e.l||!e.r||(n.push([e.r,t]),n.push([e.l,t]))}));const r=this.findCorners(n);return this.findClosestPoints(r,n,1)}generatePaths(e){const t=this.createSpans(this.data,this.ctxWidth,e.alphaThreshold);return[this.createPathFromSpans(t)]}}var T=(e=>(e[e.Contour=0]="Contour",e[e.Convex=1]="Convex",e[e.Span=2]="Span",e[e.BoundingBox=3]="BoundingBox",e[e.Circle=4]="Circle",e))(T||{});class x extends M{calculateConvexHull(e){if(e.length<3)return e;e.sort(((e,t)=>e[1]===t[1]?e[0]-t[0]:e[1]-t[1]));const t=e[0];e.sort(((e,n)=>{const r=this.crossProduct(t,e,n);return 0===r?this.distanceSquared(t,e)-this.distanceSquared(t,n):r>0?-1:1}));const n=[];for(const t of e){for(;n.length>1&&this.crossProduct(n[n.length-2],n[n.length-1],t)<=0;)n.pop();n.push(t)}return n}crossProduct(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}distanceSquared(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}extractPointsFromData(e,t,n,r){const i=[];for(let a=0;a<n;a++)for(let n=0;n<t;n++)this.isOpaque(e,n,a,r)&&i.push([n,a]);return i}isOpaque(e,t,n,r){return!(t<0||n<0||t>=this.ctxWidth||n>=this.ctxHeight)&&(null==e?void 0:e[4*(n*this.ctxWidth+t)+3])>r}generateConvexHullPath(e,t,n,r){const i=this.extractPointsFromData(e,t,n,r);return this.calculateConvexHull(i)}generatePaths(e){return[this.generateConvexHullPath(this.data,this.ctxWidth,this.ctxHeight,e.alphaThreshold)]}}class S extends _{constructor(e,t){super(e),b(this,"options"),this.options={alphaThreshold:20,...t}}findRegions(){return new A(this.ctxWidth,this.ctxHeight,this.data,this.options.alphaThreshold??0).findRegions()}findBestOutliner(){const e=this.findRegions();if(null==e||!e.length)throw new Error("No regions found");return 1===e.length?T.Contour:T.Convex}createOutliner(e){switch(e){case T.Contour:return new k(this.data,this.ctxWidth,this.ctxHeight);case T.Convex:return new x(this.data,this.ctxWidth,this.ctxHeight);case T.Span:return new w(this.data,this.ctxWidth,this.ctxHeight);default:throw new Error("Invalid Outliner Type")}}getBoundingBoxRegions(e=0){const t=this.findRegions();if(null==t||!t.length)return;let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let e of t)for(let t of e)n=Math.min(n,t[0]),r=Math.min(r,t[1]),i=Math.max(i,t[0]),a=Math.max(a,t[1]);return[[n-e,r-e],[i+e,r-e],[i+e,a+e],[n-e,a+e]]}getBoundingCircle(e){const[[t,n],[r],[,i]]=this.getBoundingBoxRegions(0),a=(t+r)/2,o=(n+i)/2;let s=0;for(let t of e){const e=t[0]-a,n=t[1]-o;s=Math.max(s,e*e+n*n)}return{center:[a,o],radius:Math.sqrt(s)}}generateCircularOutline(e=0){const t=this.findRegions();if(!t.length)return;const n=Array.prototype.concat(...t),r=this.getBoundingCircle(n),i=.5*e+1;return function(e,t,n){const r=[],i=2*Math.PI/n;for(let a=0;a<n;a++){const n=a*i,o=[e[0]+t*Math.cos(n),e[1]+t*Math.sin(n)];r.push(o)}return r}(r.center,r.radius+i,16)}generateContourOutline(e){return this.createOutliner(e).getOutline(this.options)}generateOutlines(e,t=0){const n=e??this.findBestOutliner();let r;switch(n){case T.Contour:case T.Convex:case T.Span:r=this.generateContourOutline(n);break;case T.BoundingBox:{const e=this.getBoundingBoxRegions(.5*t);r=e?[e]:void 0}break;case T.Circle:{const e=this.generateCircularOutline(t);r=e?[e]:void 0}break;default:throw new Error("Invalid Outliner Type")}return r}}var C=(e=>(e[e.RamerDouglasPeucker=1]="RamerDouglasPeucker",e[e.LineCurve=2]="LineCurve",e))(C||{});class E{simplifyPath(e,t){return[e[0],...this.rdp(e,0,e.length-1,t),e[e.length-1]]}getPerpendicularDistance(e,t,n){let r=n[0]-t[0],i=n[1]-t[1];if(0===r&&0===i)return Math.hypot(e[0]-t[0],e[1]-t[1]);let a=((e[0]-t[0])*r+(e[1]-t[1])*i)/(r*r+i*i);a=Math.max(0,Math.min(1,a));let o=[t[0]+a*r,t[1]+a*i];return Math.hypot(e[0]-o[0],e[1]-o[1])}rdp(e,t,n,r){if(t>=n)return[];let i=0,a=t;for(let r=t+1;r<n;r++){let o=this.getPerpendicularDistance(e[r],e[t],e[n]);o>i&&(i=o,a=r)}if(i>r){let i=this.rdp(e,t,a,r),o=this.rdp(e,a,n,r);return[...i,e[a],...o]}return[]}optimize(e,t){const n=t.rdpTolerance??2;return e.map((e=>this.simplifyPath(e,n)))}}class R{constructor(){b(this,"distanceThreshold"),b(this,"curveThreshold")}setOptions(e){const t={distanceThreshold:25,curveThreshold:5,...e};this.distanceThreshold=t.distanceThreshold,this.curveThreshold=t.curveThreshold}optimizePath(e){if(e.length<2)return e;const t=[e[0]];for(let n=1;n<e.length-1;n++){const r=t[t.length-1],i=e[n],a=e[n+1];this.shouldIncludePoint(r,i,a)&&t.push(i)}return t.push(e[e.length-1]),t}shouldIncludePoint(e,t,n){const r=this.calculateDistance(e,t)>this.distanceThreshold,i=!this.isStraightLine(e,t,n);return r||i}calculateDistance(e,t){return Math.sqrt((t[0]-e[0])**2+(t[1]-e[1])**2)}isStraightLine(e,t,n){return Math.abs((n[1]-t[1])*(t[0]-e[0])-(t[1]-e[1])*(n[0]-t[0]))<this.curveThreshold}optimize(e,t){return this.setOptions(t),e.map((e=>this.optimizePath(e)))}}class I{constructor(){b(this,"optimizers",{[C.LineCurve]:R,[C.RamerDouglasPeucker]:E})}optimize(e,t){const n=t.optimizerFlags??16777215;let r=e.slice();for(const[e,i]of Object.entries(this.optimizers)){n&parseInt(e,10)&&(r=(new i).optimize(r,t))}return r}}class O{constructor(e,t="line"){this.paths=e,this.type=t}getPaths(){var e;return null==(e=this.paths)?void 0:e.slice()}toBezierCurve(){var e;if(null==(e=this.paths)||!e.length)return new O;if("bezier"===this.type)return new O(this.paths,this.type);const t=this.paths.map((e=>function(e){if(e.length<3)return e;const t=e.length;let n=[];for(let r=0;r<t;r++){let i=e[(r-1+t)%t],a=e[r],o=e[(r+1)%t],s=[(i[0]+a[0])/2,(i[1]+a[1])/2],u=[(a[0]+o[0])/2,(a[1]+o[1])/2];n.push(s,a,u)}return n}(e)));return new O(t,"bezier")}toSvgPaths(){var e;return null!=(e=this.paths)&&e.length?this.paths.map((e=>"bezier"===this.type?function(e){if(e.length<4)throw new Error("At least 4 points are required for a cubic Bezier curve.");let t=`M ${e[0][0]} ${e[0][1]}`;for(let n=0;n<e.length-1;n+=3)t+=` C ${e[n][0]} ${e[n][1]}, ${e[n+1][0]} ${e[n+1][1]}, ${e[n+2][0]} ${e[n+2][1]}`;return t}(e):function(e){if(0===e.length)return"";let t=`M ${e[0][0]} ${e[0][1]}`;for(let n=1;n<e.length;n++)t+=` L ${e[n][0]} ${e[n][1]}`;return t+=" Z",t}(e))):[]}}class D{constructor(e,t){b(this,"outerCanvas"),b(this,"innerCanvas"),b(this,"scaleRatio"),b(this,"resolution"),this.innerCanvas=document.createElement("canvas"),this.innerCanvas.setAttribute("id","stickier-lower"),this.scaleRatio=1,this.setAppOptions(t??{}),this.setCanvas(e)}setAppOptions(e){return this.resolution=e.resolution??1024,this}setCanvas(e){return this.outerCanvas=e,this}initializeInnerCanvas(e){const t=this.outerCanvas.width,n=this.outerCanvas.height,r=this.resolution/t,i=this.resolution/n,a=Math.min(1,r,i);this.scaleRatio=a;const o=e.padding;this.innerCanvas.width=Math.floor(t*a)+2*o,this.innerCanvas.height=Math.floor(n*a)+2*o}preparePasses(e){if(!this.outerCanvas)throw new Error("No canvas provided");this.initializeInnerCanvas(e),function(e,t,n=0,r){const i=t.getContext("2d");if(!i)throw new Error("Failed to get 2D context of scaled canvas.");r&&i.clearRect(0,0,t.width,t.height),i.drawImage(e,n,n,t.width-2*n,t.height-2*n)}(this.outerCanvas,this.innerCanvas,e.padding,!0)}renderFirstPass(e){const t=new S(this.innerCanvas,e).generateOutlines(T.Contour);t&&function(e,t,n){const r=t.getContext("2d");if(!r)throw new Error("Failed to get 2D context of scaled canvas.");(n={clear:!0,strokeStyle:"black",...n}).clear&&r.clearRect(0,0,t.width,t.height);for(const t of e){r.beginPath(),t.length>0&&r.moveTo(t[0][0],t[0][1]),t.forEach((e=>{r.lineTo(e[0],e[1])})),r.lineTo(t[0][0],t[0][1]),r.closePath();for(const[e,t]of Object.entries(n))e in r&&(r[e]=t);"fillStyle"in n&&r.fill(),r.stroke()}}(t,this.innerCanvas,{clear:!0,fillStyle:"red",strokeStyle:"blue",lineWidth:e.padding*this.scaleRatio,lineJoin:"round",lineCap:"round"})}renderSecondPass(e){return new S(this.innerCanvas,e).generateOutlines()}optimizePaths(e,t){return(new I).optimize(e,t)}transformPathsBack(e){return e.map((e=>function(e,t,n,r,i,a){const o=n/2,s=r/2,u=1/t;return e.map((([e,t])=>[o+(e-i/2)*u,s+(t-a/2)*u]))}(e,this.scaleRatio,this.outerCanvas.width,this.outerCanvas.height,this.innerCanvas.width,this.innerCanvas.height)))}getBoundingBoxOutline(e){const t=new S(this.outerCanvas,e).generateOutlines(T.BoundingBox,e.padding);if(null!=t&&t.length)return t[0]}getCircleOutline(e){const t=new S(this.outerCanvas,e).generateOutlines(T.Circle,e.padding);if(null!=t&&t.length)return t[0]}getOutline(e){const t={type:"contour",padding:20,...e};let n;switch(this.preparePasses(t),t.type){case"contour":this.renderFirstPass(t),n=this.renderSecondPass(t),null!=n&&n.length&&(n=this.optimizePaths(n,t),n=this.transformPathsBack(n));break;case"rectangle":{const e=this.getBoundingBoxOutline(t);n=e?[e]:[]}break;case"circle":{const e=this.getCircleOutline(t);n=e?[e]:[]}break;default:throw new Error(`Unsupported outline option "${t.type}"`)}if(null!=n&&n.length)return new O(n,"line")}}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function F(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return N(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?N(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var L=function(){function e(){var t,n;(0,a.A)(this,e),(0,s.A)(this,"mDocCanvas",void 0),(0,s.A)(this,"mSvgCanvas",void 0),(0,s.A)(this,"mSvgGroup",void 0),(0,s.A)(this,"mStickier",void 0),(0,s.A)(this,"mObjectCache",[]),(0,s.A)(this,"mSvgCanvasGroups",[]),(0,s.A)(this,"mOriginalWidth",0),(0,s.A)(this,"mOriginalHeight",0),(0,s.A)(this,"mOptions",{limit_image_power_of_two:null!==(t=null===(n=window.xpv_settings)||void 0===n?void 0:n.limit_image_power_of_two)&&void 0!==t&&t})}return(0,o.A)(e,[{key:"createNewFabricText",value:function(e){var t,n,r,i="textbox"===e.type||e.multiline?fabric.Textbox:fabric.Text,a={textAlign:null!==(t=e.align)&&void 0!==t?t:"left",styles:e.styles,fontSize:e.fontSize||16};return e.multiline||(a.fontFamily=this.fontWithFallback(e.fontFamily)),new i(null!==(n=null===(r=e.text)||void 0===r?void 0:r.toString())&&void 0!==n?n:"",a)}},{key:"fontWithFallback",value:function(t){return t&&"".concat(t,", ").concat(e.fallbackFont)}},{key:"create",value:(L=(0,i.A)(c().mark((function e(t,n,r){var i,a,o,s,u,l=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.loadLibrary();case 2:if(this.resetObjectCache(),this.createDocumentCanvas(n,n,r.getCanvas()),this.mSvgCanvas=new fabric.StaticCanvas(this.mDocCanvas,{enableRetinaScaling:!1,width:n,height:n}),!h.N5.isValidURL(t)&&!h.N5.isBase64(t)){e.next=11;break}return e.next=8,this.loadSVGFromUrl(t);case 8:e.t0=e.sent,e.next=14;break;case 11:return e.next=13,this.loadSVGFromString(t);case 13:e.t0=e.sent;case 14:return i=e.t0,a=i.objects,o=i.options,this.mOriginalWidth=o.width,this.mOriginalHeight=o.height,s=this.getPlaceholders(t),a.forEach((function(e){var t=s.find((function(t){return t===e.id}));e.set("visible",e.get("visible")&&!t)})),u=fabric.util.groupSVGElements(a,o),this.mSvgGroup="group"===u.type?u:new fabric.Group([u],o),this.mSvgGroup.id||(this.mSvgGroup.id=this.generateUniqueId()),this.mSvgGroup.width>this.mSvgGroup.height?this.mSvgGroup.scaleToWidth(n):this.mSvgGroup.scaleToHeight(n),this.mSvgCanvas.add(this.mSvgGroup),this.mSvgCanvas.renderAll(),this.mObjectCache=a.map((function(e){return{id:e.id,uuid:m.V.uuidV4(),type:e.type,group:l.mSvgGroup,element:e,visible:!0,isSvg:!1}})),this.mStickier=new D(this.mDocCanvas),e.abrupt("return",{width:this.mSvgGroup.getScaledWidth(),height:this.mSvgGroup.getScaledHeight(),canvas:this.mDocCanvas});case 30:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return L.apply(this,arguments)})},{key:"destroy",value:function(){this.mSvgCanvas&&(this.mSvgCanvas.clear(),this.mSvgCanvas.dispose(),delete this.mSvgCanvas),this.mSvgGroup&&delete this.mSvgGroup,this.mDocCanvas&&void 0!==this.mDocCanvas.parentNode&&null!==this.mDocCanvas.parentNode&&this.mDocCanvas.parentNode.removeChild&&this.mDocCanvas.parentNode.removeChild(this.mDocCanvas),delete this.mDocCanvas,delete this.mStickier,this.mSvgCanvasGroups.splice(0),this.resetObjectCache()}},{key:"resolveObject",value:(N=(0,i.A)(c().mark((function e(t,n){var r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this.mObjectCache.find((function(e){return e.element.id==t})))){e.next=5;break}return e.next=4,this.createClipping(r,n);case 4:r=e.sent;case 5:return e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return N.apply(this,arguments)})},{key:"resolveObjectsLike",value:(P=(0,i.A)(c().mark((function e(t,n){var r,i,a,o,s;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new RegExp("^".concat(t.replace(/\*/g,".*"),"$"),"i"),i=[],a=F(this.mObjectCache),e.prev=3,a.s();case 5:if((o=a.n()).done){e.next=15;break}if(s=o.value,!r.test(s.element.id)){e.next=13;break}return e.t0=i,e.next=11,this.createClipping(s,n);case 11:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 13:e.next=5;break;case 15:e.next=20;break;case 17:e.prev=17,e.t2=e.catch(3),a.e(e.t2);case 20:return e.prev=20,a.f(),e.finish(20);case 23:return e.abrupt("return",i);case 24:case"end":return e.stop()}}),e,this,[[3,17,20,23]])}))),function(e,t){return P.apply(this,arguments)})},{key:"getBoundaries",value:(O=(0,i.A)(c().mark((function e(t){var n,r,i,a,o,s=arguments;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]&&s[1],e.next=3,this.resolveObject(t);case 3:if((r=e.sent)&&r.element){e.next=6;break}return e.abrupt("return",null);case 6:return i=r.element,a={left:i.left*i.scaleX,top:i.top*i.scaleY,width:i.width*i.scaleX,height:i.height*i.scaleY},n&&(o=i.getObjectScaling(),a.localScaleX=i.scaleX,a.localScaleY=i.scaleY,a.scaleX=o.scaleX,a.scaleY=o.scaleY),e.abrupt("return",a);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)})},{key:"getBoundariesSync",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t){var i=this.mSvgCanvasGroups.find((function(e){return e.id===t}));if(!i)return;n=i.group.getObjects().find((function(t){return t.id==e}))}else{var a=this.mObjectCache.find((function(t){return t.element.id==e}));if(!a)return;n=a.element}if(n){r&&n.setCoords();var o=n.getObjectScaling(),s=n.getCoords(),u=n.getBoundingRect();return{left:n.left,top:n.top,width:n.width,height:n.height,coords:{tl:s[0],tr:s[1],br:s[2],bl:s[3]},angle:n.angle,scaleX:n.scaleX,scaleY:n.scaleY,worldScaleX:o.scaleX,worldScaleY:o.scaleY,bbox:{min:{x:u.left,y:u.top},max:{x:u.left+u.width,y:u.top+u.height}}}}}},{key:"getCanvasBoundaries",value:function(){if(!this.mSvgCanvas)return null;var e=this.mSvgCanvas.getCenter(),t=this.mSvgCanvas.getWidth(),n=this.mSvgCanvas.getHeight();return{left:e.left-.5*t,top:e.top-.5*n,width:t,height:n}}},{key:"updateImageProperties",value:(I=(0,i.A)(c().mark((function e(t,n,r,i,a,o,s,u,l,h){var f,m,p,d,v,y;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f=null!=s?s:0,m=null!=u?u:1,p=this.initImageObject(t),!n&&p.element.resizeFilter&&this.disableResizeFilter(p.element),e.next=6,this.setImageSource(p,n,r);case 6:p=e.sent,n&&!p.element.resizeFilter&&this.enableResizeFilter(p.element),p.element.set({visible:t.visible,originX:"center",originY:"center",scaleX:p.sx*m*p.fit,scaleY:p.sy*m*p.fit,flipX:null!=l&&l,flipY:null!=h&&h}).rotate(p.angle+f),d=this.applyContainerOffset(p,o,i,a),v=d.offsetX,y=d.offsetY,p.element.set({top:p.top+y,left:p.left+v});case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i,a,o,s,u,c){return I.apply(this,arguments)})},{key:"generateObjectsAndReplaceElement",value:(R=(0,i.A)(c().mark((function e(t,n){var r,i,a,o=arguments;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>2&&void 0!==o[2]&&o[2],e.next=3,this.loadObjectsFromSvgSource(t,r);case 3:return(i=e.sent).set("id",n.element.id),this.copyWorldDefinition(n.element,i),(a=n.element.group).remove(n.element),a.add(i),e.abrupt("return",i);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"convertSvgToElements",value:(E=(0,i.A)(c().mark((function e(t,n,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.originalElement=t.element,e.next=3,this.generateObjectsAndReplaceElement(n,t);case 3:return t.element=e.sent,t.element.set({visible:t.visible,originX:"center",originY:"center"}),t.fit=this.calculateImageFit(t,r),e.abrupt("return",t);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return E.apply(this,arguments)})},{key:"updatePattern",value:(C=(0,i.A)(c().mark((function e(t,n,r){var i,a,o,s,u,l,f,p,d,v=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.src!==n){e.next=2;break}return e.abrupt("return");case 2:return a=null!=r?r:1,(o=this.initImageObject(t)).src=n,o.pattern=h.N5.isSvg(n),e.next=8,this.resolvePatternElement(n);case 8:if(s=e.sent,u=o.element,o.element=s,o.fit=this.calculateImageFit(o,"cover"),!o.pattern){e.next=23;break}if("group"!==(null==u?void 0:u.type)){e.next=22;break}l=u.getObjects(),f=c().mark((function e(){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"group"===(t=l.pop()).type&&t.getObjects().forEach((function(e){l.push(e)})),v.mObjectCache=v.mObjectCache.filter((function(e){var n;return(null===(n=e.element)||void 0===n?void 0:n.id)!==t.id}));case 3:case"end":return e.stop()}}),e)}));case 16:if(!(l.length>0)){e.next=20;break}return e.delegateYield(f(),"t0",18);case 18:e.next=16;break;case 20:e.next=23;break;case 22:this.mObjectCache=this.mObjectCache.filter((function(e){var t;return(null===(t=e.group)||void 0===t?void 0:t.id)!==u.id}));case 23:p=u.getPointByOrigin("center","center"),(d=null!==(i=u.group)&&void 0!==i?i:this.mSvgGroup).remove(u),d.add(s),s.set({id:u.id,scaleX:o.sx*a*o.fit,scaleY:o.sy*a*o.fit,dirty:!0}).rotate(o.angle).setPositionByOrigin(p,"center","center"),o.pattern&&s.getObjects().forEach((function(e){v.mObjectCache.push({id:e.id,uuid:m.V.uuidV4(),type:e.type,element:e,group:s,parent:o,visible:!0})}));case 29:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return C.apply(this,arguments)})},{key:"calculateFitRatio",value:function(e,t){var n=e.getScaledWidth(),r=e.getScaledHeight(),i=n/t.getScaledWidth(),a=r/t.getScaledHeight();return Math.min(i,a)}},{key:"updateTextProperty",value:function(e,t,n,r,i,a,o){var s,u,c,l,f,m,p,d,v,y,g,b,A,_,M,k,w=this.initTextObject(e,n);(h.N5.isNumeric(a.fontSize)&&w.element.set("fontSize",a.fontSize),a.fontFamily&&w.element.set("fontFamily",a.fontFamily),a.color&&w.element.set("fill",a.color),n)||w.element.set("underline",null!==(k=a.underline)&&void 0!==k&&k);var T=null!==(s=null===(u=a.styles)||void 0===u?void 0:u.map((function(e){return e.map((function(e){return!n&&"underline"in e&&delete e.underline,"charSpacing"in e&&delete e.charSpacing,e}))})))&&void 0!==s?s:null;if(w.element.set({text:t.toString(),opacity:null!==(c=a.opacity)&&void 0!==c?c:1,fontWeight:null!==(l=a.fontWeight)&&void 0!==l?l:"normal",fontStyle:null!==(f=a.fontStyle)&&void 0!==f?f:"normal",textAlign:null!==(m=a.textAlign)&&void 0!==m?m:"left",visible:w.visible,scaleX:w.sx*(null!==(p=o.scaleX)&&void 0!==p?p:1),scaleY:w.sy*(null!==(d=o.scaleY)&&void 0!==d?d:1),styles:T,flipX:null!==(v=o.flipX)&&void 0!==v&&v,flipY:null!==(y=o.flipY)&&void 0!==y&&y,lineHeight:null!==(g=a.lineHeight)&&void 0!==g?g:1.16}),w.element.rotate(w.angle+(null!==(b=o.rotation)&&void 0!==b?b:0)),w.element.setCoords(),r&&w.hasClipping&&null!==(A=w.group)&&void 0!==A&&A.clipPath){var x,S,C=this.calculateFitRatio(w.group.clipPath,w.element);if(C<1)C*=i,w.element.set({scaleX:w.sx*(null!==(x=o.scaleX)&&void 0!==x?x:1)*C,scaleY:w.sy*(null!==(S=o.scaleY)&&void 0!==S?S:1)*C})}var E=this.applyContainerOffset(w,o.offsetUnit,null!==(_=o.offsetX)&&void 0!==_?_:0,null!==(M=o.offsetY)&&void 0!==M?M:0),R=E.offsetX,I=E.offsetY;w.element.set({top:w.top+I,left:w.left+R})}},{key:"updateGradientProperty",value:(S=(0,i.A)(c().mark((function e(t,n,i,a){var o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=new fabric.Gradient({type:"linear",gradientUnits:"percentage",coords:a===r.LeftRight?{x1:0,y1:0,x2:1,y2:0}:{x1:0,y1:0,x2:0,y2:1},colorStops:[{offset:0,color:n},{offset:1,color:i}]}),t.element.set("fill",o);case 2:case"end":return e.stop()}}),e)}))),function(e,t,n,r){return S.apply(this,arguments)})},{key:"updateElementProperty",value:function(e,t,n){e.element.set(t,n)}},{key:"updateElementVisibility",value:function(e,t){e.element.set("visible",t);var n=this.mSvgCanvasGroups.find((function(t){return t.originalId===e.element.id}));n&&n.group.set("visible",t)}},{key:"render",value:function(){this.mSvgCanvas&&(this.sortSettingsLayers(),this.mSvgCanvas.renderAll())}},{key:"upSertObjectToGroupOnCanvas",value:(x=(0,i.A)(c().mark((function e(t,n){var r,i,a,o,s,u,l,m,p,d,v,y,g,b;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o=n._objects.find((function(e){return e.id===t.id}))){e.next=14;break}e.t0=t.type,e.next="image"===e.t0?6:"i-text"===e.t0||"textbox"===e.t0?10:12;break;case 6:return e.next=8,this.loadImageFromUrl(null!==(r=t.imageSrc)&&void 0!==r?r:"");case 8:return o=e.sent,e.abrupt("break",13);case 10:return o=this.createNewFabricText(t),e.abrupt("break",13);case 12:return e.abrupt("break",13);case 13:n.add(o);case 14:if(o){e.next=16;break}return e.abrupt("return");case 16:e.t1=t.type,e.next="image"===e.t1?19:"i-text"===e.t1||"textbox"===e.t1?25:29;break;case 19:if(o.getSrc()===t.imageSrc){e.next=22;break}return e.next=22,this.replaceImageSource(o,t.imageSrc);case 22:return o.imageSrc&&!o.resizeFilter?this.enableResizeFilter(o):!o.imageSrc&&o.resizeFilter&&this.disableResizeFilter(o),o.setOptions(B(B(B(B({scaleX:t.scaleX,scaleY:t.scaleY,top:t.top+n.clipPath.top,left:t.left+n.clipPath.left,angle:t.angle,id:t.id,fileName:t.fileName,flipX:null!==(i=t.flipX)&&void 0!==i&&i,flipY:null!==(a=t.flipY)&&void 0!==a&&a,opacity:(0,h.kf)(t.opacity)?t.opacity:1},t.originX&&{originX:t.originX}),t.originY&&{originY:t.originY}),(0,h.kf)(t.width)&&{width:t.width}),(0,h.kf)(t.height)&&{height:t.height})),e.abrupt("break",30);case 25:return g=null!==(s=null===(u=t.styles)||void 0===u?void 0:u.map((function(e){return e.map((function(e){return!t.multiline&&"underline"in e&&delete e.underline,"charSpacing"in e&&delete e.charSpacing,e}))})))&&void 0!==s?s:null,o.setOptions(B(B(B(B(B(B({scaleX:t.scaleX,scaleY:t.scaleY,top:t.top+n.clipPath.top,left:t.left+n.clipPath.left,angle:t.angle,id:t.id,text:null!==(l=null===(m=t.text)||void 0===m?void 0:m.toString())&&void 0!==l?l:"",textAlign:t.align||t.textAlign||"left",flipX:null!==(p=t.flipX)&&void 0!==p&&p,flipY:null!==(d=t.flipY)&&void 0!==d&&d,fontWeight:null!==(v=t.fontWeight)&&void 0!==v?v:"normal",fontStyle:null!==(y=t.fontStyle)&&void 0!==y?y:"normal",styles:g,opacity:(0,h.kf)(t.opacity)?t.opacity:1},t.originX&&{originX:t.originX}),t.originY&&{originY:t.originY}),(0,h.kf)(t.lineHeight)&&{lineHeight:t.lineHeight}),(0,h.kf)(t.fontSize)&&{fontSize:t.fontSize}),(0,h.kf)(t.width)&&{width:t.width}),(0,h.kf)(t.height)&&{height:t.height})),t.multiline||o.setOptions({fill:t.fill||"#000000",fontFamily:this.fontWithFallback(t.fontFamily),underline:null!==(b=t.underline)&&void 0!==b&&b}),e.abrupt("break",30);case 29:return e.abrupt("break",30);case 30:e.next=35;break;case 32:e.prev=32,e.t2=e.catch(0),f.UX.error(e.t2);case 35:case"end":return e.stop()}}),e,this,[[0,32]])}))),function(e,t){return x.apply(this,arguments)})},{key:"generateStickerForGroup",value:function(e,t,n){var r,i;if(0!==e._objects.filter((function(e){return!e.id||!e.id.startsWith("XPV_SYSTEM")})).length){n=B({distanceThreshold:0,curveThreshold:0,alphaThreshold:0,padding:40,rdpTolerance:2},n);var a,o=[],s=F(this.mSvgCanvas._objects);try{for(s.s();!(a=s.n()).done;){var u=a.value;o.push(void 0===u.visible||u.visible),u.set({visible:!1})}}catch(e){s.e(e)}finally{s.f()}e.set({visible:!0});var c,l=e._objects.find((function(e){return"XPV_SYSTEM_STICKER"===e.id}));l&&l.set({visible:!1}),this.render();try{var h=this.mStickier.getOutline(B({type:t},n));"contour"!==t&&"circle"!==t||(h=h.toBezierCurve()),c=h.toSvgPaths()}catch(e){console.error(e)}for(var f=0;f<o.length;f++)this.mSvgCanvas._objects[f].set({visible:o[f]});if(l&&l.set({visible:!0}),this.render(),null!==(r=c)&&void 0!==r&&r[0])return this.svgPathToLocalGroup(e,null===(i=c)||void 0===i?void 0:i[0])}}},{key:"svgPathToLocalGroup",value:function(e,t){var n=new fabric.Path(t);n.setCoords();var r=n.calcTransformMatrix(),i=e.calcTransformMatrix(),a=fabric.util.invertTransform(i),o=fabric.util.multiplyTransformMatrices(a,r),s=fabric.util.transformPoint(new fabric.Point(n.left,n.top),a),u=fabric.util.qrDecompose(o);return{path:t,left:s.x,top:s.y,scaleX:u.scaleX,scaleY:u.scaleY,angle:u.angle,skewX:u.skewX,skewY:u.skewY}}},{key:"upsertStickerToGroup",value:function(e,t){var n,r;if(this.removeStickerFromGroup(e),this.render(),t.type&&t.data){var i=t.data,a=new fabric.Path(i.path,B(B(B(B(B(B(B({id:"XPV_SYSTEM_STICKER",fill:null!==(n=t.backgroundColor)&&void 0!==n?n:"white",stroke:null!==(r=t.strokeColor)&&void 0!==r?r:"black",strokeWidth:(0,h.kf)(t.strokeWidth)?t.strokeWidth:2,strokeDashArray:Array.isArray(t.strokeDashArray)&&t.strokeDashArray.length?t.strokeDashArray:[20]},i.left&&{left:i.left}),i.top&&{top:i.top}),i.scaleX&&{scaleX:i.scaleX}),i.scaleY&&{scaleY:i.scaleY}),i.angle&&{angle:i.angle}),i.skewX&&{skewX:i.skewX}),i.skewY&&{skewY:i.skewY}));e.add(a),a.sendToBack(),this.render()}}},{key:"removeStickerFromGroup",value:function(e){var t=e._objects.find((function(e){return"XPV_SYSTEM_STICKER"===e.id}));t&&e.remove(t)}},{key:"getPlaceholders",value:function(e){var t=document.createElement("div");t.innerHTML=e;var n=t.querySelectorAll("[data-printmark],[data-hide],[data-placeholder]"),r=[];return n.forEach((function(e){(e.hasAttribute("data-hide")||"true"===e.getAttribute("data-printmark")||"true"===e.getAttribute("data-placeholder"))&&r.push(e.id)})),r}},{key:"getGroupWrapped",value:(T=(0,i.A)(c().mark((function e(t,n){var r,i,a,o,s=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.mSvgCanvasGroups.find((function(e){return e.id===t})),!r){e.next=3;break}return e.abrupt("return",r);case 3:if(i=this.mObjectCache.find((function(e){return e.element.id===n}))){e.next=6;break}return e.abrupt("return",null);case 6:return e.next=8,new Promise((function(e){return i.element.clone((function(t){s.mSvgCanvas._objects.length>0&&s.mSvgCanvas._objects[0].remove(i.element);var n=s.createNewSvgGroup(!0);n.clipPath=t,e(n)}))}));case 8:return(a=e.sent).remove(a.getObjects()),o={group:a,id:t,originalId:n},this.mSvgCanvasGroups.push(o),this.mSvgCanvas.add(o.group),e.abrupt("return",o);case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"removeFromGroup",value:function(e,t){var n=this.mSvgCanvasGroups.find((function(e){return e.id===t}));n&&n.group.remove(e)}},{key:"rotate2dVector",value:function(e,t){if(2!==e.length)return e;var n=.0174533*t,r=Math.cos(n),i=Math.sin(n);return[r*e[0]-i*e[1],i*e[0]+r*e[1]]}},{key:"rotateSize",value:function(e,t,n){var r=this.rotate2dVector([e,t],n);return{width:Math.abs(r[0]),height:Math.abs(r[1])}}},{key:"applyContainerOffset",value:function(e,t,n,r){var i=n,a=r;if("percentage"!==t||!e.element||!e.hasClipping)return{offsetX:i,offsetY:a};var o=this.rotateSize(e.element.getScaledWidth(),e.element.getScaledHeight(),e.angle||0),s=this.rotateSize(e.group.clipPath.getScaledWidth(),e.group.clipPath.getScaledHeight(),e.group.clipPath.angle);return{offsetX:i=(s.width+.5*(o.width-s.width))*(i/100),offsetY:a=(s.height+.5*(o.height-s.height))*(a/100)}}},{key:"loadImageSource",value:(w=(0,i.A)(c().mark((function e(t,n){var r=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=(0,i.A)(c().mark((function e(i,a){var o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=h.N5.makeUrlUnique(n),!(0,h.Gz)(o)||!r.mOptions.limit_image_power_of_two){e.next=5;break}return e.next=4,p.resizeImageToPowerOfTwo(o);case 4:o=e.sent;case 5:t.element.setSrc(o,(function(e,r){if(r)return a("Unable to load image source: ".concat(n));t.element.set({dirty:!0}),i()}),{crossOrigin:"anonymous"});case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return w.apply(this,arguments)})},{key:"replaceImageSource",value:(k=(0,i.A)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=t.width,a=t.height;t.setSrc(n,(function(o,s){if(s)return r("Unable to load image source: ".concat(n));if(t.set({dirty:!0}),h.N5.isSvg(t.getSrc())){var u=i/o.width,c=a/o.height;o.scaleX=u,o.scaleY=c}e()}),{crossOrigin:"anonymous"})})));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return k.apply(this,arguments)})},{key:"setImageSource",value:(M=(0,i.A)(c().mark((function e(t,n,r){var i,a;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||t.src!==n){e.next=2;break}return e.abrupt("return",t);case 2:return d.K.eventBus().dispatch(new v.r(y.E.MediaDownload,{loading:!0,source:n})),"group"===(null===(i=t.element)||void 0===i?void 0:i.type)&&((a=t.element.group).remove(t.element),t.element=t.originalElement,t.element&&a.add(t.element),delete t.originalElement),t.src=n,t.isSvg=(0,h.$D)(n),e.prev=6,e.next=9,this.loadImageSource(t,n);case 9:return n&&0!==n.length?t.fit=this.calculateImageFit(t,r):t.fit=1,e.abrupt("return",t);case 11:return e.prev=11,d.K.eventBus().dispatch(new v.r(y.E.MediaDownload,{loading:!1,source:n})),e.finish(11);case 14:case"end":return e.stop()}}),e,this,[[6,,11,14]])}))),function(e,t,n){return M.apply(this,arguments)})},{key:"calculateImageFit",value:function(e,t){var n=e.element.width<.001?.001:e.element.width,r=e.element.height<.001?.001:e.element.height,i=e.width/n,a=e.height/r;switch(t){case"contain":return Math.min(i,a);case"cover":return Math.max(i,a);default:return 1}}},{key:"initImageObject",value:function(e){if(e.init)return e;var t=e.element,n=this.rotate2dVector([.5*t.getScaledWidth(),.5*t.getScaledHeight()],t.angle);return e=Object.assign(e,{init:!0,width:t.getScaledWidth(),height:t.getScaledHeight(),sx:1,sy:1,angle:t.angle,top:t.top+n[1],left:t.left+n[0],fit:1,src:null,isSvg:!1})}},{key:"loadImageFromUrl",value:(_=(0,i.A)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){return fabric.Image.fromURL(h.N5.makeUrlUnique(t),(function(r,i){if(i)return n("Unable to load image: ".concat(t));e(r)}),{crossOrigin:"anonymous"})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return _.apply(this,arguments)})},{key:"disableResizeFilter",value:function(e){e&&e.resizeFilter&&(e.resizeFilter=void 0)}},{key:"enableResizeFilter",value:function(e){return null!=e&&e.resizeFilter||null==e||!e.getScaledWidth()||null==e||!e.getScaledHeight()||(e.resizeFilter=new fabric.Image.filters.Resize({resizeType:"sliceHack"}),e.minimumScaleTrigger=1,e.applyResizeFilters()),e}},{key:"initTextObject",value:function(e,t){if(e.init)return e;var n=e.element,r=this.rotate2dVector([(.5*n.width+.5*n.strokeWidth)*n.scaleX,(.5*n.height+.5*n.strokeWidth)*n.scaleY],n.angle);if(e=Object.assign(e,{init:!0,top:n.top+r[1],left:n.left+r[0],angle:n.angle,sx:n.scaleX,sy:n.scaleY}),n.set({originX:"center",originY:"center",fill:n.fill,top:e.top,left:e.left}).setCoords(),!t)return e;var i=new fabric.Textbox("",{id:n.id,fontSize:16,fill:n.fill,originX:"center",originY:"center"});return this.copyWorldDefinition(n,i),e.group.remove(n),e.group.add(i),e.element=i,e}},{key:"createNewSvgGroup",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=new fabric.Group;return e&&this.copyWorldDefinition(this.mSvgGroup,t),t}},{key:"getRootGroup",value:function(){return this.mSvgGroup}},{key:"getOriginalWidth",value:function(){return this.mOriginalWidth}},{key:"getOriginalHeight",value:function(){return this.mOriginalHeight}},{key:"getObjects",value:function(){return this.mObjectCache}},{key:"getCanvas",value:function(){return this.mDocCanvas}},{key:"getSvgCanvas",value:function(){return this.mSvgCanvas}},{key:"createClipping",value:(A=(0,i.A)(c().mark((function e(t,n){var r=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&!t.hasClipping){e.next=2;break}return e.abrupt("return",t);case 2:return e.abrupt("return",new Promise((function(e,i){var a,o=t.element,s=t.element.group,u=null===(a=r.mObjectCache.find((function(e){return e.element.id===n})))||void 0===a?void 0:a.element;if(!u)return i("Clipping element not found: ".concat(n));u.set("visible",!1),u.clone((function(i){i.set("visible",!0);var a=r.mSvgGroup===s;a?r.mSvgGroup.remove(o):s.remove(o);var u=r.createNewSvgGroup(a);u.id="".concat(n,"_group"),i.id="".concat(n,"_clone"),u.add(o),u.add(i),a?r.mSvgCanvas.add(u):s.add(u),t.hasClipping=!0,t.group=u,a||(u.width=s.width,u.height=s.height,u.scaleX=s.scaleX,u.scaleY=s.scaleY,u.setPositionByOrigin(new fabric.Point(0,0),"center","center"),u._updateObjectsCoords(),u.setCoords()),u.clipPath=i,u.remove(i),e(t)}))})));case 3:case"end":return e.stop()}}),e)}))),function(e,t){return A.apply(this,arguments)})},{key:"copyWorldDefinition",value:function(e,t){["aCoords","oCoords","width","height","scaleX","scaleY","zoomX","zoomY","minX","minY","viewBoxHeight","viewBoxWidth","lineCoords","pathOffset"].forEach((function(n){void 0!==t[n]&&void 0!==e[n]&&(t[n]=e[n])}))}},{key:"resetObjectCache",value:function(){this.mObjectCache=[]}},{key:"loadLibrary",value:(b=(0,i.A)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof fabric){e.next=2;break}return e.abrupt("return",l.A.loadScript("https://cdn.jsdelivr.net/npm/fabric@4.6.0/dist/fabric.min.js"));case 2:case"end":return e.stop()}}),e)}))),function(){return b.apply(this,arguments)})},{key:"createDocumentCanvas",value:function(e,t,n){this.mDocCanvas=n||document.createElement("canvas"),this.mDocCanvas.width=e,this.mDocCanvas.height=t,this.mDocCanvas.style.background="transparent",this.mDocCanvas.style.display="none",n||document.body.appendChild(this.mDocCanvas)}},{key:"loadSVGFromString",value:(g=(0,i.A)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){fabric.loadSVGFromString(t,(function(t,n){return e({objects:t,options:n})}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return g.apply(this,arguments)})},{key:"loadSVGFromUrl",value:(u=(0,i.A)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){fabric.loadSVGFromURL(t,(function(t,n){return e({objects:t,options:n})}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return u.apply(this,arguments)})},{key:"checkPointInsideObject",value:function(e,t,n,r){var i;if(r){var a=this.mSvgCanvasGroups.find((function(e){return e.id===r}));if(!a)return!1;i=a.group.getObjects().find((function(e){return e.id==n}))}else{var o=this.mObjectCache.find((function(e){return e.element.id==n}));if(!o)return!1;i=o.element}return!!i&&i.containsPoint(new fabric.Point(e,t),void 0,!1,!0)}},{key:"sortSettingsLayers",value:function(){var e=this,t=this.mObjectCache.filter((function(e){return e.element.isWatermark}));t.length&&t.forEach((function(t){e.mSvgCanvas.bringToFront(t.element)}))}},{key:"resolvePatternElement",value:(n=(0,i.A)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!h.N5.isSvg(t)){e.next=2;break}return e.abrupt("return",this.loadObjectsFromSvgSource(t));case 2:return e.abrupt("return",this.loadImageFromUrl(t));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"loadObjectsFromSvgSource",value:(t=(0,i.A)(c().mark((function e(t){var n,r=this,i=arguments;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]&&i[1],e.abrupt("return",new Promise((function(e,i){fabric.loadSVGFromURL(h.N5.makeUrlUnique(t),(function(t,a){if(null!==t){a.width&&a.height?a.centerPoint={x:a.width/2,y:a.height/2}:(delete a.width,delete a.height);var o=new fabric.Group(t,a);o.id=r.generateUniqueId(),n&&(o.user_data=o.user_data||{},o.user_data.grouped_image=!0),e(o)}else i(!1)}),null,{crossOrigin:"anonymous"})})));case 2:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"generateUniqueId",value:function(){return"XPV_".concat(m.V.uuidV4())}}]);var t,n,u,g,b,A,_,M,k,w,T,x,S,C,E,R,I,O,P,N,L}();(0,s.A)(L,"fallbackFont",'"Times New Roman", sans-serif, Arial')},71390:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Z:function(){return ActionArithmeticOperationProcess}});var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(60825),core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0__),_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(23029),_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(92901),_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(50388),_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(53954),_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(85501),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(27495),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(90906),core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(25440),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_3__),_core_process_object__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(5148),_core_process_event__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(98843),util__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(40537),util__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_7__),_utils_variables_class__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(74461),_services_syslog_service__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(63805);function _callSuper(e,t,n){return t=(0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__.A)(t),(0,_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__.A)(e,_isNativeReflectConstruct()?Reflect.construct(t,n||[],(0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__.A)(e).constructor):t.apply(e,n))}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}var ActionArithmeticOperationProcess=function(_ProcessObject){function ActionArithmeticOperationProcess(){return(0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_10__.A)(this,ActionArithmeticOperationProcess),_callSuper(this,ActionArithmeticOperationProcess,arguments)}return(0,_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_11__.A)(ActionArithmeticOperationProcess,_ProcessObject),(0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_12__.A)(ActionArithmeticOperationProcess,[{key:"resolveEventType",value:function(e){return e.data.attribute_type||e.type}},{key:"onHandleInPort",value:function onHandleInPort(aEvent){_services_syslog_service__WEBPACK_IMPORTED_MODULE_9__.UX.print("Rule: Handle arithmetic operation");var arithmeticOperation=null;(0,util__WEBPACK_IMPORTED_MODULE_7__.isNullOrUndefined)(this.getMetadata().arithmetic_operation)||(arithmeticOperation=this.getMetadata().arithmetic_operation);var outPortName="fail",inputValue=null;switch(this.resolveEventType(aEvent)){case"operable_numbers_input":case"text_to_image":case"text_input":inputValue=aEvent.data.attribute_value_name;break;default:inputValue=aEvent.data.value}if(null!==arithmeticOperation&&_utils_variables_class__WEBPACK_IMPORTED_MODULE_8__.N5.isNumeric(inputValue))for(;arithmeticOperation.indexOf("{value}")>=0;)arithmeticOperation=arithmeticOperation.replace("{value}",inputValue);if(null!==arithmeticOperation&&/^([\d\(\)\+\-\.\*><=/%!\:+\s\?])+$/.test(arithmeticOperation))try{inputValue=eval(arithmeticOperation),outPortName="result"}catch(e){_services_syslog_service__WEBPACK_IMPORTED_MODULE_9__.UX.error("Unable to process arithmetic rule.",e),outPortName="fail"}return[new _core_process_event__WEBPACK_IMPORTED_MODULE_13__.i("input",{value:inputValue},this,outPortName)]}}])}(_core_process_object__WEBPACK_IMPORTED_MODULE_6__.Z)},87641:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{w:function(){return ActionRotateOffsetProcess}});var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(60825),core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0__),_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__(80296),_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(23029),_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(92901),_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(50388),_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(53954),_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(85501),_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(64467),core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(28706),core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(44114),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(54554),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(2892),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_number_is_finite_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(25428),core_js_modules_es_number_is_finite_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_number_is_finite_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(26099),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(3362),core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(27495),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(90906),core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(25440),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_esnext_async_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(9920),core_js_modules_esnext_async_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_esnext_async_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(98992),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(3949),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_13__),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(23500),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14__),_core_process_object__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(5148),_services_syslog_service__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(63805),_maths_quaternion__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(37842),_maths_euler__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(209),_maths_math_utils__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(69780),rxjs__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(27291),rxjs_operators__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__(67791),rxjs_operators__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__(99335),_object_animation__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(1208),_engine_application_modules__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(41840),_engine_communication_events_editor_subscription_event__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(94273),_engine_enums_editor_subscription_types_enum__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(33153),_engine_scenegraph_product_node__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(48283),_engine_scenegraph_reference_product_node__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(62411),_engine_utils_variables_class__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(74461);function _callSuper(e,t,n){return t=(0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_15__.A)(t),(0,_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_16__.A)(e,_isNativeReflectConstruct()?Reflect.construct(t,n||[],(0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_15__.A)(e).constructor):t.apply(e,n))}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}var ActionRotateOffsetProcess=function(_ProcessObject){function ActionRotateOffsetProcess(){var e;(0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_29__.A)(this,ActionRotateOffsetProcess);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e=_callSuper(this,ActionRotateOffsetProcess,[].concat(n)),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_30__.A)(e,"onOffsetManagerSubject",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_30__.A)(e,"mSceneOffsetManager",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_30__.A)(e,"productSceneObjectId",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_30__.A)(e,"productNode",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_30__.A)(e,"destroyed$",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_30__.A)(e,"subscriptions",[]),e}return(0,_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_31__.A)(ActionRotateOffsetProcess,_ProcessObject),(0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_32__.A)(ActionRotateOffsetProcess,[{key:"onInit",value:function(){var e,t=this;this.onOffsetManagerSubject=new rxjs__WEBPACK_IMPORTED_MODULE_33__.B,this.destroyed$=new rxjs__WEBPACK_IMPORTED_MODULE_33__.B,this.productSceneObjectId=null!==(e=this.getMetadata().value_product)&&void 0!==e?e:null,this.subscriptions.push(_engine_application_modules__WEBPACK_IMPORTED_MODULE_23__.K.eventBus().subscribe(_engine_communication_events_editor_subscription_event__WEBPACK_IMPORTED_MODULE_24__.r.getTopicName(_engine_enums_editor_subscription_types_enum__WEBPACK_IMPORTED_MODULE_25__.E.ProductFinishedLoading),(function(){t.productNode||t.findAndSubscribeToProduct()}))),this.findAndSubscribeToProduct()}},{key:"onDestroy",value:function(){this.destroyed$&&(this.destroyed$.next(),this.destroyed$.complete(),delete this.destroyed$),this.subscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.productNode&&delete this.productNode,this.onOffsetManagerSubject&&(this.onOffsetManagerSubject.error("Destroyed"),delete this.onOffsetManagerSubject)}},{key:"findAndSubscribeToProduct",value:function(){var e=this;if(this.productSceneObjectId){var t=_engine_application_modules__WEBPACK_IMPORTED_MODULE_23__.K.sceneManager().findNodesOfType(_engine_scenegraph_reference_product_node__WEBPACK_IMPORTED_MODULE_27__.t.TypeRTTI,(function(t){return t.getSceneObjectId()===e.productSceneObjectId})),n=_engine_application_modules__WEBPACK_IMPORTED_MODULE_23__.K.sceneManager().findNodesOfType(_engine_scenegraph_product_node__WEBPACK_IMPORTED_MODULE_26__.i.TypeRTTI,(function(t){return t.getSceneObjectId()===e.productSceneObjectId}));if(n.length>0){var r=(0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_34__.A)(n,1);this.productNode=r[0]}else if(t.length>0){var i=t[0].getChildren(),a=(0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_34__.A)(i,1);this.productNode=a[0]}}else this.productNode=this.getProcessManager().getProductNode();this.productNode&&this.productNode.onConfigurableNodeReady.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_35__.Q)(this.destroyed$)).subscribe({next:function(t){t.resolveSceneOffsetManager().then((function(t){return e.mSceneOffsetManager||(e.mSceneOffsetManager=t,e.onOffsetManagerSubject.next(t),e.onOffsetManagerSubject.complete()),t}),(function(){!e.mSceneOffsetManager&&e.onOffsetManagerSubject&&e.onOffsetManagerSubject.error("Failed to get offset manager")}))}})}},{key:"playRotation",value:function(e,t,n){var r=this.mSceneOffsetManager.getOffsetRotation(e);if(r)if(n<=0)this.mSceneOffsetManager.setOffsetRotation(e,t);else{var i=new _object_animation__WEBPACK_IMPORTED_MODULE_22__.X(r,r.clone(),t,n,_object_animation__WEBPACK_IMPORTED_MODULE_22__.c.Linear,0);this.mSceneOffsetManager.setOffsetRotationAnimation(e,i)}else _services_syslog_service__WEBPACK_IMPORTED_MODULE_18__.UX.error("Offset rotation id not found:",e)}},{key:"onHandleInPort",value:function(e){var t,n,r,i,a,o,s,u,c=this,l=Number(this.getMetadata().value_offset),h=null!==(t=this.getMetadata().value_speed)&&void 0!==t?t:0,f=null!==(n=this.getMetadata().value_vec_x)&&void 0!==n?n:0,m=null!==(r=this.getMetadata().value_vec_y)&&void 0!==r?r:0,p=null!==(i=this.getMetadata().value_vec_z)&&void 0!==i?i:0;if(!Number.isFinite(l))return[];switch(null!==(a=e.data.attribute_type)&&void 0!==a?a:e.type){case"operable_numbers_input":case"text_to_image":case"text_input":u=null!==(o=e.data.attribute_value_name)&&void 0!==o?o:null;break;default:u=null!==(s=e.data.value)&&void 0!==s?s:null}var d=(new _maths_quaternion__WEBPACK_IMPORTED_MODULE_19__.P).setFromEuler(new _maths_euler__WEBPACK_IMPORTED_MODULE_20__.O((0,_maths_math_utils__WEBPACK_IMPORTED_MODULE_21__.pu)(this.resolveInputValue(f,u)),(0,_maths_math_utils__WEBPACK_IMPORTED_MODULE_21__.pu)(this.resolveInputValue(m,u)),(0,_maths_math_utils__WEBPACK_IMPORTED_MODULE_21__.pu)(this.resolveInputValue(p,u))));return this.mSceneOffsetManager?(this.playRotation(l,d,h),[]):new Promise((function(e,t){c.onOffsetManagerSubject.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_36__.$)()).subscribe({next:function(){c.playRotation(l,d,h),e([])},error:function(e){t(e)}})}))}},{key:"resolveInputValue",value:function resolveInputValue(aInputValue,aReplaceValue){if("number"==typeof aInputValue||(0,_engine_utils_variables_class__WEBPACK_IMPORTED_MODULE_28__.kf)(aInputValue))return Number(aInputValue);if(null!==aInputValue&&(0,_engine_utils_variables_class__WEBPACK_IMPORTED_MODULE_28__.kf)(aReplaceValue))for(;aInputValue.indexOf("{value}")>=0;)aInputValue=aInputValue.replace("{value}","".concat(aReplaceValue));if(null!==aInputValue&&/^([\d()+-.*><=\/%!:\s?])+$/.test(aInputValue))try{return Number(eval(aInputValue))}catch(e){_services_syslog_service__WEBPACK_IMPORTED_MODULE_18__.UX.error("Unable to process rotate offset rule:",e)}return Number(aInputValue)}}])}(_core_process_object__WEBPACK_IMPORTED_MODULE_17__.Z)},1106:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{V:function(){return ActionSetOffsetProcess}});var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(60825),core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0__),_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(80296),_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(23029),_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(92901),_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(50388),_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(53954),_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(85501),_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(64467),core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(28706),core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(44114),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(54554),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(2892),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_number_is_finite_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(25428),core_js_modules_es_number_is_finite_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_number_is_finite_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(26099),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(3362),core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(27495),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(90906),core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(25440),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_esnext_async_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(9920),core_js_modules_esnext_async_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_esnext_async_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(98992),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(3949),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_13__),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(23500),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14__),_core_process_object__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(5148),_maths_vector3__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(47928),rxjs__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(27291),rxjs_operators__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(67791),rxjs_operators__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__(99335),_object_animation__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(1208),_services_syslog_service__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(63805),_utils_variables_class__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(74461),_scenegraph_product_node__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(48283),_application_modules__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(41840),_scenegraph_reference_product_node__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(62411),_communication_events_editor_subscription_event__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(94273),_enums_editor_subscription_types_enum__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(33153);function _callSuper(e,t,n){return t=(0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_15__.A)(t),(0,_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_16__.A)(e,_isNativeReflectConstruct()?Reflect.construct(t,n||[],(0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_15__.A)(e).constructor):t.apply(e,n))}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}var ActionSetOffsetProcess=function(_ProcessObject){function ActionSetOffsetProcess(){var e;(0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_27__.A)(this,ActionSetOffsetProcess);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e=_callSuper(this,ActionSetOffsetProcess,[].concat(n)),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_28__.A)(e,"onOffsetManagerSubject",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_28__.A)(e,"mSceneOffsetManager",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_28__.A)(e,"mProductSceneObjectId",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_28__.A)(e,"mProductNode",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_28__.A)(e,"mDestroyed$",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_28__.A)(e,"mSubscriptions",[]),e}return(0,_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_29__.A)(ActionSetOffsetProcess,_ProcessObject),(0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_30__.A)(ActionSetOffsetProcess,[{key:"onInit",value:function(){var e,t=this;this.onOffsetManagerSubject=new rxjs__WEBPACK_IMPORTED_MODULE_31__.B,this.mDestroyed$=new rxjs__WEBPACK_IMPORTED_MODULE_31__.B,this.mProductSceneObjectId=null!==(e=this.getMetadata().value_product)&&void 0!==e?e:null,this.mSubscriptions.push(_application_modules__WEBPACK_IMPORTED_MODULE_23__.K.eventBus().subscribe(_communication_events_editor_subscription_event__WEBPACK_IMPORTED_MODULE_25__.r.getTopicName(_enums_editor_subscription_types_enum__WEBPACK_IMPORTED_MODULE_26__.E.ProductFinishedLoading),(function(){t.mProductNode||t.findAndSubscribeToProduct()}))),this.findAndSubscribeToProduct()}},{key:"onDestroy",value:function(){this.mDestroyed$&&(this.mDestroyed$.next(),this.mDestroyed$.complete(),delete this.mDestroyed$),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mProductNode&&delete this.mProductNode,this.onOffsetManagerSubject&&(this.onOffsetManagerSubject.error("Destroyed"),delete this.onOffsetManagerSubject)}},{key:"findAndSubscribeToProduct",value:function(){var e=this;if(this.mProductSceneObjectId){var t=_application_modules__WEBPACK_IMPORTED_MODULE_23__.K.sceneManager().findNodesOfType(_scenegraph_reference_product_node__WEBPACK_IMPORTED_MODULE_24__.t.TypeRTTI,(function(t){return t.getSceneObjectId()===e.mProductSceneObjectId})),n=_application_modules__WEBPACK_IMPORTED_MODULE_23__.K.sceneManager().findNodesOfType(_scenegraph_product_node__WEBPACK_IMPORTED_MODULE_22__.i.TypeRTTI,(function(t){return t.getSceneObjectId()===e.mProductSceneObjectId}));if(n.length>0){var r=(0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_32__.A)(n,1);this.mProductNode=r[0]}else if(t.length>0){var i=t[0].getChildren(),a=(0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_32__.A)(i,1);this.mProductNode=a[0]}}else this.mProductNode=this.getProcessManager().getProductNode();this.mProductNode&&this.mProductNode.onConfigurableNodeReady.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_33__.Q)(this.mDestroyed$)).subscribe({next:function(t){t.resolveSceneOffsetManager().then((function(t){return e.mSceneOffsetManager||(e.mSceneOffsetManager=t,e.onOffsetManagerSubject.next(t),e.onOffsetManagerSubject.complete()),t}),(function(){!e.mSceneOffsetManager&&e.onOffsetManagerSubject&&e.onOffsetManagerSubject.error("Failed to get offset manager")}))}})}},{key:"playMovement",value:function(e,t,n,r){var i=this.mSceneOffsetManager.getOffsetVector(e,t);if(i)if(r<=0)this.mSceneOffsetManager.setOffset(e,t,n);else{var a=new _object_animation__WEBPACK_IMPORTED_MODULE_19__.X(i,i.clone(),n,r,_object_animation__WEBPACK_IMPORTED_MODULE_19__.c.Linear,0);this.mSceneOffsetManager.setOffsetAnimation(e,t,a)}else _services_syslog_service__WEBPACK_IMPORTED_MODULE_20__.UX.error("Offset id not found:",e,t)}},{key:"onHandleInPort",value:function(e){var t,n,r,i,a,o,s,u,c,l=this,h=Number(this.getMetadata().value_offset),f=null!==(t=this.getMetadata().value_speed)&&void 0!==t?t:0,m=null!==(n=this.getMetadata().value_level)&&void 0!==n?n:0,p=null!==(r=this.getMetadata().value_vec_x)&&void 0!==r?r:0,d=null!==(i=this.getMetadata().value_vec_y)&&void 0!==i?i:0,v=null!==(a=this.getMetadata().value_vec_z)&&void 0!==a?a:0;if(!Number.isFinite(h))return[];switch(null!==(o=e.data.attribute_type)&&void 0!==o?o:e.type){case"operable_numbers_input":case"text_to_image":case"text_input":c=null!==(s=e.data.attribute_value_name)&&void 0!==s?s:null;break;default:c=null!==(u=e.data.value)&&void 0!==u?u:null}var y=this.resolveInputValue(p,c),g=this.resolveInputValue(d,c),b=this.resolveInputValue(v,c),A=new _maths_vector3__WEBPACK_IMPORTED_MODULE_18__.P(y,g,b);return this.mSceneOffsetManager?(this.playMovement(h,m,A,f),[]):new Promise((function(e,t){l.onOffsetManagerSubject.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_34__.$)()).subscribe({next:function(){l.playMovement(h,m,A,f),e([])},error:function(e){t(e)}})}))}},{key:"resolveInputValue",value:function resolveInputValue(aInputValue,aReplaceValue){if("number"==typeof aInputValue||(0,_utils_variables_class__WEBPACK_IMPORTED_MODULE_21__.kf)(aInputValue))return Number(aInputValue);if(null!==aInputValue&&(0,_utils_variables_class__WEBPACK_IMPORTED_MODULE_21__.kf)(aReplaceValue))for(;aInputValue.indexOf("{value}")>=0;)aInputValue=aInputValue.replace("{value}","".concat(aReplaceValue));if(null!==aInputValue&&/^([\d()+-.*><=\/%!:\s?])+$/.test(aInputValue))try{return Number(eval(aInputValue))}catch(e){_services_syslog_service__WEBPACK_IMPORTED_MODULE_20__.UX.error("Unable to process offset rule:",e)}return Number(aInputValue)}}])}(_core_process_object__WEBPACK_IMPORTED_MODULE_17__.Z)},32203:function(e,t,n){"use strict";n.d(t,{e:function(){return o}});var r=n(92901),i=n(23029),a=n(64467),o=(0,r.A)((function e(t,n,r,o){(0,i.A)(this,e),(0,a.A)(this,"client",void 0),(0,a.A)(this,"outPort",void 0),(0,a.A)(this,"target",void 0),(0,a.A)(this,"inPort",void 0),this.client=t,this.outPort=n,this.target=r,this.inPort=o}))},98843:function(e,t,n){"use strict";n.d(t,{i:function(){return o}});var r=n(92901),i=n(23029),a=n(64467),o=(0,r.A)((function e(t,n,r,o,s,u){(0,i.A)(this,e),(0,a.A)(this,"type",void 0),(0,a.A)(this,"data",void 0),(0,a.A)(this,"client",void 0),(0,a.A)(this,"outPort",void 0),(0,a.A)(this,"target",void 0),(0,a.A)(this,"inPort",void 0),this.type=t,this.data=n,this.client=r,this.outPort=o,this.target=s,this.inPort=u}))},5148:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=(n(48980),n(62062),n(44114),n(54554),n(79432),n(26099),n(3362),n(9920),n(41393),n(98992),n(3949),n(81454),n(23500),n(32203)),l=n(98843),h=n(28001),f=n(44889);function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(m=function(){return!!e})()}var p=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,m()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"mProcessManager",void 0),(0,u.A)(s,"mPid",void 0),(0,u.A)(s,"mMeta",void 0),(0,u.A)(s,"mInPorts",{}),(0,u.A)(s,"mOutPorts",{}),s.mPid=e,s.mMeta=i,s.mProcessManager=n,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getPid",value:function(){return this.mPid}},{key:"getMetadata",value:function(){return this.mMeta}},{key:"getProcessManager",value:function(){return this.mProcessManager}},{key:"attachInPort",value:function(e,t,n){return this.mInPorts[e]||(this.mInPorts[e]=new Array),this.mInPorts[e].push(new c.e(t,n,this,e)),this.mInPorts[e].length-1}},{key:"detachInPort",value:function(e,t,n){if(!this.mInPorts[e])return null;var r=this.mInPorts[e].findIndex((function(e){return e.client.getObjectId()===t.getObjectId()&&n===e.outPort}));return r>=0?this.detachInPortAtIndex(e,r):null}},{key:"detachInPortAtIndex",value:function(e,t){if(!this.mInPorts[e])return null;var n=this.mInPorts[e].splice(t,1);return n.length>0?n[0].client:null}},{key:"attachOutPort",value:function(e,t,n){return this.mOutPorts[e]||(this.mOutPorts[e]=new Array),this.mOutPorts[e].push(new c.e(this,e,t,n)),this.mOutPorts[e].length-1}},{key:"detachOutPort",value:function(e,t,n){if(!this.mOutPorts[e])return null;var r=this.mOutPorts[e].findIndex((function(e){return e.target.getObjectId()===t.getObjectId()&&n===e.inPort}));return r>=0?this.detachOutPortAtIndex(e,r):null}},{key:"detachOutPortAtIndex",value:function(e,t){if(!this.mOutPorts[e])return null;var n=this.mOutPorts[e].splice(t,1);return n.length>0?n[0].target:null}},{key:"getInPorts",value:function(){return Object.keys(this.mInPorts)}},{key:"getInPortProcesses",value:function(e){return this.getInConnections(e).map((function(e){return e.client}))}},{key:"getInConnections",value:function(e){return this.mInPorts[e]?this.mInPorts[e]:[]}},{key:"getOutPorts",value:function(){return Object.keys(this.mOutPorts)}},{key:"getOutPortProcesses",value:function(e){return this.getOutPortConnections(e).map((function(e){return e.target}))}},{key:"getOutPortConnections",value:function(e){return this.mOutPorts[e]?this.mOutPorts[e]:[]}},{key:"feedInPort",value:function(e){var t=this;Promise.resolve(this.onHandleInPort(e)).then((function(e){e.forEach((function(e){t.getOutPortConnections(e.outPort).forEach((function(t){t.target.feedInPort(new l.i(e.type,e.data,e.client,e.outPort,t.target,t.inPort))}))}))}),(function(){}))}},{key:"onInit",value:function(){}},{key:"onDestroy",value:function(){}}])}(h.b);(0,u.A)(p,"TypeRTTI",new f.O("ProcessObject",h.b.TypeRTTI))},12553:function(e,t,n){"use strict";n.d(t,{_:function(){return x}});n(60825);var r=n(10467),i=n(80296),a=n(23029),o=n(92901),s=n(50388),u=n(53954),c=n(90991),l=n(85501),h=n(64467),f=n(54756),m=n.n(f),p=(n(44114),n(54554),n(69085),n(79432),n(26099),n(3362),n(9920),n(98992),n(3949),n(58335),n(23500),n(44889)),d=n(8870),v=n(38975),y=n(63805),g=n(18910),b=n(41840),A=n(27291),_=n(30700),M=n(73704),k=n(70192);function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(w=function(){return!!e})()}function T(e,t,n,r){var i=(0,c.A)((0,u.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var x=function(e){function t(e){var n,r,i,o;return(0,a.A)(this,t),r=this,i=t,o=[e],i=(0,u.A)(i),n=(0,s.A)(r,w()?Reflect.construct(i,o||[],(0,u.A)(r).constructor):i.apply(r,o)),(0,h.A)(n,"mPreconfiguredOptions",void 0),(0,h.A)(n,"mMeshList",void 0),(0,h.A)(n,"mFirstBuild",!0),(0,h.A)(n,"mSubscriptions",void 0),(0,h.A)(n,"mUnit","M"),(0,h.A)(n,"mWorldRatio",1),(0,h.A)(n,"onMeshListUpdate",new A.B),(0,h.A)(n,"onConfigurableNodeUpdated",new A.B),n.mSubscriptions=[],n.mName="ConfigurableNode",n}return(0,l.A)(t,e),(0,o.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"unit":return this.mUnit=n,!0;case"world_ratio":return this.mWorldRatio=n,!0;case"collider":if(!r)break;if(!b.K.settingsManager().getSettings().getSceneSettings().physics.enabled)break;var a="string"==typeof n?JSON.parse(n):n,o=this.getComponents(k.f.TypeRTTI);if((0,i.A)(o,1)[0])break;return this.addColliderWithParsedData(a),!0}return T(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=T(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"unit":return this.mUnit;case"world_ratio":return this.mWorldRatio}return null}},{key:"_setPreconfiguredOptions",value:function(e){this.mPreconfiguredOptions=e}},{key:"_getPreconfiguredOptions",value:function(){return this.mPreconfiguredOptions}},{key:"_setFirstBuild",value:function(e){this.mFirstBuild=e}},{key:"_isFirstBuild",value:function(){return this.mFirstBuild}},{key:"onAttached",value:function(e){var n=this;T(t,"onAttached",this,3)([e]);var r=this.findParentOfTypeName("ProductNode");this.mSubscriptions.push(b.K.messenger().listen(g.A_.TypeRTTI,(function(e){n.dispatchMessageToComponents(e)}),String(r.getSceneObjectId())))}},{key:"onDetached",value:function(e){T(t,"onDetached",this,3)([e]),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"resolveSceneOffsetManager",value:(n=(0,r.A)(m().mark((function e(){var t=this;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.getComponent("offsetManager").load().pipe((0,v.s)(1)).subscribe({next:function(t){e(t)},error:function(e){y.UX.error(e),n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"setMeshList",value:function(e){this.mMeshList=e,this.onMeshListUpdate.next()}},{key:"getMeshList",value:function(){return this.mMeshList}},{key:"onBeforeSerializeChildren",value:function(){return!1}},{key:"serialize",value:function(e){var n=Object.assign(T(t,"serialize",this,3)([e]),{type:"configurable"});if(n.properties=Object.assign(n.properties,{unit:this.mUnit,world_ratio:this.mWorldRatio}),this.shouldSerializeColliderData()){var r=this.getComponents(k.f.TypeRTTI),a=(0,i.A)(r,1)[0];a&&(n.properties.collider=a.serialize())}return n}},{key:"notifyMaterialOverwrite",value:function(e,t){this.dispatchMessageToComponents(new g.A_(e,t))}},{key:"shouldSerializeColliderData",value:function(){var e=this.findParentOfTypeName("ProductNode"),t=this.findParentOfTypeName("ReferenceProductNode");return!!e&&(!t&&this.getSceneObjectId()>=0)}},{key:"addColliderWithParsedData",value:function(e){if(e){var t=this.getParent(),n=-1===t.getSceneObjectId();if(!!!t.findParentOfTypeName("ReferenceProductNode")){var r=n?this:t;switch(r.removeComponents(k.f.TypeRTTI),e.type){case"sphere":var i=new _.X;i.parse(e),r.addComponent(i);break;case"box":var a=new M.X;a.parse(e),r.addComponent(a)}}}}},{key:"_updateBoundingBox",value:function(e){T(t,"_updateBoundingBox",this,3)([e]);var n=this.getParent();n&&n._updateBoundingBox(this.getBoundingBox(!0))}}]);var n}(d.Z);(0,h.A)(x,"TypeRTTI",new p.O("ConfigurableNode",d.Z.TypeRTTI))},85690:function(e,t,n){"use strict";n.d(t,{F:function(){return T},O:function(){return r}});n(60825);var r,i=n(23029),a=n(92901),o=n(50388),s=n(53954),u=n(90991),c=n(85501),l=n(64467),h=(n(28706),n(44114),n(54554),n(25428),n(26099),n(9920),n(98992),n(3949),n(23500),n(44889)),f=n(60865),m=n(3834),p=n(47185),d=n(11454),v=n(70123),y=n(39485),g=n(63805),b=n(41840),A=n(94273),_=n(33153),M=n(22098);function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(k=function(){return!!e})()}function w(e,t,n,r){var i=(0,u.A)((0,s.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}!function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(r||(r={}));var T=function(e){function t(e,n,a,u){var c,h,f,p;return(0,i.A)(this,t),h=this,f=t,p=[e],f=(0,s.A)(f),c=(0,o.A)(h,k()?Reflect.construct(f,p||[],(0,s.A)(h).constructor):f.apply(h,p)),(0,l.A)(c,"renderTechnique",m._1.mesh),(0,l.A)(c,"mGeometrySource",void 0),(0,l.A)(c,"mMaterialId",void 0),(0,l.A)(c,"mGeometryHandle",void 0),(0,l.A)(c,"mMaterialHandle",void 0),(0,l.A)(c,"mDrawMode",r.TRIANGLES),(0,l.A)(c,"mSharedKeyOverwrite",{}),(0,l.A)(c,"mOnAttachSubscriptions",[]),c.mName="MeshEntity",void 0!==n&&(n instanceof v.L?c.setGeometry(n,u):"string"==typeof n&&c.setGeometryBySource(n,u)),void 0!==a&&(a instanceof y.im?c.setMaterial(a,u):Number.isFinite(a)&&c.setMaterialById(a,u)),c}return(0,c.A)(t,e),(0,a.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"setGeometryBySource",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.mGeometrySource=e,this.disposeGeometry(n);var r=p.J.getManager(p.n.GeometryManager);this.mGeometryHandle=r.makeResource("".concat(d.w.cacheUrl).concat(this.mGeometrySource),void 0,t),this.markNeedsRenderUpdate()}},{key:"setGeometry",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];delete this.mGeometrySource,this.disposeGeometry(n);var r=p.J.getManager(p.n.GeometryManager);this.mGeometryHandle=r.makeResourceRaw(e,t),this.markNeedsRenderUpdate()}},{key:"getGeometrySource",value:function(){return this.mGeometrySource}},{key:"getMaterialId",value:function(){return this.mMaterialId}},{key:"setMaterialById",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=p.J.getManager(p.n.MaterialManager);if(e in this.mSharedKeyOverwrite&&(t=this.mSharedKeyOverwrite[e]),this.mMaterialId!==e||!this.mMaterialHandle||!r.validatePoolKey(this.mMaterialHandle,t)){if(this.unsetMaterial(n),this.mMaterialId=e,this.mMaterialId<0){var i=b.K.renderer().getRenderEngine().createMaterialBasic("default-material");i.setDiffuseColor(M.v.Magenta()),this.mMaterialHandle=r.makeResourceRaw(i,t)}else this.mMaterialHandle=r.makeResource(e,void 0,t);this.markNeedsRenderUpdate()}}},{key:"setMaterial",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.getUniqueId(),i=p.J.getManager(p.n.MaterialManager);r in this.mSharedKeyOverwrite&&(t=this.mSharedKeyOverwrite[r]),this.mMaterialId===r&&this.mMaterialHandle&&i.validatePoolKey(this.mMaterialHandle,t)||(this.unsetMaterial(n),this.mMaterialId=r,this.mMaterialHandle=i.makeResourceRaw(e,t),this.markNeedsRenderUpdate())}},{key:"unsetMaterial",value:function(e){if(delete this.mMaterialId,this.mMaterialHandle){var t=p.J.getManager(p.n.MaterialManager);try{t.disposeResource(this.mMaterialHandle,e)}catch(e){g.UX.error("MeshEntity: Unable to dispose material.",e)}finally{delete this.mMaterialHandle,this.markNeedsRenderUpdate()}}}},{key:"disposeGeometry",value:function(e){if(this.mGeometryHandle){var t=p.J.getManager(p.n.GeometryManager);try{t.disposeResource(this.mGeometryHandle,e)}catch(e){g.UX.error("MeshEntity: Unable to dispose geometry.",e)}finally{delete this.mGeometryHandle}}}},{key:"getGeometry",value:function(){return this.mGeometryHandle}},{key:"getMaterial",value:function(){return this.mMaterialHandle}},{key:"drawMode",get:function(){return this.mDrawMode},set:function(e){this.mDrawMode=e}},{key:"onAttached",value:function(e){w(t,"onAttached",this,3)([e]),this.subscribeToMaterialChanges()}},{key:"onDetached",value:function(e){w(t,"onDetached",this,3)([e]),this.mOnAttachSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"destroy",value:function(e,n){this.disposeGeometry(e),this.unsetMaterial(e),w(t,"destroy",this,3)([e,n])}},{key:"subscribeToMaterialChanges",value:function(){var e=this,t=b.K.eventBus().subscribe(A.r.getTopicName(_.E.MaterialUpdated),(function(t){var n,r;null!==(n=t.getData())&&void 0!==n&&n.material_id&&e.mMaterialId===(null===(r=t.getData())||void 0===r?void 0:r.material_id)&&e.markNeedsRenderUpdate()}));this.mOnAttachSubscriptions.push(t)}},{key:"setMaterialOverwrite",value:function(e,t){void 0!==t&&(this.mSharedKeyOverwrite[e]=t),this.mMaterialId===e&&this.setMaterialById(e,t)}}])}(f.a);(0,l.A)(T,"TypeRTTI",new h.O("MeshEntity",f.a.TypeRTTI))},48283:function(e,t,n){"use strict";n.d(t,{i:function(){return V}});n(60825);var r=n(10467),i=n(80296),a=n(23029),o=n(92901),s=n(50388),u=n(53954),c=n(90991),l=n(85501),h=n(64467),f=n(54756),m=n.n(f),p=(n(2008),n(48980),n(44114),n(54554),n(62010),n(2892),n(69085),n(79432),n(26099),n(3362),n(17333),n(9920),n(98992),n(54520),n(3949),n(58335),n(23500),n(8870)),d=n(12553),v=n(18910),y=n(47928),g=n(73050),b=n(83629),A=n(41840),_=n(94273),M=n(33153),k=n(44889),w=n(97869),T=n(63805),x=n(27291),S=n(39741),C=n(37968),E=n(31731),R=n(74461),I=n(70192),O=n(17450),D=n(59099),P=n(90593),B=n(16126),F=n(81160),N=n(38975),L=n(1005);function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(j=function(){return!!e})()}function U(e,t,n,r){var i=(0,c.A)((0,u.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var V=function(e){function t(e,n){var r,i,o,c,l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],f=arguments.length>3?arguments[3]:void 0;return(0,a.A)(this,t),i=this,o=t,c=[e],o=(0,u.A)(o),r=(0,s.A)(i,j()?Reflect.construct(o,c||[],(0,u.A)(i).constructor):o.apply(i,c)),(0,h.A)(r,"mHashHelper",new b.Q),(0,h.A)(r,"mProductId",void 0),(0,h.A)(r,"mProductIdChanged",!1),(0,h.A)(r,"mProductSku",""),(0,h.A)(r,"mIsBundled",void 0),(0,h.A)(r,"mTemporaryUId",void 0),(0,h.A)(r,"mPreconfiguredOptions",void 0),(0,h.A)(r,"mEventBrokerSubscriptions",void 0),(0,h.A)(r,"mSharedKeyOverwrite",{}),(0,h.A)(r,"mFirstBuild",!0),(0,h.A)(r,"mSubscriptions",[]),(0,h.A)(r,"mUpdateArticleEvent",new x.B),(0,h.A)(r,"onConfigurableNodeReady",new S.m(1)),(0,h.A)(r,"mFuncLoaderPlaceHolder",void 0),(0,h.A)(r,"mClippingPlane",void 0),(0,h.A)(r,"mClippingPlaneUuid",void 0),(0,h.A)(r,"mArticlesBusyStream",new S.m),r.mName="Product Node",r.mProductId=null!=n?n:-1,r.mIsBundled=l,r.mPreconfiguredOptions=f,r.mEventBrokerSubscriptions=[],r}return(0,l.A)(t,e),(0,o.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"onAttached",value:function(e){var n=this;U(t,"onAttached",this,3)([e]);var r=A.K.sceneManager().createObject("configurable");r.setValue("name","Configurable"),r.setValue("object_lock",!0),this._attachChildAtIndex(r,0),this.mEventBrokerSubscriptions.push(A.K.messenger().listen(v.A_.TypeRTTI,(function(e){n.mSharedKeyOverwrite[e.materialModelId]=e.sharedKey,n.dispatchMessageToComponents(e)}),String(this.getSceneObjectId()))),this.mArticlesBusyStream=new S.m(1),this.mUpdateArticleEvent.pipe((0,D.M)((function(e){return n.mArticlesBusyStream.next(!0),e})),(0,O.L)((function(e){var t=e.articleListManager,n=e.models;return(0,C.H)(t.syncObjectModels(n))}))).subscribe({next:function(){n.mArticlesBusyStream.next(!1)},error:function(e){T.UX.warn("Failed to update article (pipeline):",e),n.mArticlesBusyStream.next(!1)}})}},{key:"onDetached",value:function(e){U(t,"onDetached",this,3)([e]),this.mArticlesBusyStream&&(this.mArticlesBusyStream.complete(),delete this.mArticlesBusyStream),this.detachClippingPlaneFromComponent(),this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mSubscriptions.splice(0).forEach((function(e){return e.subscription.unsubscribe()}))}},{key:"onBeforeParseChildren",value:function(){return!1}},{key:"onBeforeSerializeChildren",value:function(){return!1}},{key:"onBeforeParseCreate",value:function(e){return!("product"===e&&this.mIsBundled)}},{key:"addComponent",value:function(e){var n=U(t,"addComponent",this,3)([e]);if(n){var r;if("articleListManager"===e.getComponentName())r=e.onModelsChanged.subscribe(this.handleArticlesChanged.bind(this));void 0!==r&&this.mSubscriptions.push({name:e.getComponentName(),subscription:r})}return n}},{key:"removeComponent",value:function(e){var n=U(t,"removeComponent",this,3)([e]);if(n){var r=this.mSubscriptions.findIndex((function(t){return t.name===e}));r>=0&&this.mSubscriptions.splice(r,1).forEach((function(e){return e.subscription.unsubscribe()}))}return n}},{key:"serialize",value:function(e,n){var r=Object.assign(U(t,"serialize",this,3)([e,n]),{type:"product"});if(r.properties=Object.assign(r.properties,{product_id:this.mProductId}),this.shouldSerializeColliderData()){var a=this.getComponents(I.f.TypeRTTI),o=(0,i.A)(a,1)[0];o&&(r.properties.collider=o.serialize())}return r}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"product_id":return this.mProductId=Number(n),this.mProductIdChanged=!0,this.dispatchMessageToComponents(new v.fV("product_id",this.mProductId)),!0;case"temporary_uid":return this.mTemporaryUId=n,!0;case"placeHolder":case"place_holder":return this.mFuncLoaderPlaceHolder=n,!0;case"clipping_plane":if(n)if("string"==typeof n)try{var i=JSON.parse(n);this.mClippingPlane=(new g.Z).setFromNormalAndCoplanarPoint((new y.P).fromArray(i.normal),(new y.P).fromArray(i.point))}catch(e){T.UX.warn("Failed to parse the set clipping value:",n),delete this.mClippingPlane}else"function"==typeof n.clone&&(this.mClippingPlane=n.clone());else delete this.mClippingPlane;return!0;case"collider":if(!r)break;if(!A.K.settingsManager().getSettings().getSceneSettings().physics.enabled)break;var a="string"==typeof n?JSON.parse(n):n;return this.getChildrenDerivedTypeOf(d._.TypeRTTI)[0].addColliderWithParsedData(a),!0}return U(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=U(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"product_id":return this.mProductId;case"temporary_uid":return this.mTemporaryUId;case"place_holder":case"placeHolderFunction":return this.mFuncLoaderPlaceHolder;case"clipping_plane":return this.mClippingPlane}return null}},{key:"isBundled",value:function(){return this.mIsBundled}},{key:"handleArticlesChanged",value:function(e){A.K.eventBus().dispatch(new _.r(M.E.ProductArticlesChanged,e))}},{key:"_updateArticles",value:(n=(0,r.A)(m().mark((function e(t){var n;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getComponent("articleListManager"),this.mUpdateArticleEvent.next({models:t.models,articleListManager:n}),e.abrupt("return",Promise.resolve());case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_updateHierarchy",value:function(e){var n=this;try{var r;T.UX.print("Product node handle build ready!"),this.mHashHelper.newHash();var i=this.resolveSceneHierarchy(e.nodes);T.UX.print("resolved hierarchy: ",i);var a={children:i=0===i.length?this.createDefaultNodes():this.checkForDefaultView(i)};this.findParentOfType(t.TypeRTTI)||(a.name="Product Node"),this.parse(a,this.mHashHelper.getHash(),!0);var o=this.getComponent("catalogueMeta").getCatalogueMeta();this.name=o.name,this.mProductSku=null!==(r=o.sku)&&void 0!==r?r:"";var s=this.getChildrenDerivedTypeOf(d._.TypeRTTI)[0];if(this.mFirstBuild&&(this.mFirstBuild=!1,Object.keys(this.mSharedKeyOverwrite).forEach((function(e){var t=Number(e);s.notifyMaterialOverwrite(t,n.mSharedKeyOverwrite[t])}))),this.mPreconfiguredOptions&&s._setPreconfiguredOptions(this.mPreconfiguredOptions),s.setMeshList(e.batches),this.onConfigurableNodeReady.next(s),!A.K.sceneManager().getActiveView()){var u=this.getChildrenDerivedOfTypeName("ViewNode");u.length>0&&A.K.sceneManager().setActiveView(u[0])}}catch(e){T.UX.error("Product node failed to read scene:",e)}}},{key:"resolveSceneHierarchy",value:function(e){var t=A.K.sceneManager().getPersistPool(),n=t.getNodeNamespace(this);return T.UX.print("Product node namespace:",n),A.K.sceneManager().getPersistPool().getNewNodes(n).forEach((function(t){e.push(t.serialize(!1))})),(e=e.filter((function(e){return!t.isNodeDeleted(n,e.scene_object_id)}))).forEach((function(e){var r=t.isNodeMoved(n,e.scene_object_id);null!==r&&(e.parent_id=-1===r?null:r)})),this.generateHierarchy(e)}},{key:"generateHierarchy",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=[];return e.forEach((function(i){var a;(i.parent_id===n||!n&&i.parent_id===t.getSceneObjectId())&&(i.children=t.generateHierarchy(e,null!==(a=i.scene_object_id)&&void 0!==a?a:null),r.push(i))})),r}},{key:"checkForDefaultView",value:function(e){var t=this,n=!1,r=[];for(e.forEach((function(e){return r.push(e)}));!n&&r.length>0;){var i=r.shift();"view"===i.type?n=!0:Array.isArray(i.children)&&i.children.forEach((function(e){return r.push(e)}))}if(!n){T.UX.print("create default view");var a=-++w.p.ObjectIdCount,o={type:"view",name:"Default",scene_object_id:a,children:[]},s=[o];return e.forEach((function(e){"configurable"!==e.type&&(!(0,R.kf)(e.parent_id)||e.parent_id<0)?(e.parent_id=a,o.children.push(e),A.K.sceneManager().getPersistPool().setNodeMoved(t,e.scene_object_id,a)):s.push(e)})),s}return e}},{key:"createDefaultNodes",value:function(){return[{type:"view",name:"Default",children:[]}]}},{key:"detachClippingPlaneFromComponent",value:function(){this.mClippingPlaneUuid&&(this.getComponent("clippingController").removeClippingPlane(this.mClippingPlaneUuid),delete this.mClippingPlaneUuid)}},{key:"updatePlane",value:function(){if(this.mClippingPlane){var e=this.getComponent("clippingController");this.mClippingPlaneUuid||(this.mClippingPlaneUuid=e.addClippingPlane(new g.Z)),e.setClippingPlane(this.mClippingPlaneUuid,this.mClippingPlane)}else this.detachClippingPlaneFromComponent()}},{key:"onBeforeSceneUpdate",value:function(e){U(t,"onBeforeSceneUpdate",this,3)([e]),this.updatePlane()}},{key:"productId",get:function(){return this.mProductId}},{key:"productSku",get:function(){return this.mProductSku}},{key:"awaitArticlesFinished",value:function(){return this.mArticlesBusyStream.pipe((0,P.w)(7e3),(0,E.u)({count:1/0,delay:50}),(0,B.p)((function(e){return!e})),(0,F.T)((function(e){return!e})),(0,N.s)(1),(0,L.u)())}},{key:"shouldSerializeColliderData",value:function(){var e=!this.findParentOfType(t.TypeRTTI),n=!!this.findParentOfTypeName("ReferenceProductNode");return!e&&!n&&this.getSceneObjectId()>=0}}]);var n}(p.Z);(0,h.A)(V,"TypeRTTI",new k.O("ProductNode",p.Z.TypeRTTI))},62411:function(e,t,n){"use strict";n.d(t,{t:function(){return w}});n(60825);var r=n(80296),i=n(23029),a=n(92901),o=n(50388),s=n(53954),u=n(90991),c=n(85501),l=n(64467),h=(n(44114),n(33110),n(69085),n(79432),n(58335),n(44889)),f=n(63805),m=n(8870),p=n(79085),d=n(94695),v=n(41840),y=n(70192),g=n(30700),b=n(73704),A=n(47928),_=n(37842);function M(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(M=function(){return!!e})()}function k(e,t,n,r){var i=(0,u.A)((0,s.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var w=function(e){function t(e){var n,r,a,u;return(0,i.A)(this,t),r=this,a=t,u=[e],a=(0,s.A)(a),n=(0,o.A)(r,M()?Reflect.construct(a,u||[],(0,s.A)(r).constructor):a.apply(r,u)),(0,l.A)(n,"mFirstProductCreation",!0),n.mName="ReferenceProductNode",n}return(0,c.A)(t,e),(0,a.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"parse",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{if(this.mFirstProductCreation){this.mFirstProductCreation=!1;var i=null!=e&&e.asset_meta?JSON.parse(e.asset_meta):{},a=i.node_matrix,o=new d.k,s=new A.P(0,0,0),u=new _.P,c=new A.P(1,1,1);Array.isArray(a)&&a.length>15&&(o.set(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]),o.decompose(s,u,c),f.UX.print("Reference product: initial values:",s,u,c)),e.children=e.children||[],e.children.push({type:"product",name:"Referenced product id:".concat(i.product_id),properties:JSON.stringify({child_lock:!1,product_id:i.product_id,object_lock:!1,position_x:s.x,position_y:s.y,position_z:s.z,quaternion_x:u.x,quaternion_y:u.y,quaternion_z:u.z,quaternion_w:u.w,scale_x:c.x,scale_y:c.y,scale_z:c.z})}),f.UX.print("Reference product node (serialized):",e)}k(t,"parse",this,3)([e,n,r])}catch(e){f.UX.error("Parsing reference product failed:",e)}}},{key:"onBeforeAddNewToRenderState",value:function(e){return f.UX.print("Reference before add to render state:",e.getType().isDerivedOfTypeName("ProductNode")),!e.getType().isDerivedOfTypeName("ProductNode")}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"collider":if(!r)break;if(!v.K.settingsManager().getSettings().getSceneSettings().physics.enabled)break;var i="string"==typeof n?JSON.parse(n):n;return this.addColliderWithParsedData(i),!0}return k(t,"proxySetValue",this,3)([e,n,r])}},{key:"serialize",value:function(e){var t=Object.assign(p.i.prototype.serialize.call(this,e,!1),{type:"asset"}),n=this.getComponents(y.f.TypeRTTI),i=(0,r.A)(n,1)[0];return i&&(t.properties.collider=i.serialize()),t}},{key:"addColliderWithParsedData",value:function(e){if(e)switch(this.removeComponents(y.f.TypeRTTI),e.type){case"sphere":var t=new g.X;t.parse(e),this.addComponent(t);break;case"box":var n=new b.X;n.parse(e),this.addComponent(n)}}}])}(m.Z);(0,l.A)(w,"TypeRTTI",new h.O("ReferenceProductNode",m.Z.TypeRTTI))},60865:function(e,t,n){"use strict";n.d(t,{a:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(14393);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,c=[e],s=(0,o.A)(s),n=(0,a.A)(i,h()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"mWorldGlobalStates",[]),(0,u.A)(n,"mPickable",void 0),(0,u.A)(n,"mRenderOrder",void 0),n.mName="RenderEntity",n.mPickable=!0,n.mRenderOrder=1,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getRenderTechnique",value:function(){return this.renderTechnique}},{key:"updateWorldGlobalStates",value:function(e){this.mWorldGlobalStates=e.getCurrentGlobalStates()}},{key:"getWorldGlobalStates",value:function(){return this.mWorldGlobalStates}},{key:"onDraw",value:function(e,t){this.updateWorldGlobalStates(e),e.addDrawable(this)}},{key:"pickable",get:function(){return this.mPickable},set:function(e){this.mPickable=e}},{key:"renderOrder",get:function(){return this.mRenderOrder},set:function(e){this.mRenderOrder=e,this.markNeedsRenderUpdate()}}])}(l.S);(0,u.A)(f,"TypeRTTI",new c.O("RenderEntity",l.S.TypeRTTI))},14393:function(e,t,n){"use strict";n.d(t,{S:function(){return m}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(79085),h=n(5771);function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}var m=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,c=[e],s=(0,o.A)(s),n=(0,a.A)(i,f()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"mRenderObjectLoadState",h.U.Idle),n.mName="SceneEntity",n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"renderObjectLoadState",value:function(){return this.mRenderObjectLoadState}},{key:"setRenderObjectLoadState",value:function(e){this.mRenderObjectLoadState=e}}])}(l.i);(0,u.A)(m,"TypeRTTI",new c.O("SceneEntity",l.i.TypeRTTI))},8870:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(90991),u=n(85501),c=n(64467),l=(n(50113),n(62062),n(44114),n(34782),n(54554),n(69085),n(26099),n(3064),n(9920),n(41393),n(98992),n(72577),n(3949),n(81454),n(23500),n(79085)),h=n(63805),f=n(33153),m=n(41840),p=n(94273),d=n(44889);function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}function y(e,t,n,r){var i=(0,s.A)((0,o.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var g=function(e){function t(e){var n,i,s,u;return(0,r.A)(this,t),i=this,s=t,u=[e],s=(0,o.A)(s),n=(0,a.A)(i,v()?Reflect.construct(s,u||[],(0,o.A)(i).constructor):s.apply(i,u)),(0,c.A)(n,"mChildren",new Array),(0,c.A)(n,"mChildLock",!1),n.mName="SceneNode",n}return(0,u.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){return"child_lock"===e?(this.mChildLock=!0===n||"1"==n||"true"===n,!0):y(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=y(t,"proxyGetValue",this,3)([e]);return null!==n?n:"child_lock"===e?this.mChildLock:null}},{key:"parse",value:function(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(y(t,"parse",this,3)([e,n,i]),!0===i||!this.mChildLock&&this.onBeforeParseChildren()){Array.isArray(e.children)&&e.children.forEach((function(e){var t=r.mChildren.find((function(t){return t.getSceneObjectId()==e.scene_object_id}));if(t)t.parse(e,n);else if(r.onBeforeParseCreate(e.type)){var i=m.K.sceneManager();if("configurable"===e.type){var a=r.getChildrenDerivedOfTypeName("ConfigurableNode")[0];void 0!==e.scene_object_id&&null!==e.scene_object_id&&a.setSceneObjectId(e.scene_object_id),a.parse(e,n)}else{var o=i.createObject(e.type,e.scene_object_id);if(o){var s=o.getSceneObjectId()<0&&r.onBeforeAddNewToRenderState(o);i.addNode(o,r,s),o.parse(e,n)}else h.UX.warn("unknown node in parse: ",e.type)}}}));for(var a=this.mChildren.length-1;a>=0;a--){var o=this.mChildren[a];o.getSceneObjectId()>=0&&!o.isInSyncWithHash(n)&&m.K.sceneManager().removeNode(o,!1,!0)}}}},{key:"serialize",value:function(e,n){var r=Object.assign(y(t,"serialize",this,3)([e,n]),{type:"node"});return r.properties=Object.assign(r.properties,{child_lock:this.mChildLock}),r.children=[],!0===n||!this.mChildLock&&this.onBeforeSerializeChildren()?(this.mChildren.forEach((function(t){r.children.push(t.serialize(e))})),r):r}},{key:"_attachChild",value:function(e){return this._attachChildAtIndex(e,this.mChildren.length)}},{key:"_attachChildAtIndex",value:function(e,t){return this._beforeAttach(e)?(this.mChildren.splice(t,0,e),h.UX.print("attaching child:",e,this),e.setParent(this),this._afterAttach(e),e.onAttached(this),m.K.eventBus().dispatch(new p.r(f.E.SceneObjectAttached,e)),this.mChildren.indexOf(e)):-1}},{key:"_detachChild",value:function(e){return this._detachChildAtIndex(this.mChildren.indexOf(e))}},{key:"_detachChildAtIndex",value:function(e){if(!(e<0||e>=this.mChildren.length)){var t=this.mChildren[e];return h.UX.print("detaching child:",t),t.setParent(null),t.onDetached(this),m.K.eventBus().dispatch(new p.r(f.E.SceneObjectDetached,t)),this.mChildren.splice(e,1)[0]}}},{key:"_detachAllChildren",value:function(){var e=this;return this.getChildren().slice().map((function(t){return e._detachChild(t)}))}},{key:"getNumChildren",value:function(){return this.mChildren.length}},{key:"getChildAtIndex",value:function(e){return e>=0&&e<this.mChildren.length?this.mChildren[e]:void 0}},{key:"getChildren",value:function(){return this.mChildren}},{key:"getChildrenDerivedTypeOf",value:function(e){return this.getChildrenDerivedOfTypeName(e.getTypeName())}},{key:"getChildrenDerivedOfTypeName",value:function(e){var t=new Array;return this.mChildren.forEach((function(n){n.isDerivedOfTypeName(e)&&t.push(n)})),t}},{key:"_beforeAttach",value:function(e){return!0}},{key:"_afterAttach",value:function(e){}},{key:"fixedUpdate",value:function(e){y(t,"fixedUpdate",this,3)([e]),this.enabled&&this.mChildren.forEach((function(t){t.fixedUpdate(e)}))}},{key:"beforeUpdate",value:function(e){y(t,"beforeUpdate",this,3)([e]),this.enabled&&this.mChildren.forEach((function(t){t.beforeUpdate(e)}))}},{key:"afterUpdate",value:function(e){y(t,"afterUpdate",this,3)([e]),this.enabled&&this.mChildren.forEach((function(t){t.afterUpdate(e)}))}},{key:"update",value:function(e){y(t,"update",this,3)([e]),this.enabled&&this.mChildren.forEach((function(t){t.update(e)}))}},{key:"onSceneUpdate",value:function(e){var n=this;y(t,"onSceneUpdate",this,3)([e]),this.mChildren.forEach((function(e){e.layers.enableByLayer(n.mLayers)}))}},{key:"dispatchMessage",value:function(e){y(t,"dispatchMessage",this,3)([e]),this.mChildren.forEach((function(t){t.dispatchMessage(e)}))}},{key:"onDraw",value:function(e,n){y(t,"onDraw",this,3)([e,n]),this.mChildren.forEach((function(t){t.draw(e,n)}))}},{key:"onAfterDraw",value:function(e,n){y(t,"onAfterDraw",this,3)([e,n]),this.mChildren.forEach((function(t){t.afterDraw(e,n)}))}},{key:"onBeforeParseChildren",value:function(){return!0}},{key:"onBeforeParseCreate",value:function(e){return!0}},{key:"onBeforeAddNewToRenderState",value:function(e){return!0}},{key:"onBeforeSerializeChildren",value:function(){return!0}},{key:"destroy",value:function(e,n){this._detachAllChildren().forEach((function(t){t.destroy(e,n)})),y(t,"destroy",this,3)([e,n])}},{key:"setNeedsRenderUpdate",value:function(e){this.mNeedsRenderUpdate=e,this.mChildren.forEach((function(t){t.setNeedsRenderUpdate(e)}))}}])}(l.i);(0,c.A)(g,"TypeRTTI",new d.O("SceneNode",l.i.TypeRTTI))},79085:function(e,t,n){"use strict";n.d(t,{i:function(){return C}});n(60825);var r=n(80296),i=n(23029),a=n(92901),o=n(50388),s=n(53954),u=n(85501),c=n(64467),l=(n(5506),n(79432),n(26099),n(9920),n(98992),n(3949),n(58335),n(23500),n(63805)),h=n(49571),f=n(209),m=n(37842),p=n(47928),d=n(73380),v=n(52550),y=n(28001),g=n(44889),b=n(97869),A=n(18910),_=n(74461),M=n(81226),k=n(41840),w=n(12217),T=n(94273),x=n(33153);function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(S=function(){return!!e})()}var C=function(e){function t(e){var n,r,a,u;return(0,i.A)(this,t),r=this,a=t,a=(0,s.A)(a),n=(0,o.A)(r,S()?Reflect.construct(a,u||[],(0,s.A)(r).constructor):a.apply(r,u)),(0,c.A)(n,"mSceneObjectId",void 0),(0,c.A)(n,"mSyncHash",void 0),(0,c.A)(n,"mServerSyncTime",void 0),(0,c.A)(n,"mParentObject",void 0),(0,c.A)(n,"mName","SceneObject"),(0,c.A)(n,"mReceiveShadow",!1),(0,c.A)(n,"mCastShadow",!1),(0,c.A)(n,"mHasModel",!1),(0,c.A)(n,"mObjectLock",!1),(0,c.A)(n,"mEnabled",!0),(0,c.A)(n,"mVisible",!0),(0,c.A)(n,"mIsPreset",!1),(0,c.A)(n,"mLayers",void 0),(0,c.A)(n,"mMetaData",{}),(0,c.A)(n,"mUp",p.P.Up()),(0,c.A)(n,"mTransform",new v.d),(0,c.A)(n,"mInitialTransform",new v.d),(0,c.A)(n,"mBoundingBox",new d.N),(0,c.A)(n,"mRawBoundingBox",new d.N),(0,c.A)(n,"mBoundingBoxNeedsUpdate",!0),(0,c.A)(n,"mLocalGlobalStates",{}),(0,c.A)(n,"mNeedsRenderUpdate",!1),n.mSceneObjectId=null==e?-n.getObjectId():e,n.mLayers=new M.z,n.mLayers.enable(0),n}return(0,u.A)(t,e),(0,a.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"parse",value:function(e,t,n){var r=this;this.onBeforeParse(e,t)&&Object.keys(e).forEach((function(t){r.setValue(t,e[t],!0)}))}},{key:"onBeforeParse",value:function(e,t){return this.setSyncHash(t),!e.object_updated_at||this.getServerSyncTime()!==e.object_updated_at}},{key:"serialize",value:function(e,t){var n;this.getParent()&&this.getParent().getParent()&&!this.getParent().isDerivedOfTypeName("ProductNode")&&(n=this.getParent().getSceneObjectId());var r=e?++b.p.ObjectIdCount:this.getObjectId();return{name:this.mName,parent_id:void 0!==n?n:null,object_cid:r,object_uuid:e?h.V.guid():this.getObjectUUID(),scene_object_id:e?-r:this.mSceneObjectId,receive_shadow:this.mReceiveShadow,cast_shadow:this.mCastShadow,properties:{object_lock:this.mObjectLock,is_preset:this.mIsPreset},has_model:this.mHasModel,position_x:this.mTransform.position.x,position_y:this.mTransform.position.y,position_z:this.mTransform.position.z,rotation_x:this.mTransform.rotation.x,rotation_y:this.mTransform.rotation.y,rotation_z:this.mTransform.rotation.z,quaternion_x:this.mTransform.quaternion.x,quaternion_y:this.mTransform.quaternion.y,quaternion_z:this.mTransform.quaternion.z,quaternion_w:this.mTransform.quaternion.w,scale_x:this.mTransform.scale.x,scale_y:this.mTransform.scale.y,scale_z:this.mTransform.scale.z,up_x:this.up.x,up_y:this.up.y,up_z:this.up.z,visible:this.mVisible}}},{key:"setValue",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.proxySetValue(e,t,n);return r&&this.markNeedsRenderUpdate(),r}},{key:"getValue",value:function(e){return this.proxyGetValue(e)}},{key:"proxySetValue",value:function(e,t,n){var r=this;switch(e){case"Name":case"name":return this.mName=String(t),!0;case"object_uuid":return this._setObjectUUID(t),!0;case"object_updated_at":return this.mServerSyncTime=t,!0;case"receive_shadow":case"receiveShadow":return this.mReceiveShadow=(0,_.Hn)(t),!0;case"cast_shadow":case"castShadow":return this.mCastShadow=(0,_.Hn)(t),!0;case"visible":return this.mVisible=Boolean(t),!0;case"has_model":case"hasModel":return this.mHasModel=(0,_.Hn)(t),!0;case"object_lock":return this.mObjectLock=(0,_.Hn)(t),!0;case"position_x":return this.mTransform.position.x=parseFloat(t),this.mInitialTransform.position.copy(this.mTransform.position),!0;case"position_y":return this.mTransform.position.y=parseFloat(t),this.mInitialTransform.position.copy(this.mTransform.position),!0;case"position_z":return this.mTransform.position.z=parseFloat(t),this.mInitialTransform.position.copy(this.mTransform.position),!0;case"rotation_x":return this.mTransform.rotation.x=parseFloat(t),this.mInitialTransform.rotation.copy(this.mTransform.rotation),!0;case"rotation_y":return this.mTransform.rotation.y=parseFloat(t),this.mInitialTransform.rotation.copy(this.mTransform.rotation),!0;case"rotation_z":return this.mTransform.rotation.z=parseFloat(t),this.mInitialTransform.rotation.copy(this.mTransform.rotation),!0;case"quaternion_x":return this.mTransform.quaternion.x=parseFloat(t),this.mInitialTransform.quaternion.copy(this.mTransform.quaternion),!0;case"quaternion_y":return this.mTransform.quaternion.y=parseFloat(t),this.mInitialTransform.quaternion.copy(this.mTransform.quaternion),!0;case"quaternion_z":return this.mTransform.quaternion.z=parseFloat(t),this.mInitialTransform.quaternion.copy(this.mTransform.quaternion),!0;case"quaternion_w":return this.mTransform.quaternion.w=parseFloat(t),this.mInitialTransform.quaternion.copy(this.mTransform.quaternion),!0;case"scale_x":return this.mTransform.scale.x=parseFloat(t),this.mInitialTransform.scale.copy(this.mTransform.scale),!0;case"scale_y":return this.mTransform.scale.y=parseFloat(t),this.mInitialTransform.scale.copy(this.mTransform.scale),!0;case"scale_z":return this.mTransform.scale.z=parseFloat(t),this.mInitialTransform.scale.copy(this.mTransform.scale),!0;case"up_x":return this.mUp.x=parseFloat(t),!0;case"up_y":return this.mUp.y=parseFloat(t),!0;case"up_z":return this.mUp.z=parseFloat(t),!0;case"position":return t&&t instanceof p.P?(this.mTransform.position.copy(t),this.mInitialTransform.position.copy(this.mTransform.position)):Array.isArray(t)&&t.length>2?(this.mTransform.position.fromArray(t),this.mInitialTransform.position.copy(this.mTransform.position)):t&&!0===t.isVector3?(this.mTransform.position.copy(t),this.mInitialTransform.position.copy(this.mTransform.position)):t&&!0===t.isVector2&&(this.mTransform.position.x=t.x,this.mTransform.position.y=t.y,this.mInitialTransform.position.copy(this.mTransform.position)),!0;case"rotation":return t&&t instanceof f.O?(this.mTransform.rotation.copy(t),this.mInitialTransform.rotation.copy(this.mTransform.rotation)):Array.isArray(t)&&t.length>2?(this.mTransform.rotation.fromArray(t,f.O.DefaultOrder),this.mInitialTransform.rotation.copy(this.mTransform.rotation)):t&&!0===t.isEuler&&(this.mTransform.rotation.copy(t),this.mInitialTransform.rotation.copy(this.mTransform.rotation)),!0;case"quaternion":return t&&t instanceof m.P?(this.mTransform.quaternion.copy(t),this.mInitialTransform.quaternion.copy(this.mTransform.quaternion)):Array.isArray(t)&&t.length>3?(this.mTransform.quaternion.fromArray(t),this.mInitialTransform.quaternion.copy(this.mTransform.quaternion)):t&&!0===t.isQuaternion&&(this.mTransform.quaternion.copy(t),this.mInitialTransform.quaternion.copy(this.mTransform.quaternion)),!0;case"scale":return t&&t instanceof p.P?(this.mTransform.scale.copy(t),this.mInitialTransform.scale.copy(this.mTransform.scale)):Array.isArray(t)&&t.length>2?(this.mTransform.scale.fromArray(t),this.mInitialTransform.scale.copy(this.mTransform.scale)):t&&!0===t.isVector3&&(this.mTransform.scale.copy(t),this.mInitialTransform.scale.copy(this.mTransform.scale)),!0;case"up":return t&&t instanceof p.P?this.mUp.copy(t):Array.isArray(t)&&t.length>2?this.mUp.fromArray(t):t&&!0===t.isVector3&&this.mUp.copy(t),!0;case"is_preset":return this.mIsPreset=Boolean(t),!0;case"properties":if(null!=t)try{var i={};i="string"==typeof t?JSON.parse(t):t,Object.keys(i).forEach((function(e){"properties"!==e?r.setValue(e,i[e],n):l.UX.warn("Properties field can not contain key name properties")}))}catch(e){l.UX.warn("Could not parse properties:",e)}return!0}return!1}},{key:"proxyGetValue",value:function(e){switch(e){case"Name":case"name":return this.mName;case"object_cid":return this.getObjectId();case"object_uuid":return this.getObjectUUID();case"server_sync_time":case"object_updated_at":return this.getServerSyncTime();case"receive_shadow":case"receiveShadow":return this.mReceiveShadow;case"cast_shadow":case"castShadow":return this.mCastShadow;case"visible":return this.mVisible;case"has_model":case"hasModel":return this.mHasModel;case"object_lock":return this.mObjectLock;case"position":return this.mTransform.position;case"position_x":return this.mTransform.position.x;case"position_y":return this.mTransform.position.y;case"position_z":return this.mTransform.position.z;case"rotation":return this.mTransform.rotation;case"rotation_x":return this.mTransform.rotation.x;case"rotation_y":return this.mTransform.rotation.y;case"rotation_z":return this.mTransform.rotation.z;case"quaternion":return this.mTransform.quaternion;case"quaternion_x":return this.mTransform.quaternion.x;case"quaternion_y":return this.mTransform.quaternion.y;case"quaternion_z":return this.mTransform.quaternion.z;case"quaternion_w":return this.mTransform.quaternion.w;case"scale":return this.mTransform.scale;case"scale_x":return this.mTransform.scale.x;case"scale_y":return this.mTransform.scale.y;case"scale_z":return this.mTransform.scale.z;case"up":return this.mUp;case"up_x":return this.mUp.x;case"up_y":return this.mUp.y;case"up_z":return this.mUp.z;case"is_preset":return this.mIsPreset}return null}},{key:"needsRenderUpdate",value:function(){return this.mNeedsRenderUpdate}},{key:"setNeedsRenderUpdate",value:function(e){this.mNeedsRenderUpdate=e,k.K.eventBus().dispatch(new T.r(x.E.RequestFrame))}},{key:"markNeedsRenderUpdate",value:function(){this.setNeedsRenderUpdate(!0)}},{key:"needsBoundingBoxUpdate",value:function(){return this.mBoundingBoxNeedsUpdate}},{key:"markNeedsBoundingBoxUpdate",value:function(){this.mBoundingBoxNeedsUpdate=!0}},{key:"getSceneObjectId",value:function(){return this.mSceneObjectId}},{key:"setSceneObjectId",value:function(e){this.mSceneObjectId=e}},{key:"setSyncHash",value:function(e){this.mSyncHash=e}},{key:"getSyncHash",value:function(){return this.mSyncHash}},{key:"enabled",get:function(){var e=!this.getParent()||this.getParent().enabled;return this.mEnabled&&e},set:function(e){this.mEnabled!==e&&(this.mEnabled=e,this.markNeedsRenderUpdate())}},{key:"visible",get:function(){return this.mVisible},set:function(e){this.mVisible!==e&&(this.mVisible=e,this.markNeedsRenderUpdate(),k.K.eventBus().dispatch(new w.F,"".concat(this.getSceneObjectId())))}},{key:"getVisibility",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return!!this.mVisible&&(!(this.mParentObject&&!e)||this.mParentObject.getVisibility())}},{key:"isInSyncWithHash",value:function(e){return this.mSyncHash===e}},{key:"getServerSyncTime",value:function(){return this.mServerSyncTime}},{key:"setParent",value:function(e){this.mParentObject=e}},{key:"getParent",value:function(){return this.mParentObject}},{key:"getRootParent",value:function(){return this.mParentObject?this.mParentObject.getRootParent():this}},{key:"findParentOfType",value:function(e){return this.findParentOfTypeName(e.getTypeName())}},{key:"findParentOfTypeName",value:function(e){for(var t,n=this.getParent();n;){if(n.isDerivedOfTypeName(e)){t=n;break}n=n.getParent()}return t}},{key:"findRootOfType",value:function(e){return this.findRootOfTypeName(e.getTypeName())}},{key:"findRootOfTypeName",value:function(e){for(var t,n=this.getParent();n;)n.isDerivedOfTypeName(e)&&(t=n),n=n.getParent();return t}},{key:"setGlobalState",value:function(e){this.mLocalGlobalStates[e.getType()]=e}},{key:"getGlobalState",value:function(e){return this.mLocalGlobalStates[e]}},{key:"removeGlobalState",value:function(e){delete this.mLocalGlobalStates[e]}},{key:"removeAllGlobalStates",value:function(){var e=this;Object.keys(this.mLocalGlobalStates).forEach((function(t){delete e.mLocalGlobalStates[t]}))}},{key:"fixedUpdate",value:function(e){this.onSceneFixedUpdate(e)}},{key:"onSceneFixedUpdate",value:function(e){this.dispatchMessageToComponents(e)}},{key:"beforeUpdate",value:function(e){this.enabled&&this.onBeforeSceneUpdate(e)}},{key:"afterUpdate",value:function(e){this.enabled&&this.onAfterSceneUpdate(e)}},{key:"update",value:function(e){this.enabled&&this.onSceneUpdate(e)}},{key:"onBeforeSceneUpdate",value:function(e){this.dispatchMessageToComponents(e)}},{key:"onSceneUpdate",value:function(e){this.updateMatrixLocal(),this.dispatchMessageToComponents(e),this.updateMatrixWorld()}},{key:"onAfterSceneUpdate",value:function(e){this.dispatchMessageToComponents(e)}},{key:"draw",value:function(e,t){this.enabled&&(this.onBeforeDraw(e,t),this.dispatchMessageToComponents(new A.yR(e,t)),this.onDraw(e,t))}},{key:"afterDraw",value:function(e,t){this.enabled&&(this.dispatchMessageToComponents(new A.cf(e,t)),this.onAfterDraw(e,t))}},{key:"onBeforeDraw",value:function(e,t){for(var n=0,i=Object.entries(this.mLocalGlobalStates);n<i.length;n++){var a=(0,r.A)(i[n],2)[1];e.pushGlobalState(a)}}},{key:"onDraw",value:function(e,t){}},{key:"onAfterDraw",value:function(e,t){for(var n=0,i=Object.entries(this.mLocalGlobalStates);n<i.length;n++){var a=(0,r.A)(i[n],2)[1];e.popGlobalState(a.getType())}}},{key:"getGarbageHash",value:function(){return this.getType().getTypeName()}},{key:"getGarbageTime",value:function(){return-1}},{key:"getTransform",value:function(){return this.mTransform}},{key:"transform",get:function(){return this.mTransform}},{key:"getUp",value:function(){return this.mUp}},{key:"up",get:function(){return this.mUp}},{key:"getInitialTransform",value:function(){return this.mInitialTransform}},{key:"initialTransform",get:function(){return this.mInitialTransform}},{key:"updateMatrixLocal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.mTransform.updateMatrix(e)}},{key:"updateMatrixWorld",value:function(){this.mParentObject&&this.mParentObject.updateMatrixWorld(),this.mParentObject?this.transform.updateMatrixWorld(this.mParentObject.transform.matrixWorld):this.transform.updateMatrixWorld()}},{key:"boundingBox",get:function(){return this.mBoundingBox}},{key:"getBoundingBox",value:function(){return!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?this.mBoundingBox:this.mRawBoundingBox}},{key:"_updateBoundingBox",value:function(e){this.mRawBoundingBox.copy(e),this.mBoundingBox.copy(e.clone().applyMatrix4(this.transform.matrix)),this.mBoundingBoxNeedsUpdate=!1,k.K.eventBus().dispatch(new w.F,"".concat(this.getSceneObjectId()))}},{key:"castShadow",get:function(){return this.mCastShadow},set:function(e){this.mCastShadow!==e&&(this.mCastShadow=e,this.markNeedsRenderUpdate())}},{key:"receiveShadow",get:function(){return this.mReceiveShadow},set:function(e){this.mReceiveShadow!==e&&(this.mReceiveShadow=e,this.markNeedsRenderUpdate())}},{key:"name",get:function(){return this.mName},set:function(e){this.mName!==e&&(this.mName=e,this.markNeedsRenderUpdate())}},{key:"layers",get:function(){return this.mLayers}},{key:"metaData",get:function(){return this.mMetaData}},{key:"isPreset",get:function(){return this.mIsPreset},set:function(e){this.mIsPreset=e}},{key:"onAttached",value:function(e){this.dispatchMessageToComponents(new A.vq(e))}},{key:"onDetached",value:function(e){this.dispatchMessageToComponents(new A.Xf(e))}},{key:"destroy",value:function(e,t){l.UX.print("Destroying scene object:",this.mName,this.mSceneObjectId),this.enabled=!1,this.dispatchMessageToComponents(t||new A.OZ),this.removeAllComponents(!0),this.mTransform.dispose(),this.mUp.onChange.unsubscribe(),this.mInitialTransform.onChange.unsubscribe()}}])}(y.b);(0,c.A)(C,"TypeRTTI",new g.O("SceneObject",y.b.TypeRTTI))},53259:function(e,t,n){"use strict";var r;n.d(t,{R:function(){return r}}),function(e){e[e.Desktop=0]="Desktop",e[e.Mobile=1]="Mobile"}(r||(r={}))},47792:function(e,t,n){"use strict";n.d(t,{n:function(){return h}});var r=n(23029),i=n(92901),a=n(64467),o=(n(52675),n(89463),n(2259),n(16280),n(23418),n(23792),n(34782),n(62010),n(69085),n(26099),n(27495),n(90906),n(38781),n(47764),n(62953),n(53259)),s=function(){return(0,i.A)((function e(t){(0,r.A)(this,e),(0,a.A)(this,"mSettings",void 0),this.mSettings=t}),[{key:"shadow",get:function(){return this.mSettings.shadow_mob}},{key:"lod",get:function(){return this.mSettings.lod_mob}},{key:"compression",get:function(){return this.mSettings.compression_mob}},{key:"anti_aliasing",get:function(){return"1"==this.mSettings.aliasing_mob}},{key:"alpha",get:function(){return"1"==this.mSettings.alpha}},{key:"clear_color",get:function(){return this.mSettings.clear_color}},{key:"esd_scene_scale",get:function(){return this.mSettings.esd_scene_scale}}])}(),u=function(){return(0,i.A)((function e(t){(0,r.A)(this,e),(0,a.A)(this,"mSettings",void 0),this.mSettings=t}),[{key:"shadow",get:function(){return this.mSettings.shadow_desk}},{key:"lod",get:function(){return this.mSettings.lod_desk}},{key:"compression",get:function(){return this.mSettings.compression_desk}},{key:"anti_aliasing",get:function(){return"1"==this.mSettings.aliasing_desk}},{key:"alpha",get:function(){return"1"==this.mSettings.alpha}},{key:"clear_color",get:function(){return this.mSettings.clear_color}},{key:"esd_scene_scale",get:function(){return this.mSettings.esd_scene_scale}}])}();function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var h=function(){return(0,i.A)((function e(t){(0,r.A)(this,e),(0,a.A)(this,"mCatalogueMeta",void 0),this.mCatalogueMeta=null!=t?t:null}),[{key:"withCatalogueSettings",value:function(e){return this.mCatalogueMeta=e.getCatalogueMeta(),this}},{key:"withSceneSettings",value:function(e){return this.mCatalogueMeta=this.mCatalogueMeta||{},this.mCatalogueMeta.scene_settings=this.validateSettings(e),this}},{key:"withCatalogueMeta",value:function(e){var t;return this.mCatalogueMeta=Object.assign(null!==(t=this.mCatalogueMeta)&&void 0!==t?t:{},e),this}},{key:"validateSettings",value:function(e){return Object.assign(Object.assign({shadow_desk:"3",shadow_mob:"2",lod_desk:"0",lod_mob:"1",compression_desk:"1",compression_mob:"1",aliasing_desk:"1",aliasing_mob:"1",alpha:"0",clear_color:2147483647,esd_scene_scale:1,physics:{enabled:!1},renderer_type:"threejs"},null!=e?e:{}))}},{key:"getCatalogueMeta",value:function(){return this.mCatalogueMeta||{}}},{key:"isModuleEnabled",value:function(e){var t;return!(!this.mCatalogueMeta||!this.mCatalogueMeta.modules)&&!0===(null===(t=this.mCatalogueMeta.modules)||void 0===t?void 0:t[e])}},{key:"getModuleSettings",value:function(e){return this.mCatalogueMeta&&this.mCatalogueMeta.module_settings&&this.mCatalogueMeta.module_settings[e]?this.mCatalogueMeta.module_settings[e]:{}}},{key:"getSubModuleSettings",value:function(e,t){if(!(this.mCatalogueMeta&&this.mCatalogueMeta.module_settings&&this.mCatalogueMeta.module_settings[e]))return{};var n=this.mCatalogueMeta.module_settings[e];if(!Array.isArray(n))return{};var r,i=c(n);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.scope===t)return a}}catch(e){i.e(e)}finally{i.f()}return{}}},{key:"getProductPresentationSettings",value:function(){return this.getCatalogueMeta().product_presentation}},{key:"getSceneDeviceSettings",value:function(e){return e===o.R.Mobile?new s(this.getSceneSettings()):new u(this.getSceneSettings())}},{key:"getSceneSettings",value:function(){var e;return this.validateSettings(null===(e=this.mCatalogueMeta)||void 0===e?void 0:e.scene_settings)}},{key:"getSceneRevId",value:function(){var e;return this.mCatalogueMeta?null!==(e=this.mCatalogueMeta.scene_rev_id)&&void 0!==e?e:0:null}},{key:"getGraphRevId",value:function(){var e;return this.mCatalogueMeta?null!==(e=this.mCatalogueMeta.graph_active)&&void 0!==e?e:0:null}},{key:"getVersionHash",value:function(){return this.mCatalogueMeta.version_hash}},{key:"dispose",value:function(){this.mCatalogueMeta&&delete this.mCatalogueMeta}}])}()},28919:function(e,t,n){"use strict";n.d(t,{hj:function(){return d},nQ:function(){return m.n},RB:function(){return v.R}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=(n(26099),n(3362),n(54756)),u=n.n(s),c=n(38975),l=n(67138),h=n(11454),f=n(39741),m=n(47792),p=n(49053),d=function(){return(0,a.A)((function e(t,n){(0,i.A)(this,e),(0,o.A)(this,"mMetaSubject",void 0),(0,o.A)(this,"mCatalogueId",void 0),(0,o.A)(this,"mVersionHash",void 0),(0,o.A)(this,"mUpdateData",!0),this.mCatalogueId=t,this.mVersionHash=n}),[{key:"loadAndObserve",value:function(){return this.preload(),this.mMetaSubject.pipe((0,c.s)(1))}},{key:"saveCatalogueSettings",value:(t=(0,r.A)(u().mark((function e(t,n){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(new m.n).validateSettings(n),e.next=3,l.k.getInstance().put(h.w.makeApiRoute("catalogue/".concat(t,"/meta")),{scene_settings:r});case 3:return e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e,n){return t.apply(this,arguments)})},{key:"dispose",value:function(){this.mMetaSubject&&(this.mMetaSubject.error("disposed"),delete this.mMetaSubject),p.R.getInstance().resetCache()}},{key:"preload",value:function(){var e=this;this.mMetaSubject&&!this.mUpdateData||(this.mUpdateData=!1,this.mMetaSubject&&this.mMetaSubject.error("forced to reload"),this.mMetaSubject=new f.m(1),this.loadFromId(this.mCatalogueId,this.mVersionHash).then((function(t){e.mMetaSubject&&(e.mMetaSubject.next(t),e.mMetaSubject.complete())})).catch((function(t){e.mMetaSubject&&(e.mMetaSubject.next(null),e.mMetaSubject.error(t))})))}},{key:"loadFromId",value:(e=(0,r.A)(u().mark((function e(t,n){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){if(isNaN(t))return e({});p.R.getInstance().resolveMeta(t,n).pipe((0,c.s)(1)).subscribe({next:function(t){e(t)},error:function(e){r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)})}]);var e,t}(),v=n(53259)},3216:function(e,t,n){"use strict";n.d(t,{_:function(){return k}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=n(54756),u=n.n(s),c=(n(16280),n(28706),n(23792),n(79432),n(26099),n(38781),n(47764),n(9920),n(98992),n(3949),n(23500),n(62953),n(3296),n(27208),n(48408),n(98721),n(13288)),l=n(39741),h=n(1005),f=n(38975),m=n(49053),p=n(74461),d=n(67138),v=n(11454);n(52675),n(2008),n(44114),n(83851),n(81278),n(17333),n(54520);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){(0,o.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=function(){return(0,a.A)((function e(t){(0,i.A)(this,e),(0,o.A)(this,"mData",void 0),this.mData=t}),[{key:"getCatalogue",value:function(){var e;return null!==(e=this.mData.catalogue)&&void 0!==e?e:{}}},{key:"getMaterialsByGroup",value:function(){var e;return null!==(e=this.mData.materials_by_group)&&void 0!==e?e:[]}},{key:"getAttributes",value:function(){var e;return null!==(e=this.mData.attributes)&&void 0!==e?e:{}}},{key:"getRules",value:function(){var e;return null!==(e=this.mData.rules)&&void 0!==e?e:[]}},{key:"getOffsetGroups",value:function(){var e;return null!==(e=this.mData.offset_groups)&&void 0!==e?e:{}}},{key:"getCatalogueClasses",value:function(){var e;return null!==(e=this.mData.modifier_classes)&&void 0!==e?e:{}}},{key:"getPricingSettings",value:function(){return this.buildDefaultPricingSettings(this.mData.pricing_settings)}},{key:"getPricingGroups",value:function(){var e;return null!==(e=this.mData.pricing_groups)&&void 0!==e?e:{}}},{key:"getMaterials",value:function(){var e;return null!==(e=this.mData.all_materials)&&void 0!==e?e:{}}},{key:"getMedia",value:function(){var e;return null!==(e=this.mData.media)&&void 0!==e?e:{}}},{key:"getPrintReadyFiles",value:function(){var e;return null!==(e=this.mData.print_ready_files)&&void 0!==e?e:{}}},{key:"buildDefaultPricingSettings",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return g(g({id:null,sku_calculator:"part_sku"},e),{},{price_calculators:g({attribute_pricing:!0,pricing_matrix:!0,script_engine:!1,external_api:!1},(e||{}).price_calculators)})}}])}(),A=n(63805),_=n(41840),M=n(39136),k=function(){return(0,a.A)((function e(){(0,i.A)(this,e),(0,o.A)(this,"mLoader",{})}),[{key:"resetCache",value:function(){return this.disposeCacheLoader(),this}},{key:"disposeCacheLoader",value:function(){var e=this;Object.keys(this.mLoader).forEach((function(t){e.mLoader[t]&&e.mLoader[t].error("disposed")})),this.mLoader={}}},{key:"resolveBootstrapData",value:function(e){var t=this;return p.N5.isNumeric(e)?(this.mLoader[e]||(this.mLoader[e]=new l.m(1),m.R.getInstance().resolveMeta(e).pipe((0,f.s)(1)).subscribe({next:function(n){A.UX.print("bootstrap got meta: ",n),t._resolveFromCache(e,n).then((function(n){A.UX.print("boostrap got data from cache: ",n),t.mLoader[e].next(new b(n))})).catch((function(r){t._resolveFromAPI(e,n).then((function(n){A.UX.print("boostrap got data from api: ",n),t.mLoader[e].next(new b(n)),t.mLoader[e].complete()})).catch((function(n){t.mLoader[e].error(n),delete t.mLoader[e]}))}))},error:function(n){t.mLoader[e].error(n),delete t.mLoader[e]}})),this.mLoader[e].pipe((0,h.u)())):(0,c.$)((function(){return new Error("Catalogue id is not an ID")}))}},{key:"_resolveFromAPI",value:(t=(0,r.A)(u().mark((function e(t,n){var r,i,a;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new URL("".concat(v.w.apiUrl,"catalogue/").concat(t,"/bootstrap/v2"))).searchParams.append("include[attributes]","categories,values.categories,values.valuable,entityProperties.entityPropertyValues"),r.searchParams.append("include[pricing_groups]","pricing_rules.pricingRuleAdjustmentFields,pricing_classes"),(i=n.version_hash)?r.searchParams.append("include[revision]",i):this.isInSceneEditor()&&r.searchParams.append("use_active_db","true"),e.next=7,d.k.getInstance().get(decodeURIComponent(r.toString()));case 7:if(200===(a=e.sent).status){e.next=10;break}throw new Error("Response status: ".concat(a.status));case 10:return e.abrupt("return",a.data);case 11:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"_resolveFromCache",value:(e=(0,r.A)(u().mark((function e(t,n){var r,i;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"==typeof n.bootstrap_data_cache_file&&0!==n.bootstrap_data_cache_file.length){e.next=2;break}throw new Error("not hash");case 2:return r=n.bootstrap_data_cache_file,e.next=5,d.k.uniqueInstance().get(r,{baseURL:v.w.spacesUrl});case 5:if(200===(i=e.sent).status){e.next=8;break}throw new Error("Response status: ".concat(i.status));case 8:return e.abrupt("return",i.data);case 9:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)})},{key:"isInSceneEditor",value:function(){return _.K.stateRegistery().get(M.V.SCENE_EDITOR)}}],[{key:"getInstance",value:function(){return this._instance||(this._instance=new this),this._instance}}]);var e,t}();(0,o.A)(k,"_instance",null)},11454:function(e,t,n){"use strict";n.d(t,{w:function(){return u}});var r,i=n(23029),a=n(92901),o=(n(28706),n(27495),n(25440),n(40537)),s=n(85121);!function(e){e.Production="production",e.Staging="staging",e.Local="local"}(r||(r={}));var u=function(){function e(){(0,i.A)(this,e)}return(0,a.A)(e,null,[{key:"productionBuild",get:function(){return s.c.production}},{key:"environment",get:function(){return s.c.environment}},{key:"protocol",get:function(){return s.c.protocol}},{key:"backendURL",get:function(){return s.c.api}},{key:"serverAddress",get:function(){return s.c.admin}},{key:"cacheAddress",get:function(){return s.c.cache}},{key:"spacesAddress",get:function(){return s.c.storage}},{key:"apiUrl",get:function(){return"".concat(e.backendURL,"/api/")}},{key:"authUrl",get:function(){return"".concat(e.backendURL,"/oauth/token")}},{key:"kioskAuthUrl",get:function(){return"".concat(e.backendURL,"/kiosk/login")}},{key:"storageUrl",get:function(){return"".concat(e.serverAddress,"/storage/")}},{key:"assetsUrl",get:function(){return"local"===s.c.environment?"/assets/":"".concat(e.serverAddress,"/assets/")}},{key:"spacesUrl",get:function(){return"".concat(e.spacesAddress,"/")}},{key:"cacheUrl",get:function(){return"".concat(e.cacheAddress,"/")}},{key:"makeApiRoute",value:function(t){return e.apiUrl+((0,o.isUndefined)(t)?"":t)}},{key:"makeTeamRoute",value:function(t,n){var r=e.backendURL.replace(/https?:\/\/((www|master)\.)*/gi,".");return"".concat(e.protocol).concat(t).concat(r).concat(n)}},{key:"makeFrameRoute",value:function(t,n,r){var i=e.backendURL.replace(/https?:\/\/((www|master)\.)*/gi,"."),a="".concat(e.protocol).concat(t).concat(i);return n&&(a+="/product/".concat(n)),r&&(a+="?preset_id=".concat(encodeURIComponent(r))),encodeURI(a)}}])}()},58794:function(e,t,n){"use strict";n.d(t,{Fr:function(){return l},O:function(){return o},Pf:function(){return c},m0:function(){return u},un:function(){return a},v1:function(){return f},xl:function(){return h}});n(27495),n(90906),n(71761);var r=n(95216);function i(){return navigator.platform&&/MacIntel/.test(navigator.platform)&&navigator.maxTouchPoints>1}function a(){return!(!navigator.platform||!/iPhone|iPod|iPad|iPhone Simulator|iPod Simulator/.test(navigator.platform))||(!!i()||/iPad|iPhone|iPod|Pike v7\.6 release 92|Pike v7\.8 release 517/.test(navigator.userAgent)&&!("MSStream"in window))}function o(){if(/iP(hone|od|ad)/.test(navigator.platform)){var e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]}return[0,0,0]}function s(){return/windows phone/i.test(navigator.userAgent)}function u(){return!(!navigator.platform||!/Android/.test(navigator.platform))||/android/i.test(navigator.userAgent)&&!s()}function c(){return a()?r.U.iOS:u()?r.U.Android:s()?r.U.WindowsPhone:navigator.platform&&/OS\/2|Pocket PC|Windows|Win16|Win32|Win64|WinCE/.test(navigator.platform)?r.U.Windows:navigator.platform&&/Macintosh|MacIntel|MacPPC|Mac68K/.test(navigator.platform)?r.U.MacOS:r.U.Unknown}function l(){return a()||u()||s()}function h(){return!l()}function f(){if(i())return!0;var e=navigator.userAgent;return/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/i.test(e)}},69567:function(e,t,n){"use strict";n.d(t,{N:function(){return y}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=n(54756),u=n.n(s),c=(n(16280),n(28706),n(2008),n(23418),n(74423),n(23792),n(26099),n(27495),n(21699),n(47764),n(25440),n(17333),n(98992),n(54520),n(62953),n(74461)),l=n(63805),h=(n(33110),n(3296),n(27208),n(48408),n(98721),n(49571)),f=n(78904),m=n.n(f),p=n(39741),d=n(72985),v=function(){return(0,a.A)((function e(t,n,r){var a,s,u;(0,i.A)(this,e),(0,o.A)(this,"id",void 0),(0,o.A)(this,"family",void 0),(0,o.A)(this,"weight",void 0),(0,o.A)(this,"style",void 0),(0,o.A)(this,"stretch",void 0),(0,o.A)(this,"url",void 0),(0,o.A)(this,"format",void 0),(0,o.A)(this,"loaded",!1),(0,o.A)(this,"failed",!1),(0,o.A)(this,"loadingSubject",void 0),this.family=t,this.url=n,this.weight=null!==(a=null==r?void 0:r.weight)&&void 0!==a?a:"normal",this.style=null!==(s=null==r?void 0:r.style)&&void 0!==s?s:"normal",this.stretch=null!==(u=null==r?void 0:r.stretch)&&void 0!==u?u:"normal",this.format=this.resolveFormat(),this.id=this.generateHash()}),[{key:"loadAsync",value:function(e){var t=this;this.loaded||this.failed||this.loadingSubject||(this.loadingSubject=new p.m(1),new(m())(this.family,{weight:this.weight,style:this.style,stretch:this.stretch}).load(null,e).then((function(){t.loaded=!0,t.loadingSubject.next(),t.loadingSubject.complete()})).catch((function(e){t.failed=!0,t.loadingSubject.error(e)})))}},{key:"waitUntilLoaded",value:(e=(0,r.A)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.loaded){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",(0,d._)(this.loadingSubject));case 3:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"dispose",value:function(){this.loadingSubject&&(this.loadingSubject.error("disposed"),delete this.loadingSubject)}},{key:"realWeight",get:function(){return"normal"===this.weight?"400":"bold"===this.weight?"700":this.weight}},{key:"resolveFormat",value:function(){if(!this.url)return"";var e=new URL(this.url),t=e.pathname.lastIndexOf(".");switch(e.pathname.substring(t+1).toLowerCase()){case"woff2":return"woff2";case"woff":return"woff";case"otf":return"opentype";case"eot":return"embedded-opentype";case"svg":return"svg";default:return"truetype"}}},{key:"generateHash",value:function(){return h.V.Md5(JSON.stringify({family:this.family,weight:this.weight,style:this.style,stretch:this.stretch,url:this.url}))}}]);var e}(),y=function(){function e(){(0,i.A)(this,e),(0,o.A)(this,"mFontLoader",{}),(0,o.A)(this,"mFontLoadTimeout",1500)}return(0,a.A)(e,[{key:"resolveFontFace",value:function(e,t){if(!(0,c.uI)(e))throw new Error("Font family not defined");var n=new v(e,t);return n.id in this.mFontLoader?this.mFontLoader[n.id]:(this.registerFontFace(n),n)}},{key:"waitFontFaceLoaded",value:(t=(0,r.A)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.id in this.mFontLoader||this.registerFontFace(t),e.next=3,this.mFontLoader[t.id].waitUntilLoaded();case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"registerFontFace",value:function(e){this.mFontLoader[e.id]=e,this.createLinkElement(e),this.isFontAvailable(e)?e.loaded=!0:(this.createSpanElement(e),e.loadAsync(this.mFontLoadTimeout))}},{key:"cleanup",value:function(){for(var e in this.mFontLoader){this.mFontLoader[e].dispose();var t=document.getElementById("".concat(e,"_preload")),n=document.getElementById(e);null==t||t.remove(),null==n||n.remove(),delete this.mFontLoader[e]}}},{key:"createLinkElement",value:function(e){if((0,c.uI)(e.url)&&!document.getElementById(e.id)){var t="@font-face {\n                font-family: '".concat(e.family,"';\n                src: url('").concat(e.url,"') format('").concat(e.format,"');\n            }"),n=document.createElement("link");n.setAttribute("id",e.id),n.setAttribute("rel","stylesheet"),n.setAttribute("href","data:text/css;charset=UTF-8,".concat(encodeURIComponent(t))),document.head.appendChild(n)}}},{key:"createSpanElement",value:function(e){var t="".concat(e.id,"_preload");if(!document.getElementById(t)){var n=document.createElement("span");n.id=t,n.textContent="Preload font: ".concat(e.family),n.style.position="fixed",n.style.opacity="0",n.style.pointerEvents="none",n.style.fontFamily="'".concat(e.family,"'"),n.style.fontSize="14px",n.style.fontWeight=e.weight,n.style.fontStyle=e.style,n.style.fontStretch=e.stretch,document.body.appendChild(n)}}},{key:"isFontAvailable",value:function(t){if(document.fonts&&(Array.from(document.fonts.values()).filter((function(e){return e.family===t.family&&e.weight===t.realWeight&&e.style===t.style&&e.stretch===t.stretch})).length>0&&document.fonts.check('normal normal 14px "'.concat(t.family,'"'))))return l.UX.print("Font installed locally! [using experiment api]"),!0;return!!e.SystemFonts.includes(t.family.toLowerCase().replace(/['"]/g,""))&&(l.UX.print("Font installed locally! [using custom list]"),!0)}}],[{key:"getInstance",value:function(){return e.sInstance||(e.sInstance=new e),e.sInstance}}]);var t}();(0,o.A)(y,"sInstance",void 0),(0,o.A)(y,"SystemFonts",["arial","calibri","comic sans","comic sans ms","consolas","courier","courier new","georgia","garamond","helvetica","impact","tahoma","trebuchet ms","monospace","sans-serif","serif","times","times new roman","verdana","wingdings"])},67138:function(e,t,n){"use strict";n.d(t,{k:function(){return it}});var r={};n.r(r),n.d(r,{hasBrowserEnv:function(){return ce},hasStandardBrowserEnv:function(){return le},hasStandardBrowserWebWorkerEnv:function(){return fe}});var i=n(10467),a=n(23029),o=n(92901),s=n(64467),u=n(54756),c=n.n(u);n(62062),n(44114),n(54554),n(26099),n(3362),n(27495),n(90906),n(41393),n(81454);function l(e,t){return function(){return e.apply(t,arguments)}}const{toString:h}=Object.prototype,{getPrototypeOf:f}=Object,m=(p=Object.create(null),e=>{const t=h.call(e);return p[t]||(p[t]=t.slice(8,-1).toLowerCase())});var p;const d=e=>(e=e.toLowerCase(),t=>m(t)===e),v=e=>t=>typeof t===e,{isArray:y}=Array,g=v("undefined");const b=d("ArrayBuffer");const A=v("string"),_=v("function"),M=v("number"),k=e=>null!==e&&"object"==typeof e,w=e=>{if("object"!==m(e))return!1;const t=f(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},T=d("Date"),x=d("File"),S=d("Blob"),C=d("FileList"),E=d("URLSearchParams");function R(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),y(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function I(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,D=e=>!g(e)&&e!==O;const P=(B="undefined"!=typeof Uint8Array&&f(Uint8Array),e=>B&&e instanceof B);var B;const F=d("HTMLFormElement"),N=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),L=d("RegExp"),j=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};R(n,((n,i)=>{let a;!1!==(a=t(n,i,e))&&(r[i]=a||n)})),Object.defineProperties(e,r)},U="abcdefghijklmnopqrstuvwxyz",V="0123456789",z={DIGIT:V,ALPHA:U,ALPHA_DIGIT:U+U.toUpperCase()+V};const H=d("AsyncFunction");var G={isArray:y,isArrayBuffer:b,isBuffer:function(e){return null!==e&&!g(e)&&null!==e.constructor&&!g(e.constructor)&&_(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||_(e.append)&&("formdata"===(t=m(e))||"object"===t&&_(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&b(e.buffer),t},isString:A,isNumber:M,isBoolean:e=>!0===e||!1===e,isObject:k,isPlainObject:w,isUndefined:g,isDate:T,isFile:x,isBlob:S,isRegExp:L,isFunction:_,isStream:e=>k(e)&&_(e.pipe),isURLSearchParams:E,isTypedArray:P,isFileList:C,forEach:R,merge:function e(){const{caseless:t}=D(this)&&this||{},n={},r=(r,i)=>{const a=t&&I(n,i)||i;w(n[a])&&w(r)?n[a]=e(n[a],r):w(r)?n[a]=e({},r):y(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&R(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(R(t,((t,r)=>{n&&_(t)?e[r]=l(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,o;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],r&&!r(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==n&&f(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:m,kindOfTest:d,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(y(e))return e;let t=e.length;if(!M(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:F,hasOwnProperty:N,hasOwnProp:N,reduceDescriptors:j,freezeMethods:e=>{j(e,((t,n)=>{if(_(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];_(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return y(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:I,global:O,isContextDefined:D,ALPHABET:z,generateString:(e=16,t=z.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&_(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(k(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=y(e)?[]:{};return R(e,((e,t)=>{const a=n(e,r+1);!g(a)&&(i[t]=a)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:H,isThenable:e=>e&&(k(e)||_(e))&&_(e.then)&&_(e.catch)};function q(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}G.inherits(q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:G.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const W=q.prototype,K={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{K[e]={value:e}})),Object.defineProperties(q,K),Object.defineProperty(W,"isAxiosError",{value:!0}),q.from=(e,t,n,r,i,a)=>{const o=Object.create(W);return G.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),q.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};var X=q;function Y(e){return G.isPlainObject(e)||G.isArray(e)}function $(e){return G.endsWith(e,"[]")?e.slice(0,-2):e}function Z(e,t,n){return e?e.concat(t).map((function(e,t){return e=$(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Q=G.toFlatObject(G,{},null,(function(e){return/^is[A-Z]/.test(e)}));var J=function(e,t,n){if(!G.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=G.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!G.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,a=n.dots,o=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&G.isSpecCompliantForm(t);if(!G.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(G.isDate(e))return e.toISOString();if(!s&&G.isBlob(e))throw new X("Blob is not supported. Use a Buffer instead.");return G.isArrayBuffer(e)||G.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(G.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(G.isArray(e)&&function(e){return G.isArray(e)&&!e.some(Y)}(e)||(G.isFileList(e)||G.endsWith(n,"[]"))&&(s=G.toArray(e)))return n=$(n),s.forEach((function(e,r){!G.isUndefined(e)&&null!==e&&t.append(!0===o?Z([n],r,a):null===o?n:n+"[]",u(e))})),!1;return!!Y(e)||(t.append(Z(i,n,a),u(e)),!1)}const l=[],h=Object.assign(Q,{defaultVisitor:c,convertValue:u,isVisitable:Y});if(!G.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!G.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),G.forEach(n,(function(n,a){!0===(!(G.isUndefined(n)||null===n)&&i.call(t,n,G.isString(a)?a.trim():a,r,h))&&e(n,r?r.concat(a):[a])})),l.pop()}}(e),t};function ee(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function te(e,t){this._pairs=[],e&&J(e,this,t)}const ne=te.prototype;ne.append=function(e,t){this._pairs.push([e,t])},ne.toString=function(e){const t=e?function(t){return e.call(this,t,ee)}:ee;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var re=te;function ie(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ae(e,t,n){if(!t)return e;const r=n&&n.encode||ie,i=n&&n.serialize;let a;if(a=i?i(t,n):G.isURLSearchParams(t)?t.toString():new re(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}var oe=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){G.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},se={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ue={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:re,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ce="undefined"!=typeof window&&"undefined"!=typeof document,le=(he="undefined"!=typeof navigator&&navigator.product,ce&&["ReactNative","NativeScript","NS"].indexOf(he)<0);var he;const fe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var me={...r,...ue};var pe=function(e){function t(e,n,r,i){let a=e[i++];if("__proto__"===a)return!0;const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&G.isArray(r)?r.length:a,s)return G.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&G.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&G.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}(r[a])),!o}if(G.isFormData(e)&&G.isFunction(e.entries)){const n={};return G.forEachEntry(e,((e,r)=>{t(function(e){return G.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const de={transitional:se,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=G.isObject(e);i&&G.isHTMLForm(e)&&(e=new FormData(e));if(G.isFormData(e))return r?JSON.stringify(pe(e)):e;if(G.isArrayBuffer(e)||G.isBuffer(e)||G.isStream(e)||G.isFile(e)||G.isBlob(e))return e;if(G.isArrayBufferView(e))return e.buffer;if(G.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return J(e,new me.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return me.isNode&&G.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=G.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return J(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(G.isString(e))try{return(t||JSON.parse)(e),G.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||de.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&G.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw X.from(e,X.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:me.classes.FormData,Blob:me.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};G.forEach(["delete","get","head","post","put","patch"],(e=>{de.headers[e]={}}));var ve=de;const ye=G.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ge=Symbol("internals");function be(e){return e&&String(e).trim().toLowerCase()}function Ae(e){return!1===e||null==e?e:G.isArray(e)?e.map(Ae):String(e)}function _e(e,t,n,r,i){return G.isFunction(r)?r.call(this,t,n):(i&&(t=n),G.isString(t)?G.isString(r)?-1!==t.indexOf(r):G.isRegExp(r)?r.test(t):void 0:void 0)}class Me{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=be(t);if(!i)throw new Error("header name must be a non-empty string");const a=G.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=Ae(e))}const a=(e,t)=>G.forEach(e,((e,n)=>i(e,n,t)));return G.isPlainObject(e)||e instanceof this.constructor?a(e,t):G.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&ye[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=be(e)){const n=G.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(G.isFunction(t))return t.call(this,e,n);if(G.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=be(e)){const n=G.findKey(this,e);return!(!n||void 0===this[n]||t&&!_e(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=be(e)){const i=G.findKey(n,e);!i||t&&!_e(0,n[i],i,t)||(delete n[i],r=!0)}}return G.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!_e(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return G.forEach(this,((r,i)=>{const a=G.findKey(n,i);if(a)return t[a]=Ae(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();o!==i&&delete t[i],t[o]=Ae(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return G.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&G.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ge]=this[ge]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=be(e);t[r]||(!function(e,t){const n=G.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return G.isArray(e)?e.forEach(r):r(e),this}}Me.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),G.reduceDescriptors(Me.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),G.freezeMethods(Me);var ke=Me;function we(e,t){const n=this||ve,r=t||n,i=ke.from(r.headers);let a=r.data;return G.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function Te(e){return!(!e||!e.__CANCEL__)}function xe(e,t,n){X.call(this,null==e?"canceled":e,X.ERR_CANCELED,t,n),this.name="CanceledError"}G.inherits(xe,X,{__CANCEL__:!0});var Se=xe;var Ce=me.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const o=[e+"="+encodeURIComponent(t)];G.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),G.isString(r)&&o.push("path="+r),G.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Ee(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var Re=me.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=G.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};var Ie=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=r[o];i||(i=u),n[a]=s,r[a]=u;let l=o,h=0;for(;l!==a;)h+=n[l++],l%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),u-i<t)return;const f=c&&u-c;return f?Math.round(1e3*h/f):void 0}};function Oe(e,t){let n=0;const r=Ie(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-n,u=r(s);n=a;const c={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&a<=o?(o-a)/u:void 0,event:i};c[t?"download":"upload"]=!0,e(c)}}const De={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=ke.from(e.headers).normalize();let a,o,{responseType:s,withXSRFToken:u}=e;function c(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}if(G.isFormData(r))if(me.hasStandardBrowserEnv||me.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if(!1!==(o=i.getContentType())){const[e,...t]=o?o.split(";").map((e=>e.trim())).filter(Boolean):[];i.setContentType([e||"multipart/form-data",...t].join("; "))}let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const h=Ee(e.baseURL,e.url);function f(){if(!l)return;const r=ke.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new X("Request failed with status code "+n.status,[X.ERR_BAD_REQUEST,X.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),c()}),(function(e){n(e),c()}),{data:s&&"text"!==s&&"json"!==s?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),ae(h,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=f:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(f)},l.onabort=function(){l&&(n(new X("Request aborted",X.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new X("Network Error",X.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||se;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new X(t,r.clarifyTimeoutError?X.ETIMEDOUT:X.ECONNABORTED,e,l)),l=null},me.hasStandardBrowserEnv&&(u&&G.isFunction(u)&&(u=u(e)),u||!1!==u&&Re(h))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&Ce.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in l&&G.forEach(i.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),G.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),s&&"json"!==s&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",Oe(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",Oe(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{l&&(n(!t||t.type?new Se(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(h);m&&-1===me.protocols.indexOf(m)?n(new X("Unsupported protocol "+m+":",X.ERR_BAD_REQUEST,e)):l.send(r||null)}))}};G.forEach(De,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Pe=e=>`- ${e}`,Be=e=>G.isFunction(e)||null===e||!1===e;var Fe=e=>{e=G.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let a=0;a<t;a++){let t;if(n=e[a],r=n,!Be(n)&&(r=De[(t=String(n)).toLowerCase()],void 0===r))throw new X(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+a]=r}if(!r){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(Pe).join("\n"):" "+Pe(e[0]):"as no adapter specified";throw new X("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Ne(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Se(null,e)}function Le(e){Ne(e),e.headers=ke.from(e.headers),e.data=we.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Fe(e.adapter||ve.adapter)(e).then((function(t){return Ne(e),t.data=we.call(e,e.transformResponse,t),t.headers=ke.from(t.headers),t}),(function(t){return Te(t)||(Ne(e),t&&t.response&&(t.response.data=we.call(e,e.transformResponse,t.response),t.response.headers=ke.from(t.response.headers))),Promise.reject(t)}))}const je=e=>e instanceof ke?{...e}:e;function Ue(e,t){t=t||{};const n={};function r(e,t,n){return G.isPlainObject(e)&&G.isPlainObject(t)?G.merge.call({caseless:n},e,t):G.isPlainObject(t)?G.merge({},t):G.isArray(t)?t.slice():t}function i(e,t,n){return G.isUndefined(t)?G.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function a(e,t){if(!G.isUndefined(t))return r(void 0,t)}function o(e,t){return G.isUndefined(t)?G.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,a){return a in t?r(n,i):a in e?r(void 0,n):void 0}const u={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i(je(e),je(t),!0)};return G.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=u[r]||i,o=a(e[r],t[r],r);G.isUndefined(o)&&a!==s||(n[r]=o)})),n}const Ve="1.6.8",ze={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ze[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const He={};ze.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.8] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,a)=>{if(!1===e)throw new X(r(i," has been removed"+(t?" in "+t:"")),X.ERR_DEPRECATED);return t&&!He[i]&&(He[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var Ge={assertOptions:function(e,t,n){if("object"!=typeof e)throw new X("options must be an object",X.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new X("option "+a+" must be "+n,X.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new X("Unknown option "+a,X.ERR_BAD_OPTION)}},validators:ze};const qe=Ge.validators;class We{constructor(e){this.defaults=e,this.interceptors={request:new oe,response:new oe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ue(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Ge.assertOptions(n,{silentJSONParsing:qe.transitional(qe.boolean),forcedJSONParsing:qe.transitional(qe.boolean),clarifyTimeoutError:qe.transitional(qe.boolean)},!1),null!=r&&(G.isFunction(r)?t.paramsSerializer={serialize:r}:Ge.assertOptions(r,{encode:qe.function,serialize:qe.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&G.merge(i.common,i[t.method]);i&&G.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=ke.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let l,h=0;if(!s){const e=[Le.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,u),l=e.length,c=Promise.resolve(t);h<l;)c=c.then(e[h++],e[h++]);return c}l=o.length;let f=t;for(h=0;h<l;){const e=o[h++],t=o[h++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=Le.call(this,f)}catch(e){return Promise.reject(e)}for(h=0,l=u.length;h<l;)c=c.then(u[h++],u[h++]);return c}getUri(e){return ae(Ee((e=Ue(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}G.forEach(["delete","get","head","options"],(function(e){We.prototype[e]=function(t,n){return this.request(Ue(n||{},{method:e,url:t,data:(n||{}).data}))}})),G.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(Ue(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}We.prototype[e]=t(),We.prototype[e+"Form"]=t(!0)}));var Ke=We;class Xe{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new Se(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Xe((function(t){e=t})),cancel:e}}}var Ye=Xe;const $e={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries($e).forEach((([e,t])=>{$e[t]=e}));var Ze=$e;const Qe=function e(t){const n=new Ke(t),r=l(Ke.prototype.request,n);return G.extend(r,Ke.prototype,n,{allOwnKeys:!0}),G.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ue(t,n))},r}(ve);Qe.Axios=Ke,Qe.CanceledError=Se,Qe.CancelToken=Ye,Qe.isCancel=Te,Qe.VERSION=Ve,Qe.toFormData=J,Qe.AxiosError=X,Qe.Cancel=Qe.CanceledError,Qe.all=function(e){return Promise.all(e)},Qe.spread=function(e){return function(t){return e.apply(null,t)}},Qe.isAxiosError=function(e){return G.isObject(e)&&!0===e.isAxiosError},Qe.mergeConfig=Ue,Qe.AxiosHeaders=ke,Qe.formToJSON=e=>pe(G.isHTMLForm(e)?new FormData(e):e),Qe.getAdapter=Fe,Qe.HttpStatusCode=Ze,Qe.default=Qe;var Je=Qe,et=n(11454),tt=n(27291),nt=n(40537),rt=n(63805),it=function(){return(0,o.A)((function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,a.A)(this,e),(0,s.A)(this,"tokenChanged",new tt.B),(0,s.A)(this,"refreshTokenChanged",new tt.B),(0,s.A)(this,"mAxiosInstance",void 0),(0,s.A)(this,"isRefreshing",!1),(0,s.A)(this,"mRefreshSubscribers",[]),(0,s.A)(this,"mToken",null),(0,s.A)(this,"mRefreshToken",null),(0,s.A)(this,"mAcceptLanguage",void 0),(0,s.A)(this,"mCountry",void 0),(0,s.A)(this,"mCurrency",void 0),this.mAxiosInstance=Je.create({baseURL:et.w.apiUrl}),n||this.mAxiosInstance.interceptors.response.use((function(e){return e}),function(){var e=(0,i.A)(c().mark((function e(n){var r,i,a;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="-1",n&&n.response&&n.response.status&&(r=n.response.status),i=n.config,rt.UX.warn("httpservice rejected"),null===t.mRefreshToken||"401"!=r&&"403"!=r){e.next=10;break}return t.isRefreshing||t._refreshAccessToken().then((function(e){rt.UX.print("token refreshed: ",e)}),(function(e){rt.UX.print("Failed to refresh token: ",e)})),a=new Promise((function(e,n){t._subscribeTokenRefresh((function(t){i.headers.Authorization="Bearer "+t,e(Je(i))}),(function(e){n(e)}))})),e.abrupt("return",a);case 10:return e.abrupt("return",Promise.reject(n));case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}),[{key:"getHttpInstance",value:function(){return this.mAxiosInstance}},{key:"_refreshAccessToken",value:(h=(0,i.A)(c().mark((function e(){var t=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isRefreshing=!0,e.abrupt("return",new Promise((function(e,n){if(!t.mRefreshToken)return t.isRefreshing=!1,t._onFailedRefresh("Missing refresh token"),n("Not logged in");var r=t.mRefreshToken;Je({method:"post",url:et.w.authUrl,data:{grant_type:"refresh_token",refresh_token:r,scope:"read-write"}}).then((function(n){t.isRefreshing=!1;var r=n.data;t.setToken(r.access_token),t.mRefreshToken=r.refresh_token,t.tokenChanged.next(t.mToken),t.refreshTokenChanged.next(t.mRefreshToken),t._onRrefreshed(r.access_token),e(r.access_token)}),(function(e){t.isRefreshing=!1,t._onFailedRefresh(e),n(e)}))})));case 2:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"_subscribeTokenRefresh",value:function(e,t){this.mRefreshSubscribers.push({resolve:e,reject:t})}},{key:"_onRrefreshed",value:function(e){this.mRefreshSubscribers.splice(0,this.mRefreshSubscribers.length).map((function(t){t.resolve(e)}))}},{key:"_onFailedRefresh",value:function(e){this.mRefreshSubscribers.splice(0,this.mRefreshSubscribers.length).map((function(t){!(0,nt.isNullOrUndefined)(t.reject)&&(0,nt.isFunction)(t.reject)&&t.reject(e)}))}},{key:"setToken",value:function(e){this.mToken=e,this.mAxiosInstance.defaults.headers.common.Authorization="Bearer "+e}},{key:"setRefreshToken",value:function(e){this.mRefreshToken=e}},{key:"getAcceptLanguage",value:function(){return this.mAcceptLanguage}},{key:"getCountry",value:function(){return this.mCountry}},{key:"getCurrency",value:function(){return this.mCurrency}},{key:"setAcceptLanguage",value:function(e){!(0,nt.isNullOrUndefined)(e)&&/^[a-zA-Z]{2}(-[A-Z]{2})?$/.test(e)&&(this.mAcceptLanguage=e,this.mAxiosInstance.defaults.headers.common["Accept-Language"]=this.mAcceptLanguage,rt.UX.print("language changed to "+this.mAcceptLanguage))}},{key:"setCountry",value:function(e){(0,nt.isNullOrUndefined)(e)||2!==e.length?(0,nt.isNullOrUndefined)(e)||2===e.length||rt.UX.warn("Can not set country code. Invalid code provided:",e):(this.mCountry=e,this.mAxiosInstance.defaults.headers.common["Locale-Country"]=this.mCountry,rt.UX.print("country changed to "+this.mCountry))}},{key:"setCurrency",value:function(e){this.mCurrency=e,this.mAxiosInstance.defaults.headers.common.currency=this.mCurrency,rt.UX.print("currency changed to "+this.mCurrency)}},{key:"get",value:(l=(0,i.A)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mAxiosInstance.get(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"delete",value:(u=(0,i.A)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mAxiosInstance.delete(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"post",value:(r=(0,i.A)(c().mark((function e(t,n,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mAxiosInstance.post(t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"put",value:(n=(0,i.A)(c().mark((function e(t,n,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mAxiosInstance.put(t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"patch",value:(t=(0,i.A)(c().mark((function e(t,n,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mAxiosInstance.patch(t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"head",value:(e=(0,i.A)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mAxiosInstance.head(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(t,n){return e.apply(this,arguments)})}],[{key:"getInstance",value:function(){return null===this._instance&&(this._instance=new this(!1)),this._instance}},{key:"uniqueInstance",value:function(){return new this(!0)}}]);var e,t,n,r,u,l,h}();(0,s.A)(it,"_instance",null)},65638:function(e,t,n){"use strict";n.d(t,{m:function(){return M}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=n(54756),u=n.n(s),c=(n(16280),n(28706),n(2008),n(48598),n(62062),n(79432),n(26099),n(3362),n(74648),n(17333),n(9920),n(41393),n(8159),n(98992),n(23215),n(54520),n(3949),n(81454),n(37550),n(23500),n(13288)),l=n(39741),h=n(62467),f=n(45650),m=n(38975),p=n(66847),d=n(81160),v=n(74461),y=n(67138),g=n(11454),b=n(12164),A=n(3216),_=n(63805),M=function(){function e(){(0,i.A)(this,e),(0,o.A)(this,"mModels",{}),(0,o.A)(this,"mMaterialLoaders",{}),(0,o.A)(this,"mDependencyLoaders",{})}return(0,a.A)(e,[{key:"resolveModel",value:(k=(0,r.A)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v.N5.isNumeric(t)&&!(t<0)){e.next=2;break}throw new Error("requested id is not an integer: ".concat(t));case 2:if(!(t in this.mModels)){e.next=4;break}return e.abrupt("return",this.mModels[t]);case 4:return e.next=6,this.finishDependencies();case 6:return e.abrupt("return",this._getModelFromAPI(t));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"resolveModels",value:(M=(0,r.A)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.map((function(e){return v.N5.isNumeric(e)&&e>0})).some((function(e){return!e}))){e.next=2;break}throw new Error("Requested list contains non-numeric values: ".concat(t.join(", ")));case 2:return e.next=4,this.finishDependencies();case 4:return e.abrupt("return",this._getModelsFromAPI(t));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return M.apply(this,arguments)})},{key:"preloadCatalogue",value:function(e){var t=this,n=v.N5.isNumeric(e)?parseInt("".concat(e),10):null;return null===n?(0,c.$)((function(){return new Error("Catalogue id is not an ID")})):this.mDependencyLoaders[n]?this.mDependencyLoaders[n]:(this.mDependencyLoaders[n]=new l.m(1),_.UX.print("Material resolving bootstrap data for:",e),void A._.getInstance().resolveBootstrapData(n).pipe((0,m.s)(1)).subscribe({next:function(e){var r=b.eE.getItems(e.getMaterials());r.forEach((function(e){t.mModels[e.id]=e})),_.UX.print("Bootstrap materials preloaded:",r),t.mDependencyLoaders[n].next(!0),t.mDependencyLoaders[n].complete()},error:function(e){_.UX.warn("Bootstrap material pre load failed:",e),t.mDependencyLoaders[n].error(e),delete t.mDependencyLoaders[n]}}))}},{key:"resetCache",value:function(){return this.disposeCacheLoader(),this.mModels={},this}},{key:"finishDependencies",value:(s=(0,r.A)(u().mark((function e(){var t=this;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=Object.keys(t.mDependencyLoaders).map((function(e){return t.mDependencyLoaders[e].pipe((0,p.W)((function(){return(0,h.of)([])})))}));if(0===r.length)return e(!0);_.UX.print("Material bootstrap dependencies:",r),(0,f.p)(r).pipe((0,d.T)((function(e){return e.every((function(e){return e}))}))).subscribe({next:function(t){_.UX.print("Material dependency finished!",t),e(t)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return s.apply(this,arguments)})},{key:"_getModelFromAPI",value:(n=(0,r.A)(u().mark((function e(t){var n=this;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){if(t in n.mModels)return e(n.mModels[t]);t in n.mMaterialLoaders||(n.mMaterialLoaders[t]=new l.m(1),y.k.getInstance().get(g.w.makeApiRoute("material/".concat(t))).then((function(e){n.mMaterialLoaders[t].next(b.eE.getItem(e.data)),n.mMaterialLoaders[t].complete()}),(function(e){n.mMaterialLoaders[t].error(e)}))),n.mMaterialLoaders[t].pipe((0,m.s)(1)).subscribe({next:function(r){n.mModels[t]=r,e(r)},error:function(e){delete n.mMaterialLoaders[t],r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"_getModelsFromAPI",value:(t=(0,r.A)(u().mark((function e(t){var n=this;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=t.map((function(e){return e in n.mModels?n.mModels[e]:e})),a=i.filter((function(e){return"number"!=typeof e})),o=i.filter((function(e){return"number"==typeof e}));if(0===o.length)return e(a);y.k.getInstance().get("".concat(g.w.apiUrl,"material?id=").concat(o.join("|"))).then((function(e){var t=b.eE.getItems(e.data);return t.forEach((function(e){n.mModels[e.id]=e})),t}),(function(){return[]})).then((function(t){e(a.concat(t))}),(function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"disposeCacheLoader",value:function(){var e=this;Object.keys(this.mMaterialLoaders).forEach((function(t){e.mMaterialLoaders[t].error("disposed"),delete e.mMaterialLoaders[t]})),Object.keys(this.mDependencyLoaders).forEach((function(t){e.mDependencyLoaders[t].error("disposed"),delete e.mDependencyLoaders[t]}))}}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}]);var t,n,s,M,k}();(0,o.A)(M,"sInstance",void 0)},62112:function(e,t,n){"use strict";n.d(t,{u:function(){return _}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=n(54756),u=n.n(s),c=(n(16280),n(62062),n(79432),n(26099),n(3362),n(74648),n(9920),n(41393),n(98992),n(23215),n(3949),n(81454),n(23500),n(13288)),l=n(39741),h=n(62467),f=n(45650),m=n(38975),p=n(66847),d=n(81160),v=n(74461),y=n(67138),g=n(11454),b=n(12164),A=n(3216),_=function(){function e(){(0,i.A)(this,e),(0,o.A)(this,"mModels",{}),(0,o.A)(this,"mMediaLoaders",{}),(0,o.A)(this,"mDependencyLoaders",{})}return(0,a.A)(e,[{key:"resolveModel",value:(s=(0,r.A)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v.N5.isNumeric(t)){e.next=2;break}throw new Error("requested id is not an integer: ".concat(t));case 2:if(!(t in this.mModels)){e.next=4;break}return e.abrupt("return",this.mModels[t]);case 4:return e.next=6,this.finishDependencies();case 6:return e.abrupt("return",this._getModelFromAPI(t));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"preloadCatalogue",value:function(e){var t=this,n=v.N5.isNumeric(e)?parseInt("".concat(e),10):null;return null===n?(0,c.$)((function(){return new Error("Catalogue id is not an ID")})):this.mDependencyLoaders[n]?this.mDependencyLoaders[n]:(this.mDependencyLoaders[n]=new l.m(1),void A._.getInstance().resolveBootstrapData(n).pipe((0,m.s)(1)).subscribe({next:function(e){b.eE.getItems(e.getMedia()).forEach((function(e){t.mModels[e.id]=e})),t.mDependencyLoaders[n].next(!0),t.mDependencyLoaders[n].complete()},error:function(e){t.mDependencyLoaders[n].error(e),delete t.mDependencyLoaders[n]}}))}},{key:"resetCache",value:function(){return this.disposeCacheLoader(),this.mModels={},this}},{key:"finishDependencies",value:(n=(0,r.A)(u().mark((function e(){var t=this;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=Object.keys(t.mDependencyLoaders).map((function(e){return t.mDependencyLoaders[e].pipe((0,p.W)((function(){return(0,h.of)([])})))}));if(0===r.length)return e(!0);(0,f.p)(r).pipe((0,d.T)((function(e){return e.every((function(e){return e}))}))).subscribe({next:function(t){e(t)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"_getModelFromAPI",value:(t=(0,r.A)(u().mark((function e(t){var n=this;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){if(t in n.mModels)return e(n.mModels[t]);t in n.mMediaLoaders||(n.mMediaLoaders[t]=new l.m(1),y.k.getInstance().get(g.w.makeApiRoute("media/".concat(t))).then((function(e){n.mMediaLoaders[t].next(b.eE.getItem(e.data)),n.mMediaLoaders[t].complete()})).catch((function(e){n.mMediaLoaders[t].error(e)}))),n.mMediaLoaders[t].pipe((0,m.s)(1)).subscribe({next:function(r){n.mModels[t]=r,e(r)},error:function(e){delete n.mMediaLoaders[t],r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"disposeCacheLoader",value:function(){var e=this;Object.keys(this.mMediaLoaders).forEach((function(t){e.mMediaLoaders[t].error("disposed"),delete e.mMediaLoaders[t]})),Object.keys(this.mDependencyLoaders).forEach((function(t){e.mDependencyLoaders[t].error("disposed"),delete e.mDependencyLoaders[t]}))}}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}]);var t,n,s}();(0,o.A)(_,"sInstance",void 0)},49053:function(e,t,n){"use strict";n.d(t,{R:function(){return p}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=n(54756),u=n.n(s),c=(n(16280),n(23792),n(79432),n(26099),n(38781),n(47764),n(9920),n(98992),n(3949),n(23500),n(62953),n(3296),n(27208),n(48408),n(98721),n(39741)),l=n(59452),h=n(67138),f=n(11454),m=n(63805),p=function(){function e(){(0,i.A)(this,e),(0,o.A)(this,"mLoader",{})}return(0,a.A)(e,[{key:"resetCache",value:function(){return this.disposeCacheLoader(),this}},{key:"disposeCacheLoader",value:function(){var e=this;Object.keys(this.mLoader).forEach((function(t){e.mLoader[t]&&e.mLoader[t].error("disposed")})),this.mLoader={}}},{key:"getSessionId",value:function(e){if(!(0,l.t)())return null;var t="$$__xpv__product_session_".concat(e);return window.sessionStorage.getItem(t)}},{key:"setSessionId",value:function(e,t){if((0,l.t)()){var n="$$__xpv__product_session_".concat(e);sessionStorage.setItem(n,t)}}},{key:"requestMeta",value:(t=(0,r.A)(u().mark((function e(t,n){var r,i,a,o,s,c,l;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.getSessionId(t),a={},null!=i&&(a["Product-Session-ID"]=i),(o=new URL(f.w.makeApiRoute("catalogue/".concat(t,"/meta")))).searchParams.append("bootstrap_version","2"),n&&o.searchParams.append("revision_hash",n),e.next=8,h.k.getInstance().get(o.toString(),{headers:a});case 8:if((s=e.sent).data){e.next=11;break}throw new Error("No data has been returned");case 11:return void 0!==(c=s.headers["Product-Session-ID"])&&this.setSessionId(t,c),(l=null!==(r=s.data)&&void 0!==r?r:{}).version_hash=n,m.UX.print("Loaded settings meta:",l),e.abrupt("return",l);case 17:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"resolveMeta",value:function(e,t){var n=this;return this.mLoader[e]||(this.mLoader[e]=new c.m(1),this.requestMeta(e,t).then((function(t){n.mLoader[e].next(t),n.mLoader[e].complete()})).catch((function(t){n.mLoader[e].error(t),delete n.mLoader[e]}))),this.mLoader[e]}}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}]);var t}();(0,o.A)(p,"sInstance",void 0)},63805:function(e,t,n){"use strict";n.d(t,{UX:function(){return u}});var r=n(11454),i=Function.prototype.bind?Function.prototype.bind.call(console.log,console):function(){Function.prototype.apply.call(console.debug,console,arguments)},a=r.w.productionBuild?function(){}:Function.prototype.bind?Function.prototype.bind.call(console.log,console):function(){Function.prototype.apply.call(console.log,console,arguments)},o=r.w.productionBuild?function(){}:Function.prototype.bind?Function.prototype.bind.call(console.warn,console):function(){Function.prototype.apply.call(console.warn,console,arguments)},s=Function.prototype.bind?Function.prototype.bind.call(console.warn,console):function(){Function.prototype.apply.call(console.warn,console,arguments)},u={info:i,print:a,warn:o,error:s}},12164:function(e,t,n){"use strict";n.d(t,{eE:function(){return o}});n(2008),n(50113),n(48598),n(62062),n(2892),n(79432),n(26099),n(27495),n(90744),n(17333),n(3064),n(9920),n(41393),n(98992),n(54520),n(72577),n(3949),n(81454),n(23500);var r=n(40537);function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:4,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if((0,r.isNullOrUndefined)(e))return null;var s=e.attributes,u=e.relationships||{};return Object.keys(u).forEach((function(e){var c=e;n&&(c=c.split(/(?=[A-Z])/).map((function(e){return e.toLowerCase()})).join("_"));var l=Array.isArray(u[e].data),h=l?u[e].data:[u[e].data],f=void 0!==o[e]?o[e]:c;s[f]=h.map((function(e){var s=t.find((function(t){return t.id===e.id&&t.type===e.type}));return(0,r.isUndefined)(s)?null:a<=0?s.attributes:i(s,t,n,a-1,o)})).filter((function(e){return!(0,r.isNullOrUndefined)(e)})),l||(s[f]=s[f][0])})),s}function a(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if((0,r.isNullOrUndefined)(e)||(0,r.isNullOrUndefined)(e.data))return null;var o=(0,r.isNullOrUndefined)(e.included)?[]:e.included;return Array.isArray(e.data)?e.data.map((function(e){return i(e,o,t,n,a)})):i(e.data,o,t,n,a)}var o={getItems:function(e){return(0,r.isUndefined)(e.data)?[]:e.data.map((function(e){return e.attributes}))},getItem:function(e){if(!(0,r.isUndefined)(e.data))return e.data.attributes},getIncludedItems:function(e,t){return(0,r.isUndefined)(e.included)?[]:e.included.filter((function(e){return e.type===t})).map((function(e){return e.attributes}))},getItemsWithRelations:function(e){return a(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{})},hydrateResponse:a,getIncludedItemsWithRelations:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if((0,r.isUndefined)(e.included))return[];var a=e.included||[];return a.map((function(e){if(e.type===t){var o=e.attributes||[],s=e.relationships||{};return Object.keys(s).forEach((function(t){var s=t;n&&(s=t.split(/(?=[A-Z])/).map((function(e){return e.toLowerCase()})).join("_"));var u=void 0!==i[t]?i[t]:s;o[u]=e.relationships[t].data.map((function(e){var t=a.find((function(t){return t.id===e.id&&t.type===e.type}));return(0,r.isUndefined)(t)?null:t.attributes})).filter((function(e){return!(0,r.isNullOrUndefined)(e)}))})),o}})).filter((function(e){return!(0,r.isNullOrUndefined)(e)}))},getMetaCursor:function(e){return(0,r.isUndefined)(e.meta.cursor)?0:Number(e.meta.cursor.current)},getMetaTotalCount:function(e){if(!(0,r.isUndefined)(e.meta.total_count))return e.meta.total_count}}},59452:function(e,t,n){"use strict";function r(){try{if(window.location.href===window.parent.location.href)return!1}catch(e){}return!0}function i(){try{return window.sessionStorage.getItem("foo"),!0}catch(e){return!1}}n.d(t,{GZ:function(){return r},t:function(){return i}})},49571:function(e,t,n){"use strict";n.d(t,{V:function(){return u}});var r=n(23029),i=n(92901),a=(n(23792),n(54743),n(2892),n(26099),n(27495),n(90906),n(38781),n(25440),n(21489),n(48140),n(81630),n(72170),n(75044),n(69539),n(31694),n(89955),n(21903),n(91134),n(33206),n(44496),n(66651),n(12887),n(19369),n(66812),n(8995),n(31575),n(36072),n(88747),n(28845),n(29423),n(57301),n(373),n(86614),n(41405),n(37467),n(44732),n(33684),n(79577),n(26280),n(27913),n(47801),n(47350),n(23241),n(67302),n(55871),n(40537)),o=n(61070),s=window.crypto||window.msCrypto,u=function(){return(0,i.A)((function e(){(0,r.A)(this,e)}),null,[{key:"guid",value:function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}},{key:"uuidV4",value:function(){return s?"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(function(e){return(Number(e)^s.getRandomValues(new Uint8Array(1))[0]&15>>Number(e)/4).toString(16)})):"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}},{key:"isUUID",value:function(e){return!(0,a.isNullOrUndefined)(e)&&/(.*)-(.*)-(.*)/.test(e)}},{key:"Md5",value:function(e){return o.V.hashStr(e).toString()}},{key:"checksum",value:function(e){var t,n=0;if(0===e.length)return n;for(t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n}},{key:"encrypt",value:function(e,t){for(var n="",r=0;r<e.length;r++){var i=(e.charCodeAt(r)^t.charCodeAt(r%t.length)).toString(16);i.length<2&&(i="0"+i),n+=i}return n}},{key:"decrypt",value:function(e,t){for(var n="",r=0;r<e.length;r+=2){var i=e.substring(r,r+2),a=parseInt(i,16),o=t.charCodeAt(r/2%t.length);n+=String.fromCharCode(a^o)}return n}}])}()},32221:function(e,t,n){"use strict";n.d(t,{N:function(){return u}});var r=n(10467),i=n(23029),a=n(92901),o=n(54756),s=n.n(o),u=(n(23792),n(62062),n(44114),n(26099),n(3362),n(96167),n(47764),n(41393),n(81454),n(62953),function(){return(0,a.A)((function e(){(0,i.A)(this,e)}),null,[{key:"resolveArray",value:function(e,t){var n=this,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(0!==e.length){var i=e.shift();Promise.resolve("function"==typeof i?i():i).then((function(){n.resolveArray(e,t,r)})).catch((function(){n.resolveArray(e,t,!1)}))}else t(r)}},{key:"resolveAll",value:function(e,t){if(0!==e.length){var n=e.map(function(){var e=(0,r.A)(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="function"==typeof t?t():t,e.abrupt("return",n instanceof Promise?n:Promise.resolve(n));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());Promise.allSettled(n).then((function(){t(!0)})).catch((function(){t(!1)}))}else t(!0)}},{key:"executeInOrder",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Array,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Array;if(0===e.length||r&&a.length>0)t(i,a);else{var o=e.shift();try{Promise.resolve(o()).then((function(o){i.push(o),n.executeInOrder(e,t,r,i,a)})).catch((function(o){a.push(o),n.executeInOrder(e,t,r,i,a)}))}catch(n){a.push(n),this.executeInOrder(e,t,r,i,a)}}}},{key:"completePromise",value:(e=(0,r.A)(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){Promise.resolve(t).then((function(t){e(t)})).catch((function(){e(void 0)}))})));case 1:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)})}]);var e}())},17450:function(e,t,n){"use strict";n.d(t,{L:function(){return l}});var r=n(88483),i=n(15964);var a=n(27291),o=n(37968),s=n(49184),u=n(81080),c=n(92908);function l(e){return function(t){return n=function(){var n=new a.B;return t.pipe((0,s.n)((function(){return n}),{leading:!0,trailing:!0}),(0,u.p)((function(t,r){return(0,o.H)(e(t,r)).pipe((i=function(){return n.next()},(0,c.N)((function(e,t){try{e.subscribe(t)}finally{t.add(i)}}))));var i})))},new r.c((function(e){(0,i.Tg)(n()).subscribe(e)}));var n}}},38685:function(e,t,n){"use strict";n.d(t,{A:function(){return c}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=n(54756),u=n.n(s),c=(n(23792),n(26099),n(3362),n(27495),n(47764),n(5746),n(62953),n(3296),n(27208),n(48408),n(98721),function(){function e(){(0,i.A)(this,e)}return(0,a.A)(e,null,[{key:"loadScript",value:(t=(0,r.A)(u().mark((function t(n){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n in e.scriptPromises)){t.next=2;break}return t.abrupt("return",e.scriptPromises[n]);case 2:return e.scriptPromises[n]=new Promise((function(e){var t=document.createElement("script");t.crossOrigin="anonymous";var r=function(){e()};if(t.readyState){var i=t;i.onreadystatechange=function(){"loaded"!==i.readyState&&"complete"!==i.readyState||(i.onreadystatechange=null,r())}}else t.onload=r;t.src=n,document.head.appendChild(t)})),t.abrupt("return",e.scriptPromises[n]);case 4:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})},{key:"getHost",value:function(){var e,t=document.location.origin,n="";if(null!==(e=window.expivi)&&void 0!==e&&e.currentScript){var r=window.expivi.currentScript.src;t=r.substring(0,r.lastIndexOf("/")),n=new URL(r).search}return{origin:t,params:n}}}]);var t}());(0,o.A)(c,"scriptPromises",{})},83629:function(e,t,n){"use strict";n.d(t,{Q:function(){return s}});var r=n(23029),i=n(92901),a=n(64467),o=n(49571),s=function(){function e(){(0,r.A)(this,e),(0,a.A)(this,"mHash",void 0),this.newHash()}return(0,i.A)(e,[{key:"getHash",value:function(){return this.mHash}},{key:"newHash",value:function(){return this.mHash=o.V.guid()+String(e._gid_count++),this.mHash}},{key:"copy",value:function(e){this.mHash=e.mHash}},{key:"isSame",value:function(e){return this.mHash===e.mHash}}])}();(0,a.A)(s,"_gid_count",1)},74461:function(e,t,n){"use strict";n.d(t,{$D:function(){return T},D9:function(){return b},GI:function(){return A},Gi:function(){return w},Gz:function(){return h},HP:function(){return k},Hn:function(){return u},Kg:function(){return c},N5:function(){return x},QE:function(){return M},XD:function(){return _},bk:function(){return f},fL:function(){return s},hX:function(){return y},kf:function(){return o},ms:function(){return v},nC:function(){return p},qO:function(){return d},uI:function(){return l},yA:function(){return m}});var r=n(64467),i=n(82284),a=(n(16280),n(28706),n(74423),n(23792),n(48598),n(62062),n(34782),n(54554),n(2892),n(40150),n(69085),n(79432),n(26099),n(27495),n(90906),n(38781),n(21699),n(47764),n(71761),n(68156),n(25440),n(42762),n(9920),n(41393),n(98992),n(3949),n(81454),n(23500),n(62953),n(3296),n(27208),n(48408),n(98721),n(49571));function o(e){return null!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function s(e){for(var t="",n=!1,r=0;r<e.length;r++)"_"!==e.charAt(r)?(t+=n?e.charAt(r).toUpperCase():e.charAt(r),n=!1):n=!0;return t}function u(e){return!0===e||"1"==e||"true"===e}function c(e){return e&&"string"==typeof e}function l(e){return"string"==typeof e&&e.length>0}function h(e){if(!e)return!1;try{if("data:"===new window.URL(e).protocol)throw new Error("Base64 url")}catch(e){return!1}return!0}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"uhash";if(!l(e)||!h(e))return e;var n=new window.URL(e);return n.searchParams.set(t,"".concat(Date.now())),n.href}function m(e){if(null!=e){var t=parseInt("".concat(e),10);return isNaN(t)?void 0:t}}function p(e){if(null!=e){var t=parseFloat("".concat(e));return isNaN(t)?void 0:t}}function d(e){if(null!=e)return a.V.isUUID("".concat(e))?String(e):void 0}function v(e){if(null!=e){if("string"==typeof e&&a.V.isUUID(e))return e;var t=parseInt("".concat(e),10);return Number.isNaN(t)?void 0:t}}function y(e){return null==e}function g(e){return e&&"object"===(0,i.A)(e)&&!Array.isArray(e)}function b(e,t){var n=Object.assign({},e);return g(e)&&g(t)&&Object.keys(t).forEach((function(i){g(t[i])&&i in e?n[i]=b(e[i],t[i]):Object.assign(n,(0,r.A)({},i,t[i]))})),n}function A(e,t){var n=t.split("."),r=function(e,t){var n=e[t.shift()];return t.length?r(n||{},t):n};return r(e,n)}function _(e){var t=e.split(".");return 1===t.length?t.join(""):t.splice(0,t.length-1).join(".")}function M(e){return e.includes(".")}function k(e){var t=e.split(".");return t[t.length-1]}function w(e,t,n){var r=t.split("."),i=function(e,t,n){var r=t.shift();if(t.length)return e[r]=e[r]||{},void i(e[r],t,n);e[r]=n};i(e,r,n)}function T(e){if(!e)return!1;if(h(e))try{var t=new window.URL(e);return/\.(svg)$/gm.test(t.pathname)}catch(e){return!1}return e.slice(0,19).includes("image/svg")}var x={isNumeric:o,lowerCaseString:function(e){return null===e?null:void 0===e?e:e.toLowerCase()},convertSnakeToCamel:s,isTrue:u,isString:c,isNonEmptyString:l,isValidURL:h,isBase64:function(e){if(!e)return!1;try{if("data:"===new window.URL(e).protocol)return!0}catch(e){return!1}return!1},makeUrlUnique:f,isArray:function(e){return e&&"[object Array]"===Object.prototype.toString.call(e)},deepCloneJSON:function e(t){if("object"!==(0,i.A)(t)||null===t)return t;if(t instanceof Number)return Number(t);if(t instanceof Boolean)return Boolean(t);if(t instanceof String)return String(t);if(Array.isArray(t))return t.map((function(t){return e(t)}));var n={};return Object.keys(t).forEach((function(r){n[r]=e(t[r])})),n},stringToDate:function(e){if(!isNaN(Date.parse(e)))return new Date(e);var t=e.trim().replace(/[/\\]/g,"-");return t.length>10&&(t.includes("T")||(t=t.replace(/\s/g,"T")),t.includes("+")||t.match(/T.*Z$/g)||(t+="Z")),new Date(t)},resolveInt:m,resolveFloat:p,resolveUuid:d,resolveUuidOrId:v,isNullOrUndefined:y,isObject:g,mergeDeep:b,dateToString:function(e){if(e){var t=e.getFullYear().toString(),n=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getDate().toString().padStart(2,"0"),i=e.getHours().toString().padStart(2,"0"),a=e.getMinutes().toString().padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r," ").concat(i,":").concat(a,":00")}},getFlatKeyValue:A,setFlatKeyValue:w,isSvg:T}},85121:function(e,t,n){"use strict";n.d(t,{c:function(){return h}});n(2892);var r,i,a,o,s,u,c,l=n(65606),h={client_id:Number(null!==null?null:0),client_secret:null,production:!0,environment:null!==(r="production")?r:"production",maxBunchSize:500,searchBunchSize:10,stripeKey:null,kioskUrl:"kiosk_yu9se",protocol:null!==(i="https://")?i:"https://",api:null!==(a="https://expivi.net")?a:"https://expivi.net",admin:null!==(o="https://admin.expivi.net")?o:"https://admin.expivi.net",cache:null!==(s="https://cache.expivi.net")?s:"https://cache.expivi.net",storage:null!==(u="https://data.expivi.net")?u:"https://data.expivi.net",assets:null!==(c=l.env.NG_ASSETS_URL)&&void 0!==c?c:"https://assets.expivi.net"}},38075:function(e,t,n){"use strict";var r=n(70453),i=n(10487),a=i(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&a(e,".prototype.")>-1?i(n):n}},10487:function(e,t,n){"use strict";var r=n(66743),i=n(70453),a=n(96897),o=n(69675),s=i("%Function.prototype.apply%"),u=i("%Function.prototype.call%"),c=i("%Reflect.apply%",!0)||r.call(u,s),l=n(30655),h=i("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new o("a function is required");var t=c(r,u,arguments);return a(t,1+h(0,e.length-(arguments.length-1)),!0)};var f=function(){return c(r,s,arguments)};l?l(e.exports,"apply",{value:f}):e.exports.apply=f},30041:function(e,t,n){"use strict";var r=n(30655),i=n(58068),a=n(69675),o=n(75795);e.exports=function(e,t,n){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],h=!!o&&o(e,t);if(r)r(e,t,{configurable:null===c&&h?h.configurable:!c,enumerable:null===s&&h?h.enumerable:!s,value:n,writable:null===u&&h?h.writable:!u});else{if(!l&&(s||u||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=n}}},41877:function(e,t,n){e.exports=n(27665)},27665:function(e){function t(e){var t=this;if(this._HSLtoRGB=function(e,t,n){var r,i,a,o,s,u;if((e<=0||isNaN(e))&&(e=0),(t<=0||isNaN(t))&&(t=0),(n<=0||isNaN(n))&&(n=0),e>360&&(e=360),t>100&&(t=100),n>100&&(n=100),n/=100,0==(t/=100))o=s=u=255*n;else{function c(e,t,n){return n<0?n+=1:n>1&&(n-=1),255*(6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e)}o=c(r=2*n-(i=n<=.5?n*(t+1):n+t-n*t),i,(a=e/360)+1/3),s=c(r,i,a),u=c(r,i,a-1/3)}return o=Math.round(o),s=Math.round(s),u=Math.round(u),{r:parseInt(o),g:parseInt(s),b:parseInt(u)}},this._RGBtoHSL=function(e,t,n){(e<=0||isNaN(e))&&(e=0),(t<=0||isNaN(t))&&(t=0),(n<=0||isNaN(n))&&(n=0),e>255&&(e=255),t>255&&(t=255),n>255&&(n=255),e/=255,t/=255,n/=255;var r,i,a=Math.max(e,t,n),o=Math.min(e,t,n),s=(a+o)/2;if(a==o)r=i=0;else{var u=a-o;switch(i=s>.5?u/(2-a-o):u/(a+o),a){case e:r=(t-n)/u+(t<n?6:0);break;case t:r=(n-e)/u+2;break;case n:r=(e-t)/u+4}r/=6}return r*=360,i*=100,s*=100,r=Math.round(r),i=Math.round(i),s=Math.round(s),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s,{h:parseFloat(r),s:parseFloat(i),l:parseFloat(s)}},this._CMYKtoRGB=function(e,t,n,r){(e<=0||isNaN(e))&&(e=0),(t<=0||isNaN(t))&&(t=0),(n<=0||isNaN(n))&&(n=0),(r<=0||isNaN(r))&&(r=0),e>100&&(e=100),t>100&&(t=100),n>100&&(n=100),r>100&&(r=100),e/=100,t/=100,n/=100,r/=100;var i=1-Math.min(1,e*(1-r)+r),a=1-Math.min(1,t*(1-r)+r),o=1-Math.min(1,n*(1-r)+r);return i=Math.round(255*i),a=Math.round(255*a),o=Math.round(255*o),{r:parseInt(i),g:parseInt(a),b:parseInt(o)}},this._RGBtoCMYK=function(e,t,n){(e<=0||isNaN(e))&&(e=0),(t<=0||isNaN(t))&&(t=0),(n<=0||isNaN(n))&&(n=0),e>255&&(e=255),t>255&&(t=255),n>255&&(n=255),e/=255,t/=255,n/=255;var r=Math.min(1-e,1-t,1-n),i=(1-e-r)/(1-r),a=(1-t-r)/(1-r),o=(1-n-r)/(1-r);return i=Math.round(100*i),a=Math.round(100*a),o=Math.round(100*o),r=Math.round(100*r),i=isNaN(i)?0:i,a=isNaN(a)?0:a,o=isNaN(o)?0:o,r=isNaN(r)?0:r,{c:parseInt(i),m:parseInt(a),y:parseInt(o),k:parseInt(r)}},this.success=!1,this.rgb={r:0,g:0,b:0},this.hsl={h:0,s:0,l:0},this.cmyk={c:0,m:0,y:0,k:0},this.alpha=1,null!=e){e=(e=(e=e.replace("#","")).replace(/ /g,"")).toLowerCase(),this.CSSColorTable={transparent:"rgba(0,0,0,0)",aliceblue:"rgba(240,248,255,1)",antiquewhite:"rgba(250,235,215,1)",aqua:"rgba(0,255,255,1)",aquamarine:"rgba(127,255,212,1)",azure:"rgba(240,255,255,1)",beige:"rgba(245,245,220,1)",bisque:"rgba(255,228,196,1)",black:"rgba(0,0,0,1)",blanchedalmond:"rgba(255,235,205,1)",blue:"rgba(0,0,255,1)",blueviolet:"rgba(138,43,226,1)",brown:"rgba(165,42,42,1)",burlywood:"rgba(222,184,135,1)",cadetblue:"rgba(95,158,160,1)",chartreuse:"rgba(127,255,0,1)",chocolate:"rgba(210,105,30,1)",coral:"rgba(255,127,80,1)",cornflowerblue:"rgba(100,149,237,1)",cornsilk:"rgba(255,248,220,1)",crimson:"rgba(220,20,60,1)",cyan:"rgba(0,255,255,1)",darkblue:"rgba(0,0,139,1)",darkcyan:"rgba(0,139,139,1)",darkgoldenrod:"rgba(184,134,11,1)",darkgray:"rgba(169,169,169,1)",darkgrey:"rgba(169,169,169,1)",darkgreen:"rgba(0,100,0,1)",darkkhaki:"rgba(189,183,107,1)",darkmagenta:"rgba(139,0,139,1)",darkolivegreen:"rgba(85,107,47,1)",darkorange:"rgba(255,140,0,1)",darkorchid:"rgba(153,50,204,1)",darkred:"rgba(139,0,0,1)",darksalmon:"rgba(233,150,122,1)",darkseagreen:"rgba(143,188,143,1)",darkslateblue:"rgba(72,61,139,1)",darkslategray:"rgba(47,79,79,1)",darkslategrey:"rgba(47,79,79,1)",darkturquoise:"rgba(0,206,209,1)",darkviolet:"rgba(148,0,211,1)",deeppink:"rgba(255,20,147,1)",deepskyblue:"rgba(0,191,255,1)",dimgray:"rgba(105,105,105,1)",dimgrey:"rgba(105,105,105,1)",dodgerblue:"rgba(30,144,255,1)",firebrick:"rgba(178,34,34,1)",floralwhite:"rgba(255,250,240,1)",forestgreen:"rgba(34,139,34,1)",fuchsia:"rgba(255,0,255,1)",gainsboro:"rgba(220,220,220,1)",ghostwhite:"rgba(248,248,255,1)",gold:"rgba(255,215,0,1)",goldenrod:"rgba(218,165,32,1)",gray:"rgba(128,128,128,1)",grey:"rgba(128,128,128,1)",green:"rgba(0,128,0,1)",greenyellow:"rgba(173,255,47,1)",honeydew:"rgba(240,255,240,1)",hotpink:"rgba(255,105,180,1)",indianred:"rgba(205,92,92,1)",indigo:"rgba(75,0,130,1)",ivory:"rgba(255,255,240,1)",khaki:"rgba(240,230,140,1)",lavender:"rgba(230,230,250,1)",lavenderblush:"rgba(255,240,245,1)",lawngreen:"rgba(124,252,0,1)",lemonchiffon:"rgba(255,250,205,1)",lightblue:"rgba(173,216,230,1)",lightcoral:"rgba(240,128,128,1)",lightcyan:"rgba(224,255,255,1)",lightgoldenrodyellow:"rgba(250,250,210,1)",lightgray:"rgba(211,211,211,1)",lightgrey:"rgba(211,211,211,1)",lightgreen:"rgba(144,238,144,1)",lightpink:"rgba(255,182,193,1)",lightsalmon:"rgba(255,160,122,1)",lightseagreen:"rgba(32,178,170,1)",lightskyblue:"rgba(135,206,250,1)",lightslategray:"rgba(119,136,153,1)",lightslategrey:"rgba(119,136,153,1)",lightsteelblue:"rgba(176,196,222,1)",lightyellow:"rgba(255,255,224,1)",lime:"rgba(0,255,0,1)",limegreen:"rgba(50,205,50,1)",linen:"rgba(250,240,230,1)",magenta:"rgba(255,0,255,1)",maroon:"rgba(128,0,0,1)",mediumaquamarine:"rgba(102,205,170,1)",mediumblue:"rgba(0,0,205,1)",mediumorchid:"rgba(186,85,211,1)",mediumpurple:"rgba(147,112,219,1)",mediumseagreen:"rgba(60,179,113,1)",mediumslateblue:"rgba(123,104,238,1)",mediumspringgreen:"rgba(0,250,154,1)",mediumturquoise:"rgba(72,209,204,1)",mediumvioletred:"rgba(199,21,133,1)",midnightblue:"rgba(25,25,112,1)",mintcream:"rgba(245,255,250,1)",mistyrose:"rgba(255,228,225,1)",moccasin:"rgba(255,228,181,1)",navajowhite:"rgba(255,222,173,1)",navy:"rgba(0,0,128,1)",oldlace:"rgba(253,245,230,1)",olive:"rgba(128,128,0,1)",olivedrab:"rgba(107,142,35,1)",orange:"rgba(255,165,0,1)",orangered:"rgba(255,69,0,1)",orchid:"rgba(218,112,214,1)",palegoldenrod:"rgba(238,232,170,1)",palegreen:"rgba(152,251,152,1)",paleturquoise:"rgba(175,238,238,1)",palevioletred:"rgba(219,112,147,1)",papayawhip:"rgba(255,239,213,1)",peachpuff:"rgba(255,218,185,1)",peru:"rgba(205,133,63,1)",pink:"rgba(255,192,203,1)",plum:"rgba(221,160,221,1)",powderblue:"rgba(176,224,230,1)",purple:"rgba(128,0,128,1)",rebeccapurple:"rgba(102,51,153,1)",red:"rgba(255,0,0,1)",rosybrown:"rgba(188,143,143,1)",royalblue:"rgba(65,105,225,1)",saddlebrown:"rgba(139,69,19,1)",salmon:"rgba(250,128,114,1)",sandybrown:"rgba(244,164,96,1)",seagreen:"rgba(46,139,87,1)",seashell:"rgba(255,245,238,1)",sienna:"rgba(160,82,45,1)",silver:"rgba(192,192,192,1)",skyblue:"rgba(135,206,235,1)",slateblue:"rgba(106,90,205,1)",slategray:"rgba(112,128,144,1)",slategrey:"rgba(112,128,144,1)",snow:"rgba(255,250,250,1)",springgreen:"rgba(0,255,127,1)",steelblue:"rgba(70,130,180,1)",tan:"rgba(210,180,140,1)",teal:"rgba(0,128,128,1)",thistle:"rgba(216,191,216,1)",tomato:"rgba(255,99,71,1)",turquoise:"rgba(64,224,208,1)",violet:"rgba(238,130,238,1)",wheat:"rgba(245,222,179,1)",white:"rgba(255,255,255,1)",whitesmoke:"rgba(245,245,245,1)",yellow:"rgba(255,255,0,1)",yellowgreen:"rgba(154,205,50,1)"},e in this.CSSColorTable&&(e=this.CSSColorTable[e]);for(var n=[{name:"RGB",regex:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(0, 170, 222)","rgb(76, 175, 80)"],process:function(e){var n={r:parseInt(e[1]),g:parseInt(e[2]),b:parseInt(e[3])};return[n,t._RGBtoHSL(n.r,n.g,n.b),t._RGBtoCMYK(n.r,n.g,n.b),parseFloat(1)]}},{name:"RGBA",regex:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((\d)?(\.\d+)?)\)$/,example:["rgba(0, 170, 222, 1)","rgba(76, 175, 80, .75)"],process:function(e){var n={r:parseInt(e[1]),g:parseInt(e[2]),b:parseInt(e[3])};return[n,t._RGBtoHSL(n.r,n.g,n.b),t._RGBtoCMYK(n.r,n.g,n.b),parseFloat(e[4])]}},{name:"HSL",regex:/^(?:hsl)?\(?(\d{1,3}),\s*(\d{1,3}%),\s*(\d{1,3}%)\)?$/,example:["hsl(58, 100%, 50%)","195, 100%, 45%"],process:function(e){var n={h:parseFloat(e[1]),s:parseFloat(e[2]),l:parseFloat(e[3])},r=t._HSLtoRGB(n.h,n.s,n.l);return[r,n,t._RGBtoCMYK(r.r,r.g,r.b),parseFloat(1)]}},{name:"HSLA",regex:/^(?:hsla)?\(?(\d{1,3}),\s*(\d{1,3}%),\s*(\d{1,3}%),\s*((\d)?(\.\d+)?)\)?$/,example:["hsla(58, 100%, 50%, 1)","195, 100%, 45%, .5"],process:function(e){var n={h:parseFloat(e[1]),s:parseFloat(e[2]),l:parseFloat(e[3])},r=t._HSLtoRGB(n.h,n.s,n.l);return[r,n,t._RGBtoCMYK(r.r,r.g,r.b),parseFloat(e[4])]}},{name:"CMYK",regex:/^(?:cmyk)?\(?(\d{1,3})%,\s*(\d{1,3})%,\s*(\d{1,3})%,\s*(\d{1,3})%\)?$/,example:["cmyk(100%, 0%, 0%, 0%)","0%, 100%, 100%, 0%"],process:function(e){var n={c:parseInt(e[1]),m:parseInt(e[2]),y:parseInt(e[3]),k:parseInt(e[4])},r=t._CMYKtoRGB(n.c,n.m,n.y,n.k);return[r,t._RGBtoHSL(r.r,r.g,r.b),n,parseFloat(1)]}},{name:"HEX",regex:/^(\w{2})(\w{2})(\w{2})$/,example:["#FFEB3B","FF9800"],process:function(e){var n={r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)};return[n,t._RGBtoHSL(n.r,n.g,n.b),t._RGBtoCMYK(n.r,n.g,n.b),parseFloat(1)]}},{name:"HEX",regex:/^(\w)(\w)(\w)$/,example:["#92B","098"],process:function(e){var n={r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16)};return[n,t._RGBtoHSL(n.r,n.g,n.b),t._RGBtoCMYK(n.r,n.g,n.b),parseFloat(1)]}}],r=0;r<n.length;r++){var i=n[r].regex,a=n[r].process,o=i.exec(e);if(o){var s=a(o),u=s[1],c=s[2],l=s[3];this.rgb=s[0],this.hsl=u,this.cmyk=c,this.alpha=l,this.success=!0}}this.rgb.r=this.rgb.r<0||isNaN(this.rgb.r)?0:this.rgb.r>255?255:this.rgb.r,this.rgb.g=this.rgb.g<0||isNaN(this.rgb.g)?0:this.rgb.g>255?255:this.rgb.g,this.rgb.b=this.rgb.b<0||isNaN(this.rgb.b)?0:this.rgb.b>255?255:this.rgb.b,this.alpha=this.alpha>1||isNaN(this.alpha)?1:this.alpha<0?0:this.alpha,this.to=function(e){switch(e.toLowerCase()){case"hex":return this.toHex();case"rgb":return this.toRGB();case"rgba":default:return this.toRGBA();case"hsl":return this.toHSL();case"hsla":return this.toHSLA();case"cmyk":return this.toCMYK()}},this.toRGB=function(){return"rgb("+this.rgb.r+", "+this.rgb.g+", "+this.rgb.b+")"},this.toRGBA=function(){return"rgba("+this.rgb.r+", "+this.rgb.g+", "+this.rgb.b+", "+this.alpha+")"},this.toHex=function(){var e=this.rgb.r.toString(16),t=this.rgb.g.toString(16),n=this.rgb.b.toString(16);return 1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==n.length&&(n="0"+n),"#"+e+t+n},this.toHSL=function(){return"hsl("+this.hsl.h+", "+this.hsl.s+"%, "+this.hsl.l+"%)"},this.toHSLA=function(){return"hsla("+this.hsl.h+", "+this.hsl.s+"%, "+this.hsl.l+"%, "+this.alpha+")"},this.toCMYK=function(){return"cmyk("+this.cmyk.c+"%, "+this.cmyk.m+"%, "+this.cmyk.y+"%, "+this.cmyk.k+"%)"},this.toArray=function(){return[this.rgb,this.hsl,this.cmyk,this.alpha]},this.colorType=function(){for(var t,r=0;r<n.length;r++){var i=n[r].name;n[r].regex.exec(e)&&(t=i)}return t}}}t.fromRGB=function(e,n,r){var i={r:0,g:0,b:0};if(e&&e.constructor===Object)for(var a in i)e.hasOwnProperty(a)&&(i[a]=e[a]);else if(Array.isArray(e))for(var o=0;o<e.length;o++)i[Object.keys(i)[o]]=e[o];else i.r=e||0,i.g=n||0,i.b=r||0;var s=new t("rgb("+i.r+", "+i.g+", "+i.b+")");return this.success=s.success,s},t.fromRGBA=function(e,n,r,i){var a={r:0,g:0,b:0,a:1};if(e&&e.constructor===Object)for(var o in a)e.hasOwnProperty(o)&&(a[o]=e[o]);else if(Array.isArray(e))for(var s=0;s<e.length;s++)a[Object.keys(a)[s]]=e[s];else a.r=e||0,a.g=n||0,a.b=r||0,a.a=i||1;var u=new t("rgba("+a.r+", "+a.g+", "+a.b+", "+a.a+")");return this.success=u.success,u},t.fromHSL=function(e,n,r){var i={h:0,s:0,l:0};if(e&&e.constructor===Object)for(var a in i)e.hasOwnProperty(a)&&(i[a]=e[a]);else if(Array.isArray(e))for(var o=0;o<e.length;o++)i[Object.keys(i)[o]]=e[o];else i.h=e||0,i.s=n||0,i.l=r||0;var s=new t("hsl("+i.h+", "+i.s+"%, "+i.l+"%)");return this.success=s.success,s},t.fromHSLA=function(e,n,r,i){var a={h:0,s:0,l:0,a:0};if(e&&e.constructor===Object)for(var o in a)e.hasOwnProperty(o)&&(a[o]=e[o]);else if(Array.isArray(e))for(var s=0;s<e.length;s++)a[Object.keys(a)[s]]=e[s];else a.h=e||0,a.s=n||0,a.l=r||0,a.a=i||1;var u=new t("hsla("+a.h+", "+a.s+"%, "+a.l+"%, "+a.a+")");return this.success=u.success,u},t.fromCMYK=function(e,n,r,i){var a={c:0,m:0,y:0,k:0};if(e&&e.constructor===Object)for(var o in a)e.hasOwnProperty(o)&&(a[o]=e[o]);else if(Array.isArray(e))for(var s=0;s<e.length;s++)a[Object.keys(a)[s]]=e[s];else a.c=e||0,a.m=n||0,a.y=r||0,a.k=i||0;var u=new t("cmyk("+a.c+"%, "+a.m+"%, "+a.y+"%, "+a.k+"%)");return this.success=u.success,u},e.exports=t},30655:function(e,t,n){"use strict";var r=n(70453)("%Object.defineProperty%",!0)||!1;if(r)try{r({},"a",{value:1})}catch(e){r=!1}e.exports=r},41237:function(e){"use strict";e.exports=EvalError},69383:function(e){"use strict";e.exports=Error},79290:function(e){"use strict";e.exports=RangeError},79538:function(e){"use strict";e.exports=ReferenceError},58068:function(e){"use strict";e.exports=SyntaxError},69675:function(e){"use strict";e.exports=TypeError},35345:function(e){"use strict";e.exports=URIError},78904:function(e){!function(){function t(e,t){document.addEventListener?e.addEventListener("scroll",t,!1):e.attachEvent("scroll",t)}function n(e){this.g=document.createElement("div"),this.g.setAttribute("aria-hidden","true"),this.g.appendChild(document.createTextNode(e)),this.h=document.createElement("span"),this.i=document.createElement("span"),this.m=document.createElement("span"),this.j=document.createElement("span"),this.l=-1,this.h.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.i.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.j.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.m.style.cssText="display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;",this.h.appendChild(this.m),this.i.appendChild(this.j),this.g.appendChild(this.h),this.g.appendChild(this.i)}function r(e,t){e.g.style.cssText="max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:"+t+";"}function i(e){var t=e.g.offsetWidth,n=t+100;return e.j.style.width=n+"px",e.i.scrollLeft=n,e.h.scrollLeft=e.h.scrollWidth+100,e.l!==t&&(e.l=t,!0)}function a(e,n){function r(){var e=a;i(e)&&null!==e.g.parentNode&&n(e.l)}var a=e;t(e.h,r),t(e.i,r),i(e)}function o(e,t,n){t=t||{},n=n||window,this.family=e,this.style=t.style||"normal",this.weight=t.weight||"normal",this.stretch=t.stretch||"normal",this.context=n}var s=null,u=null,c=null,l=null;function h(e){return null===l&&(l=!!e.document.fonts),l}function f(e,t){var n=e.style,r=e.weight;if(null===c){var i=document.createElement("div");try{i.style.font="condensed 100px sans-serif"}catch(e){}c=""!==i.style.font}return[n,r,c?e.stretch:"","100px",t].join(" ")}o.prototype.load=function(e,t){var i=this,o=e||"BESbswy",c=0,l=t||3e3,m=(new Date).getTime();return new Promise((function(e,t){if(h(i.context)&&!function(e){return null===u&&(h(e)&&/Apple/.test(window.navigator.vendor)?(e=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent),u=!!e&&603>parseInt(e[1],10)):u=!1),u}(i.context)){var p=new Promise((function(e,t){!function n(){(new Date).getTime()-m>=l?t(Error(l+"ms timeout exceeded")):i.context.document.fonts.load(f(i,'"'+i.family+'"'),o).then((function(t){1<=t.length?e():setTimeout(n,25)}),t)}()})),d=new Promise((function(e,t){c=setTimeout((function(){t(Error(l+"ms timeout exceeded"))}),l)}));Promise.race([d,p]).then((function(){clearTimeout(c),e(i)}),t)}else!function(e){document.body?e():document.addEventListener?document.addEventListener("DOMContentLoaded",(function t(){document.removeEventListener("DOMContentLoaded",t),e()})):document.attachEvent("onreadystatechange",(function t(){"interactive"!=document.readyState&&"complete"!=document.readyState||(document.detachEvent("onreadystatechange",t),e())}))}((function(){function u(){var t;(t=-1!=v&&-1!=y||-1!=v&&-1!=g||-1!=y&&-1!=g)&&((t=v!=y&&v!=g&&y!=g)||(null===s&&(t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),s=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))),t=s&&(v==b&&y==b&&g==b||v==A&&y==A&&g==A||v==_&&y==_&&g==_)),t=!t),t&&(null!==M.parentNode&&M.parentNode.removeChild(M),clearTimeout(c),e(i))}var h=new n(o),p=new n(o),d=new n(o),v=-1,y=-1,g=-1,b=-1,A=-1,_=-1,M=document.createElement("div");M.dir="ltr",r(h,f(i,"sans-serif")),r(p,f(i,"serif")),r(d,f(i,"monospace")),M.appendChild(h.g),M.appendChild(p.g),M.appendChild(d.g),i.context.document.body.appendChild(M),b=h.g.offsetWidth,A=p.g.offsetWidth,_=d.g.offsetWidth,function e(){if((new Date).getTime()-m>=l)null!==M.parentNode&&M.parentNode.removeChild(M),t(Error(l+"ms timeout exceeded"));else{var n=i.context.document.hidden;!0!==n&&void 0!==n||(v=h.g.offsetWidth,y=p.g.offsetWidth,g=d.g.offsetWidth,u()),c=setTimeout(e,50)}}(),a(h,(function(e){v=e,u()})),r(h,f(i,'"'+i.family+'",sans-serif')),a(p,(function(e){y=e,u()})),r(p,f(i,'"'+i.family+'",serif')),a(d,(function(e){g=e,u()})),r(d,f(i,'"'+i.family+'",monospace'))}))}))},e.exports=o}()},82682:function(e,t,n){"use strict";var r=n(69600),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){if(!r(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=n),"[object Array]"===i.call(e)?function(e,t,n){for(var r=0,i=e.length;r<i;r++)a.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))}(e,t,o):"string"==typeof e?function(e,t,n){for(var r=0,i=e.length;r<i;r++)null==n?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)}(e,t,o):function(e,t,n){for(var r in e)a.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))}(e,t,o)}},89353:function(e){"use strict";var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n};e.exports=function(e){var i=this;if("function"!=typeof i||"[object Function]"!==t.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var a,o=function(e,t){for(var n=[],r=t||0,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n}(arguments,1),s=n(0,i.length-o.length),u=[],c=0;c<s;c++)u[c]="$"+c;if(a=Function("binder","return function ("+function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n}(u,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof a){var t=i.apply(this,r(o,arguments));return Object(t)===t?t:this}return i.apply(e,r(o,arguments))})),i.prototype){var l=function(){};l.prototype=i.prototype,a.prototype=new l,l.prototype=null}return a}},66743:function(e,t,n){"use strict";var r=n(89353);e.exports=Function.prototype.bind||r},70453:function(e,t,n){"use strict";var r,i=n(69383),a=n(41237),o=n(79290),s=n(79538),u=n(58068),c=n(69675),l=n(35345),h=Function,f=function(e){try{return h('"use strict"; return ('+e+").constructor;")()}catch(e){}},m=Object.getOwnPropertyDescriptor;if(m)try{m({},"")}catch(e){m=null}var p=function(){throw new c},d=m?function(){try{return p}catch(e){try{return m(arguments,"callee").get}catch(e){return p}}}():p,v=n(64039)(),y=n(80024)(),g=Object.getPrototypeOf||(y?function(e){return e.__proto__}:null),b={},A="undefined"!=typeof Uint8Array&&g?g(Uint8Array):r,_={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":v&&g?g([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":h,"%GeneratorFunction%":b,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":v&&g?g(g([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&v&&g?g((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&v&&g?g((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":v&&g?g(""[Symbol.iterator]()):r,"%Symbol%":v?Symbol:r,"%SyntaxError%":u,"%ThrowTypeError%":d,"%TypedArray%":A,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet};if(g)try{null.error}catch(e){var M=g(g(e));_["%Error.prototype%"]=M}var k=function e(t){var n;if("%AsyncFunction%"===t)n=f("async function () {}");else if("%GeneratorFunction%"===t)n=f("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=f("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&g&&(n=g(i.prototype))}return _[t]=n,n},w={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},T=n(66743),x=n(9957),S=T.call(Function.call,Array.prototype.concat),C=T.call(Function.apply,Array.prototype.splice),E=T.call(Function.call,String.prototype.replace),R=T.call(Function.call,String.prototype.slice),I=T.call(Function.call,RegExp.prototype.exec),O=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,D=/\\(\\)?/g,P=function(e,t){var n,r=e;if(x(w,r)&&(r="%"+(n=w[r])[0]+"%"),x(_,r)){var i=_[r];if(i===b&&(i=k(r)),void 0===i&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new u("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,e))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=R(e,0,1),n=R(e,-1);if("%"===t&&"%"!==n)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new u("invalid intrinsic syntax, expected opening `%`");var r=[];return E(e,O,(function(e,t,n,i){r[r.length]=n?E(i,D,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",i=P("%"+r+"%",t),a=i.name,o=i.value,s=!1,l=i.alias;l&&(r=l[0],C(n,S([0,1],l)));for(var h=1,f=!0;h<n.length;h+=1){var p=n[h],d=R(p,0,1),v=R(p,-1);if(('"'===d||"'"===d||"`"===d||'"'===v||"'"===v||"`"===v)&&d!==v)throw new u("property names with quotes must have matching quotes");if("constructor"!==p&&f||(s=!0),x(_,a="%"+(r+="."+p)+"%"))o=_[a];else if(null!=o){if(!(p in o)){if(!t)throw new c("base intrinsic for "+e+" exists, but the property is not available.");return}if(m&&h+1>=n.length){var y=m(o,p);o=(f=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:o[p]}else f=x(o,p),o=o[p];f&&!s&&(_[a]=o)}}return o}},75795:function(e,t,n){"use strict";var r=n(70453)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(e){r=null}e.exports=r},30592:function(e,t,n){"use strict";var r=n(30655),i=function(){return!!r};i.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},80024:function(e){"use strict";var t={__proto__:null,foo:{}},n=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof n)}},64039:function(e,t,n){"use strict";var r="undefined"!=typeof Symbol&&Symbol,i=n(41333);e.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},41333:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},49092:function(e,t,n){"use strict";var r=n(41333);e.exports=function(){return r()&&!!Symbol.toStringTag}},9957:function(e,t,n){"use strict";var r=Function.prototype.call,i=Object.prototype.hasOwnProperty,a=n(66743);e.exports=a.call(r,i)},94196:function(e,t,n){var r;!function(){"use strict";var i=function(){this.init()};i.prototype={init:function(){var e=this||a;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var t=this||a;if(e=parseFloat(e),t.ctx||m(),void 0!==e&&e>=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,a.ctx.currentTime);for(var n=0;n<t._howls.length;n++)if(!t._howls[n]._webAudio)for(var r=t._howls[n]._getSoundIds(),i=0;i<r.length;i++){var o=t._howls[n]._soundById(r[i]);o&&o._node&&(o._node.volume=o._volume*e)}return t}return t._volume},mute:function(e){var t=this||a;t.ctx||m(),t._muted=e,t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e?0:t._volume,a.ctx.currentTime);for(var n=0;n<t._howls.length;n++)if(!t._howls[n]._webAudio)for(var r=t._howls[n]._getSoundIds(),i=0;i<r.length;i++){var o=t._howls[n]._soundById(r[i]);o&&o._node&&(o._node.muted=!!e||o._muted)}return t},stop:function(){for(var e=this||a,t=0;t<e._howls.length;t++)e._howls[t].stop();return e},unload:function(){for(var e=this||a,t=e._howls.length-1;t>=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,m()),e},codecs:function(e){return(this||a)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||a;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(e._canPlayEvent="canplay")}catch(t){e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||a,t=null;try{t="undefined"!=typeof Audio?new Audio:null}catch(t){return e}if(!t||"function"!=typeof t.canPlayType)return e;var n=t.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator?e._navigator.userAgent:"",i=r.match(/OPR\/(\d+)/g),o=i&&parseInt(i[0].split("/")[1],10)<33,s=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),u=r.match(/Version\/(.*?) /),c=s&&u&&parseInt(u[1],10)<15;return e._codecs={mp3:!(o||!n&&!t.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!n,opus:!!t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(t.canPlayType('audio/wav; codecs="1"')||t.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!t.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!t.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(t.canPlayType("audio/x-m4b;")||t.canPlayType("audio/m4b;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(t.canPlayType("audio/x-mp4;")||t.canPlayType("audio/mp4;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(c||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(c||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!t.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(t.canPlayType("audio/x-flac;")||t.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||a;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function(n){for(;e._html5AudioPool.length<e.html5PoolSize;)try{var r=new Audio;r._unlocked=!0,e._releaseHtml5Audio(r)}catch(n){e.noAudio=!0;break}for(var i=0;i<e._howls.length;i++)if(!e._howls[i]._webAudio)for(var a=e._howls[i]._getSoundIds(),o=0;o<a.length;o++){var s=e._howls[i]._soundById(a[o]);s&&s._node&&!s._node._unlocked&&(s._node._unlocked=!0,s._node.load())}e._autoResume();var u=e.ctx.createBufferSource();u.buffer=e._scratchBuffer,u.connect(e.ctx.destination),void 0===u.start?u.noteOn(0):u.start(0),"function"==typeof e.ctx.resume&&e.ctx.resume(),u.onended=function(){u.disconnect(0),e._audioUnlocked=!0,document.removeEventListener("touchstart",t,!0),document.removeEventListener("touchend",t,!0),document.removeEventListener("click",t,!0),document.removeEventListener("keydown",t,!0);for(var n=0;n<e._howls.length;n++)e._howls[n]._emit("unlock")}};return document.addEventListener("touchstart",t,!0),document.addEventListener("touchend",t,!0),document.addEventListener("click",t,!0),document.addEventListener("keydown",t,!0),e}},_obtainHtml5Audio:function(){var e=this||a;if(e._html5AudioPool.length)return e._html5AudioPool.pop();var t=(new Audio).play();return t&&"undefined"!=typeof Promise&&(t instanceof Promise||"function"==typeof t.then)&&t.catch((function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")})),new Audio},_releaseHtml5Audio:function(e){var t=this||a;return e._unlocked&&t._html5AudioPool.push(e),t},_autoSuspend:function(){var e=this;if(e.autoSuspend&&e.ctx&&void 0!==e.ctx.suspend&&a.usingWebAudio){for(var t=0;t<e._howls.length;t++)if(e._howls[t]._webAudio)for(var n=0;n<e._howls[t]._sounds.length;n++)if(!e._howls[t]._sounds[n]._paused)return e;return e._suspendTimer&&clearTimeout(e._suspendTimer),e._suspendTimer=setTimeout((function(){if(e.autoSuspend){e._suspendTimer=null,e.state="suspending";var t=function(){e.state="suspended",e._resumeAfterSuspend&&(delete e._resumeAfterSuspend,e._autoResume())};e.ctx.suspend().then(t,t)}}),3e4),e}},_autoResume:function(){var e=this;if(e.ctx&&void 0!==e.ctx.resume&&a.usingWebAudio)return"running"===e.state&&"interrupted"!==e.ctx.state&&e._suspendTimer?(clearTimeout(e._suspendTimer),e._suspendTimer=null):"suspended"===e.state||"running"===e.state&&"interrupted"===e.ctx.state?(e.ctx.resume().then((function(){e.state="running";for(var t=0;t<e._howls.length;t++)e._howls[t]._emit("resume")})),e._suspendTimer&&(clearTimeout(e._suspendTimer),e._suspendTimer=null)):"suspending"===e.state&&(e._resumeAfterSuspend=!0),e}};var a=new i,o=function(e){e.src&&0!==e.src.length?this.init(e):console.error("An array of source files must be passed with any new Howl.")};o.prototype={init:function(e){var t=this;return a.ctx||m(),t._autoplay=e.autoplay||!1,t._format="string"!=typeof e.format?e.format:[e.format],t._html5=e.html5||!1,t._muted=e.mute||!1,t._loop=e.loop||!1,t._pool=e.pool||5,t._preload="boolean"!=typeof e.preload&&"metadata"!==e.preload||e.preload,t._rate=e.rate||1,t._sprite=e.sprite||{},t._src="string"!=typeof e.src?e.src:[e.src],t._volume=void 0!==e.volume?e.volume:1,t._xhr={method:e.xhr&&e.xhr.method?e.xhr.method:"GET",headers:e.xhr&&e.xhr.headers?e.xhr.headers:null,withCredentials:!(!e.xhr||!e.xhr.withCredentials)&&e.xhr.withCredentials},t._duration=0,t._state="unloaded",t._sounds=[],t._endTimers={},t._queue=[],t._playLock=!1,t._onend=e.onend?[{fn:e.onend}]:[],t._onfade=e.onfade?[{fn:e.onfade}]:[],t._onload=e.onload?[{fn:e.onload}]:[],t._onloaderror=e.onloaderror?[{fn:e.onloaderror}]:[],t._onplayerror=e.onplayerror?[{fn:e.onplayerror}]:[],t._onpause=e.onpause?[{fn:e.onpause}]:[],t._onplay=e.onplay?[{fn:e.onplay}]:[],t._onstop=e.onstop?[{fn:e.onstop}]:[],t._onmute=e.onmute?[{fn:e.onmute}]:[],t._onvolume=e.onvolume?[{fn:e.onvolume}]:[],t._onrate=e.onrate?[{fn:e.onrate}]:[],t._onseek=e.onseek?[{fn:e.onseek}]:[],t._onunlock=e.onunlock?[{fn:e.onunlock}]:[],t._onresume=[],t._webAudio=a.usingWebAudio&&!t._html5,void 0!==a.ctx&&a.ctx&&a.autoUnlock&&a._unlockAudio(),a._howls.push(t),t._autoplay&&t._queue.push({event:"play",action:function(){t.play()}}),t._preload&&"none"!==t._preload&&t.load(),t},load:function(){var e=this,t=null;if(a.noAudio)e._emit("loaderror",null,"No audio support.");else{"string"==typeof e._src&&(e._src=[e._src]);for(var n=0;n<e._src.length;n++){var r,i;if(e._format&&e._format[n])r=e._format[n];else{if("string"!=typeof(i=e._src[n])){e._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(r=/^data:audio\/([^;,]+);/i.exec(i))||(r=/\.([^.]+)$/.exec(i.split("?",1)[0])),r&&(r=r[1].toLowerCase())}if(r||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),r&&a.codecs(r)){t=e._src[n];break}}if(t)return e._src=t,e._state="loading","https:"===window.location.protocol&&"http:"===t.slice(0,5)&&(e._html5=!0,e._webAudio=!1),new s(e),e._webAudio&&c(e),e;e._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(e,t){var n=this,r=null;if("number"==typeof e)r=e,e=null;else{if("string"==typeof e&&"loaded"===n._state&&!n._sprite[e])return null;if(void 0===e&&(e="__default",!n._playLock)){for(var i=0,o=0;o<n._sounds.length;o++)n._sounds[o]._paused&&!n._sounds[o]._ended&&(i++,r=n._sounds[o]._id);1===i?e=null:r=null}}var s=r?n._soundById(r):n._inactiveSound();if(!s)return null;if(r&&!e&&(e=s._sprite||"__default"),"loaded"!==n._state){s._sprite=e,s._ended=!1;var u=s._id;return n._queue.push({event:"play",action:function(){n.play(u)}}),u}if(r&&!s._paused)return t||n._loadQueue("play"),s._id;n._webAudio&&a._autoResume();var c=Math.max(0,s._seek>0?s._seek:n._sprite[e][0]/1e3),l=Math.max(0,(n._sprite[e][0]+n._sprite[e][1])/1e3-c),h=1e3*l/Math.abs(s._rate),f=n._sprite[e][0]/1e3,m=(n._sprite[e][0]+n._sprite[e][1])/1e3;s._sprite=e,s._ended=!1;var p=function(){s._paused=!1,s._seek=c,s._start=f,s._stop=m,s._loop=!(!s._loop&&!n._sprite[e][2])};if(!(c>=m)){var d=s._node;if(n._webAudio){var v=function(){n._playLock=!1,p(),n._refreshBuffer(s);var e=s._muted||n._muted?0:s._volume;d.gain.setValueAtTime(e,a.ctx.currentTime),s._playStart=a.ctx.currentTime,void 0===d.bufferSource.start?s._loop?d.bufferSource.noteGrainOn(0,c,86400):d.bufferSource.noteGrainOn(0,c,l):s._loop?d.bufferSource.start(0,c,86400):d.bufferSource.start(0,c,l),h!==1/0&&(n._endTimers[s._id]=setTimeout(n._ended.bind(n,s),h)),t||setTimeout((function(){n._emit("play",s._id),n._loadQueue()}),0)};"running"===a.state&&"interrupted"!==a.ctx.state?v():(n._playLock=!0,n.once("resume",v),n._clearTimer(s._id))}else{var y=function(){d.currentTime=c,d.muted=s._muted||n._muted||a._muted||d.muted,d.volume=s._volume*a.volume(),d.playbackRate=s._rate;try{var r=d.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(n._playLock=!0,p(),r.then((function(){n._playLock=!1,d._unlocked=!0,t?n._loadQueue():n._emit("play",s._id)})).catch((function(){n._playLock=!1,n._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),s._ended=!0,s._paused=!0}))):t||(n._playLock=!1,p(),n._emit("play",s._id)),d.playbackRate=s._rate,d.paused)return void n._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||s._loop?n._endTimers[s._id]=setTimeout(n._ended.bind(n,s),h):(n._endTimers[s._id]=function(){n._ended(s),d.removeEventListener("ended",n._endTimers[s._id],!1)},d.addEventListener("ended",n._endTimers[s._id],!1))}catch(e){n._emit("playerror",s._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===d.src&&(d.src=n._src,d.load());var g=window&&window.ejecta||!d.readyState&&a._navigator.isCocoonJS;if(d.readyState>=3||g)y();else{n._playLock=!0,n._state="loading";var b=function(){n._state="loaded",y(),d.removeEventListener(a._canPlayEvent,b,!1)};d.addEventListener(a._canPlayEvent,b,!1),n._clearTimer(s._id)}}return s._id}n._ended(s)},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var n=t._getSoundIds(e),r=0;r<n.length;r++){t._clearTimer(n[r]);var i=t._soundById(n[r]);if(i&&!i._paused&&(i._seek=t.seek(n[r]),i._rateSeek=0,i._paused=!0,t._stopFade(n[r]),i._node))if(t._webAudio){if(!i._node.bufferSource)continue;void 0===i._node.bufferSource.stop?i._node.bufferSource.noteOff(0):i._node.bufferSource.stop(0),t._cleanBuffer(i._node)}else isNaN(i._node.duration)&&i._node.duration!==1/0||i._node.pause();arguments[1]||t._emit("pause",i?i._id:null)}return t},stop:function(e,t){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"stop",action:function(){n.stop(e)}}),n;for(var r=n._getSoundIds(e),i=0;i<r.length;i++){n._clearTimer(r[i]);var a=n._soundById(r[i]);a&&(a._seek=a._start||0,a._rateSeek=0,a._paused=!0,a._ended=!0,n._stopFade(r[i]),a._node&&(n._webAudio?a._node.bufferSource&&(void 0===a._node.bufferSource.stop?a._node.bufferSource.noteOff(0):a._node.bufferSource.stop(0),n._cleanBuffer(a._node)):isNaN(a._node.duration)&&a._node.duration!==1/0||(a._node.currentTime=a._start||0,a._node.pause(),a._node.duration===1/0&&n._clearSound(a._node))),t||n._emit("stop",a._id))}return n},mute:function(e,t){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"mute",action:function(){n.mute(e,t)}}),n;if(void 0===t){if("boolean"!=typeof e)return n._muted;n._muted=e}for(var r=n._getSoundIds(t),i=0;i<r.length;i++){var o=n._soundById(r[i]);o&&(o._muted=e,o._interval&&n._stopFade(o._id),n._webAudio&&o._node?o._node.gain.setValueAtTime(e?0:o._volume,a.ctx.currentTime):o._node&&(o._node.muted=!!a._muted||e),n._emit("mute",o._id))}return n},volume:function(){var e,t,n,r=this,i=arguments;if(0===i.length)return r._volume;if(1===i.length||2===i.length&&void 0===i[1]?r._getSoundIds().indexOf(i[0])>=0?t=parseInt(i[0],10):e=parseFloat(i[0]):i.length>=2&&(e=parseFloat(i[0]),t=parseInt(i[1],10)),!(void 0!==e&&e>=0&&e<=1))return(n=t?r._soundById(t):r._sounds[0])?n._volume:0;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"volume",action:function(){r.volume.apply(r,i)}}),r;void 0===t&&(r._volume=e),t=r._getSoundIds(t);for(var o=0;o<t.length;o++)(n=r._soundById(t[o]))&&(n._volume=e,i[2]||r._stopFade(t[o]),r._webAudio&&n._node&&!n._muted?n._node.gain.setValueAtTime(e,a.ctx.currentTime):n._node&&!n._muted&&(n._node.volume=e*a.volume()),r._emit("volume",n._id));return r},fade:function(e,t,n,r){var i=this;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"fade",action:function(){i.fade(e,t,n,r)}}),i;e=Math.min(Math.max(0,parseFloat(e)),1),t=Math.min(Math.max(0,parseFloat(t)),1),n=parseFloat(n),i.volume(e,r);for(var o=i._getSoundIds(r),s=0;s<o.length;s++){var u=i._soundById(o[s]);if(u){if(r||i._stopFade(o[s]),i._webAudio&&!u._muted){var c=a.ctx.currentTime,l=c+n/1e3;u._volume=e,u._node.gain.setValueAtTime(e,c),u._node.gain.linearRampToValueAtTime(t,l)}i._startFadeInterval(u,e,t,n,o[s],void 0===r)}}return i},_startFadeInterval:function(e,t,n,r,i,a){var o=this,s=t,u=n-t,c=Math.abs(u/.01),l=Math.max(4,c>0?r/c:r),h=Date.now();e._fadeTo=n,e._interval=setInterval((function(){var i=(Date.now()-h)/r;h=Date.now(),s+=u*i,s=Math.round(100*s)/100,s=u<0?Math.max(n,s):Math.min(n,s),o._webAudio?e._volume=s:o.volume(s,e._id,!0),a&&(o._volume=s),(n<t&&s<=n||n>t&&s>=n)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,o.volume(n,e._id),o._emit("fade",e._id))}),l)},_stopFade:function(e){var t=this,n=t._soundById(e);return n&&n._interval&&(t._webAudio&&n._node.gain.cancelScheduledValues(a.ctx.currentTime),clearInterval(n._interval),n._interval=null,t.volume(n._fadeTo,e),n._fadeTo=null,t._emit("fade",e)),t},loop:function(){var e,t,n,r=this,i=arguments;if(0===i.length)return r._loop;if(1===i.length){if("boolean"!=typeof i[0])return!!(n=r._soundById(parseInt(i[0],10)))&&n._loop;e=i[0],r._loop=e}else 2===i.length&&(e=i[0],t=parseInt(i[1],10));for(var a=r._getSoundIds(t),o=0;o<a.length;o++)(n=r._soundById(a[o]))&&(n._loop=e,r._webAudio&&n._node&&n._node.bufferSource&&(n._node.bufferSource.loop=e,e&&(n._node.bufferSource.loopStart=n._start||0,n._node.bufferSource.loopEnd=n._stop,r.playing(a[o])&&(r.pause(a[o],!0),r.play(a[o],!0)))));return r},rate:function(){var e,t,n,r=this,i=arguments;if(0===i.length)t=r._sounds[0]._id;else if(1===i.length){r._getSoundIds().indexOf(i[0])>=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else 2===i.length&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if("number"!=typeof e)return(n=r._soundById(t))?n._rate:r._rate;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"rate",action:function(){r.rate.apply(r,i)}}),r;void 0===t&&(r._rate=e),t=r._getSoundIds(t);for(var o=0;o<t.length;o++)if(n=r._soundById(t[o])){r.playing(t[o])&&(n._rateSeek=r.seek(t[o]),n._playStart=r._webAudio?a.ctx.currentTime:n._playStart),n._rate=e,r._webAudio&&n._node&&n._node.bufferSource?n._node.bufferSource.playbackRate.setValueAtTime(e,a.ctx.currentTime):n._node&&(n._node.playbackRate=e);var s=r.seek(t[o]),u=1e3*((r._sprite[n._sprite][0]+r._sprite[n._sprite][1])/1e3-s)/Math.abs(n._rate);!r._endTimers[t[o]]&&n._paused||(r._clearTimer(t[o]),r._endTimers[t[o]]=setTimeout(r._ended.bind(r,n),u)),r._emit("rate",n._id)}return r},seek:function(){var e,t,n=this,r=arguments;if(0===r.length)n._sounds.length&&(t=n._sounds[0]._id);else if(1===r.length){n._getSoundIds().indexOf(r[0])>=0?t=parseInt(r[0],10):n._sounds.length&&(t=n._sounds[0]._id,e=parseFloat(r[0]))}else 2===r.length&&(e=parseFloat(r[0]),t=parseInt(r[1],10));if(void 0===t)return 0;if("number"==typeof e&&("loaded"!==n._state||n._playLock))return n._queue.push({event:"seek",action:function(){n.seek.apply(n,r)}}),n;var i=n._soundById(t);if(i){if(!("number"==typeof e&&e>=0)){if(n._webAudio){var o=n.playing(t)?a.ctx.currentTime-i._playStart:0,s=i._rateSeek?i._rateSeek-i._seek:0;return i._seek+(s+o*Math.abs(i._rate))}return i._node.currentTime}var u=n.playing(t);u&&n.pause(t,!0),i._seek=e,i._ended=!1,n._clearTimer(t),n._webAudio||!i._node||isNaN(i._node.duration)||(i._node.currentTime=e);var c=function(){u&&n.play(t,!0),n._emit("seek",t)};if(u&&!n._webAudio){var l=function(){n._playLock?setTimeout(l,0):c()};setTimeout(l,0)}else c()}return n},playing:function(e){var t=this;if("number"==typeof e){var n=t._soundById(e);return!!n&&!n._paused}for(var r=0;r<t._sounds.length;r++)if(!t._sounds[r]._paused)return!0;return!1},duration:function(e){var t=this,n=t._duration,r=t._soundById(e);return r&&(n=t._sprite[r._sprite][1]/1e3),n},state:function(){return this._state},unload:function(){for(var e=this,t=e._sounds,n=0;n<t.length;n++)t[n]._paused||e.stop(t[n]._id),e._webAudio||(e._clearSound(t[n]._node),t[n]._node.removeEventListener("error",t[n]._errorFn,!1),t[n]._node.removeEventListener(a._canPlayEvent,t[n]._loadFn,!1),t[n]._node.removeEventListener("ended",t[n]._endFn,!1),a._releaseHtml5Audio(t[n]._node)),delete t[n]._node,e._clearTimer(t[n]._id);var r=a._howls.indexOf(e);r>=0&&a._howls.splice(r,1);var i=!0;for(n=0;n<a._howls.length;n++)if(a._howls[n]._src===e._src||e._src.indexOf(a._howls[n]._src)>=0){i=!1;break}return u&&i&&delete u[e._src],a.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,n,r){var i=this["_on"+e];return"function"==typeof t&&i.push(r?{id:n,fn:t,once:r}:{id:n,fn:t}),this},off:function(e,t,n){var r=this,i=r["_on"+e],a=0;if("number"==typeof t&&(n=t,t=null),t||n)for(a=0;a<i.length;a++){var o=n===i[a].id;if(t===i[a].fn&&o||!t&&o){i.splice(a,1);break}}else if(e)r["_on"+e]=[];else{var s=Object.keys(r);for(a=0;a<s.length;a++)0===s[a].indexOf("_on")&&Array.isArray(r[s[a]])&&(r[s[a]]=[])}return r},once:function(e,t,n){return this.on(e,t,n,1),this},_emit:function(e,t,n){for(var r=this,i=r["_on"+e],a=i.length-1;a>=0;a--)i[a].id&&i[a].id!==t&&"load"!==e||(setTimeout(function(e){e.call(this,t,n)}.bind(r,i[a].fn),0),i[a].once&&r.off(e,i[a].fn,i[a].id));return r._loadQueue(e),r},_loadQueue:function(e){var t=this;if(t._queue.length>0){var n=t._queue[0];n.event===e&&(t._queue.shift(),t._loadQueue()),e||n.action()}return t},_ended:function(e){var t=this,n=e._sprite;if(!t._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime<e._stop)return setTimeout(t._ended.bind(t,e),100),t;var r=!(!e._loop&&!t._sprite[n][2]);if(t._emit("end",e._id),!t._webAudio&&r&&t.stop(e._id,!0).play(e._id),t._webAudio&&r){t._emit("play",e._id),e._seek=e._start||0,e._rateSeek=0,e._playStart=a.ctx.currentTime;var i=1e3*(e._stop-e._start)/Math.abs(e._rate);t._endTimers[e._id]=setTimeout(t._ended.bind(t,e),i)}return t._webAudio&&!r&&(e._paused=!0,e._ended=!0,e._seek=e._start||0,e._rateSeek=0,t._clearTimer(e._id),t._cleanBuffer(e._node),a._autoSuspend()),t._webAudio||r||t.stop(e._id,!0),t},_clearTimer:function(e){var t=this;if(t._endTimers[e]){if("function"!=typeof t._endTimers[e])clearTimeout(t._endTimers[e]);else{var n=t._soundById(e);n&&n._node&&n._node.removeEventListener("ended",t._endTimers[e],!1)}delete t._endTimers[e]}return t},_soundById:function(e){for(var t=this,n=0;n<t._sounds.length;n++)if(e===t._sounds[n]._id)return t._sounds[n];return null},_inactiveSound:function(){var e=this;e._drain();for(var t=0;t<e._sounds.length;t++)if(e._sounds[t]._ended)return e._sounds[t].reset();return new s(e)},_drain:function(){var e=this,t=e._pool,n=0,r=0;if(!(e._sounds.length<t)){for(r=0;r<e._sounds.length;r++)e._sounds[r]._ended&&n++;for(r=e._sounds.length-1;r>=0;r--){if(n<=t)return;e._sounds[r]._ended&&(e._webAudio&&e._sounds[r]._node&&e._sounds[r]._node.disconnect(0),e._sounds.splice(r,1),n--)}}},_getSoundIds:function(e){if(void 0===e){for(var t=[],n=0;n<this._sounds.length;n++)t.push(this._sounds[n]._id);return t}return[e]},_refreshBuffer:function(e){return e._node.bufferSource=a.ctx.createBufferSource(),e._node.bufferSource.buffer=u[this._src],e._panner?e._node.bufferSource.connect(e._panner):e._node.bufferSource.connect(e._node),e._node.bufferSource.loop=e._loop,e._loop&&(e._node.bufferSource.loopStart=e._start||0,e._node.bufferSource.loopEnd=e._stop||0),e._node.bufferSource.playbackRate.setValueAtTime(e._rate,a.ctx.currentTime),this},_cleanBuffer:function(e){var t=a._navigator&&a._navigator.vendor.indexOf("Apple")>=0;if(!e.bufferSource)return this;if(a._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=a._scratchBuffer}catch(e){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(a._navigator&&a._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var s=function(e){this._parent=e,this.init()};s.prototype={init:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++a._counter,t._sounds.push(e),e.create(),e},create:function(){var e=this,t=e._parent,n=a._muted||e._muted||e._parent._muted?0:e._volume;return t._webAudio?(e._node=void 0===a.ctx.createGain?a.ctx.createGainNode():a.ctx.createGain(),e._node.gain.setValueAtTime(n,a.ctx.currentTime),e._node.paused=!0,e._node.connect(a.masterGain)):a.noAudio||(e._node=a._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(a._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=t._src,e._node.preload=!0===t._preload?"auto":t._preload,e._node.volume=n*a.volume(),e._node.load()),e},reset:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++a._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,t=e._parent;t._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue()),e._node.removeEventListener(a._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(10*e._node.duration)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=1e3*t._duration),t._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var u={},c=function(e){var t=e._src;if(u[t])return e._duration=u[t].duration,void f(e);if(/^data:[^;]+;base64,/.test(t)){for(var n=atob(t.split(",")[1]),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);h(r.buffer,e)}else{var a=new XMLHttpRequest;a.open(e._xhr.method,t,!0),a.withCredentials=e._xhr.withCredentials,a.responseType="arraybuffer",e._xhr.headers&&Object.keys(e._xhr.headers).forEach((function(t){a.setRequestHeader(t,e._xhr.headers[t])})),a.onload=function(){var t=(a.status+"")[0];"0"===t||"2"===t||"3"===t?h(a.response,e):e._emit("loaderror",null,"Failed loading audio file with status: "+a.status+".")},a.onerror=function(){e._webAudio&&(e._html5=!0,e._webAudio=!1,e._sounds=[],delete u[t],e.load())},l(a)}},l=function(e){try{e.send()}catch(t){e.onerror()}},h=function(e,t){var n=function(){t._emit("loaderror",null,"Decoding audio data failed.")},r=function(e){e&&t._sounds.length>0?(u[t._src]=e,f(t,e)):n()};"undefined"!=typeof Promise&&1===a.ctx.decodeAudioData.length?a.ctx.decodeAudioData(e).then(r).catch(n):a.ctx.decodeAudioData(e,r,n)},f=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},m=function(){if(a.usingWebAudio){try{"undefined"!=typeof AudioContext?a.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?a.ctx=new webkitAudioContext:a.usingWebAudio=!1}catch(e){a.usingWebAudio=!1}a.ctx||(a.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(a._navigator&&a._navigator.platform),t=a._navigator&&a._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),n=t?parseInt(t[1],10):null;if(e&&n&&n<9){var r=/safari/.test(a._navigator&&a._navigator.userAgent.toLowerCase());a._navigator&&!r&&(a.usingWebAudio=!1)}a.usingWebAudio&&(a.masterGain=void 0===a.ctx.createGain?a.ctx.createGainNode():a.ctx.createGain(),a.masterGain.gain.setValueAtTime(a._muted?0:a._volume,a.ctx.currentTime),a.masterGain.connect(a.ctx.destination)),a._setup()}};void 0===(r=function(){return{Howler:a,Howl:o}}.apply(t,[]))||(e.exports=r),t.Howler=a,t.Howl=o,void 0!==n.g?(n.g.HowlerGlobal=i,n.g.Howler=a,n.g.Howl=o,n.g.Sound=s):"undefined"!=typeof window&&(window.HowlerGlobal=i,window.Howler=a,window.Howl=o,window.Sound=s)}(),function(){"use strict";var e;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var n=t._howls.length-1;n>=0;n--)t._howls[n].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,n){var r=this;return r.ctx&&r.ctx.listener?(t="number"!=typeof t?r._pos[1]:t,n="number"!=typeof n?r._pos[2]:n,"number"!=typeof e?r._pos:(r._pos=[e,t,n],void 0!==r.ctx.listener.positionX?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]),r)):r},HowlerGlobal.prototype.orientation=function(e,t,n,r,i,a){var o=this;if(!o.ctx||!o.ctx.listener)return o;var s=o._orientation;return t="number"!=typeof t?s[1]:t,n="number"!=typeof n?s[2]:n,r="number"!=typeof r?s[3]:r,i="number"!=typeof i?s[4]:i,a="number"!=typeof a?s[5]:a,"number"!=typeof e?s:(o._orientation=[e,t,n,r,i,a],void 0!==o.ctx.listener.forwardX?(o.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),o.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),o.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),o.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),o.ctx.listener.upY.setTargetAtTime(i,Howler.ctx.currentTime,.1),o.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1)):o.ctx.listener.setOrientation(e,t,n,r,i,a),o)},Howl.prototype.init=(e=Howl.prototype.init,function(t){var n=this;return n._orientation=t.orientation||[1,0,0],n._stereo=t.stereo||null,n._pos=t.pos||null,n._pannerAttr={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:360,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:360,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:0,distanceModel:void 0!==t.distanceModel?t.distanceModel:"inverse",maxDistance:void 0!==t.maxDistance?t.maxDistance:1e4,panningModel:void 0!==t.panningModel?t.panningModel:"HRTF",refDistance:void 0!==t.refDistance?t.refDistance:1,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:1},n._onstereo=t.onstereo?[{fn:t.onstereo}]:[],n._onpos=t.onpos?[{fn:t.onpos}]:[],n._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}),Howl.prototype.stereo=function(e,n){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(e,n)}}),r;var i=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===n){if("number"!=typeof e)return r._stereo;r._stereo=e,r._pos=[e,0,0]}for(var a=r._getSoundIds(n),o=0;o<a.length;o++){var s=r._soundById(a[o]);if(s){if("number"!=typeof e)return s._stereo;s._stereo=e,s._pos=[e,0,0],s._node&&(s._pannerAttr.panningModel="equalpower",s._panner&&s._panner.pan||t(s,i),"spatial"===i?void 0!==s._panner.positionX?(s._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),s._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),s._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):s._panner.setPosition(e,0,0):s._panner.pan.setValueAtTime(e,Howler.ctx.currentTime)),r._emit("stereo",s._id)}}return r},Howl.prototype.pos=function(e,n,r,i){var a=this;if(!a._webAudio)return a;if("loaded"!==a._state)return a._queue.push({event:"pos",action:function(){a.pos(e,n,r,i)}}),a;if(n="number"!=typeof n?0:n,r="number"!=typeof r?-.5:r,void 0===i){if("number"!=typeof e)return a._pos;a._pos=[e,n,r]}for(var o=a._getSoundIds(i),s=0;s<o.length;s++){var u=a._soundById(o[s]);if(u){if("number"!=typeof e)return u._pos;u._pos=[e,n,r],u._node&&(u._panner&&!u._panner.pan||t(u,"spatial"),void 0!==u._panner.positionX?(u._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(n,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(r,Howler.ctx.currentTime)):u._panner.setPosition(e,n,r)),a._emit("pos",u._id)}}return a},Howl.prototype.orientation=function(e,n,r,i){var a=this;if(!a._webAudio)return a;if("loaded"!==a._state)return a._queue.push({event:"orientation",action:function(){a.orientation(e,n,r,i)}}),a;if(n="number"!=typeof n?a._orientation[1]:n,r="number"!=typeof r?a._orientation[2]:r,void 0===i){if("number"!=typeof e)return a._orientation;a._orientation=[e,n,r]}for(var o=a._getSoundIds(i),s=0;s<o.length;s++){var u=a._soundById(o[s]);if(u){if("number"!=typeof e)return u._orientation;u._orientation=[e,n,r],u._node&&(u._panner||(u._pos||(u._pos=a._pos||[0,0,-.5]),t(u,"spatial")),void 0!==u._panner.orientationX?(u._panner.orientationX.setValueAtTime(e,Howler.ctx.currentTime),u._panner.orientationY.setValueAtTime(n,Howler.ctx.currentTime),u._panner.orientationZ.setValueAtTime(r,Howler.ctx.currentTime)):u._panner.setOrientation(e,n,r)),a._emit("orientation",u._id)}}return a},Howl.prototype.pannerAttr=function(){var e,n,r,i=this,a=arguments;if(!i._webAudio)return i;if(0===a.length)return i._pannerAttr;if(1===a.length){if("object"!=typeof a[0])return(r=i._soundById(parseInt(a[0],10)))?r._pannerAttr:i._pannerAttr;e=a[0],void 0===n&&(e.pannerAttr||(e.pannerAttr={coneInnerAngle:e.coneInnerAngle,coneOuterAngle:e.coneOuterAngle,coneOuterGain:e.coneOuterGain,distanceModel:e.distanceModel,maxDistance:e.maxDistance,refDistance:e.refDistance,rolloffFactor:e.rolloffFactor,panningModel:e.panningModel}),i._pannerAttr={coneInnerAngle:void 0!==e.pannerAttr.coneInnerAngle?e.pannerAttr.coneInnerAngle:i._coneInnerAngle,coneOuterAngle:void 0!==e.pannerAttr.coneOuterAngle?e.pannerAttr.coneOuterAngle:i._coneOuterAngle,coneOuterGain:void 0!==e.pannerAttr.coneOuterGain?e.pannerAttr.coneOuterGain:i._coneOuterGain,distanceModel:void 0!==e.pannerAttr.distanceModel?e.pannerAttr.distanceModel:i._distanceModel,maxDistance:void 0!==e.pannerAttr.maxDistance?e.pannerAttr.maxDistance:i._maxDistance,refDistance:void 0!==e.pannerAttr.refDistance?e.pannerAttr.refDistance:i._refDistance,rolloffFactor:void 0!==e.pannerAttr.rolloffFactor?e.pannerAttr.rolloffFactor:i._rolloffFactor,panningModel:void 0!==e.pannerAttr.panningModel?e.pannerAttr.panningModel:i._panningModel})}else 2===a.length&&(e=a[0],n=parseInt(a[1],10));for(var o=i._getSoundIds(n),s=0;s<o.length;s++)if(r=i._soundById(o[s])){var u=r._pannerAttr;u={coneInnerAngle:void 0!==e.coneInnerAngle?e.coneInnerAngle:u.coneInnerAngle,coneOuterAngle:void 0!==e.coneOuterAngle?e.coneOuterAngle:u.coneOuterAngle,coneOuterGain:void 0!==e.coneOuterGain?e.coneOuterGain:u.coneOuterGain,distanceModel:void 0!==e.distanceModel?e.distanceModel:u.distanceModel,maxDistance:void 0!==e.maxDistance?e.maxDistance:u.maxDistance,refDistance:void 0!==e.refDistance?e.refDistance:u.refDistance,rolloffFactor:void 0!==e.rolloffFactor?e.rolloffFactor:u.rolloffFactor,panningModel:void 0!==e.panningModel?e.panningModel:u.panningModel};var c=r._panner;c||(r._pos||(r._pos=i._pos||[0,0,-.5]),t(r,"spatial"),c=r._panner),c.coneInnerAngle=u.coneInnerAngle,c.coneOuterAngle=u.coneOuterAngle,c.coneOuterGain=u.coneOuterGain,c.distanceModel=u.distanceModel,c.maxDistance=u.maxDistance,c.refDistance=u.refDistance,c.rolloffFactor=u.rolloffFactor,c.panningModel=u.panningModel}return i},Sound.prototype.init=function(e){return function(){var t=this,n=t._parent;t._orientation=n._orientation,t._stereo=n._stereo,t._pos=n._pos,t._pannerAttr=n._pannerAttr,e.call(this),t._stereo?n.stereo(t._stereo):t._pos&&n.pos(t._pos[0],t._pos[1],t._pos[2],t._id)}}(Sound.prototype.init),Sound.prototype.reset=function(e){return function(){var t=this,n=t._parent;return t._orientation=n._orientation,t._stereo=n._stereo,t._pos=n._pos,t._pannerAttr=n._pannerAttr,t._stereo?n.stereo(t._stereo):t._pos?n.pos(t._pos[0],t._pos[1],t._pos[2],t._id):t._panner&&(t._panner.disconnect(0),t._panner=void 0,n._refreshBuffer(t)),e.call(this)}}(Sound.prototype.reset);var t=function(e,t){"spatial"===(t=t||"spatial")?(e._panner=Howler.ctx.createPanner(),e._panner.coneInnerAngle=e._pannerAttr.coneInnerAngle,e._panner.coneOuterAngle=e._pannerAttr.coneOuterAngle,e._panner.coneOuterGain=e._pannerAttr.coneOuterGain,e._panner.distanceModel=e._pannerAttr.distanceModel,e._panner.maxDistance=e._pannerAttr.maxDistance,e._panner.refDistance=e._pannerAttr.refDistance,e._panner.rolloffFactor=e._pannerAttr.rolloffFactor,e._panner.panningModel=e._pannerAttr.panningModel,void 0!==e._panner.positionX?(e._panner.positionX.setValueAtTime(e._pos[0],Howler.ctx.currentTime),e._panner.positionY.setValueAtTime(e._pos[1],Howler.ctx.currentTime),e._panner.positionZ.setValueAtTime(e._pos[2],Howler.ctx.currentTime)):e._panner.setPosition(e._pos[0],e._pos[1],e._pos[2]),void 0!==e._panner.orientationX?(e._panner.orientationX.setValueAtTime(e._orientation[0],Howler.ctx.currentTime),e._panner.orientationY.setValueAtTime(e._orientation[1],Howler.ctx.currentTime),e._panner.orientationZ.setValueAtTime(e._orientation[2],Howler.ctx.currentTime)):e._panner.setOrientation(e._orientation[0],e._orientation[1],e._orientation[2])):(e._panner=Howler.ctx.createStereoPanner(),e._panner.pan.setValueAtTime(e._stereo,Howler.ctx.currentTime)),e._panner.connect(e._node),e._paused||e._parent.pause(e._id,!0).play(e._id,!0)}}()},56698:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},47244:function(e,t,n){"use strict";var r=n(49092)(),i=n(38075)("Object.prototype.toString"),a=function(e){return!(r&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},o=function(e){return!!a(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,e.exports=s?a:o},69600:function(e){"use strict";var t,n,r=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},i((function(){throw 42}),null,t)}catch(e){e!==n&&(i=null)}else i=null;var a=/^\s*class\b/,o=function(e){try{var t=r.call(e);return a.test(t)}catch(e){return!1}},s=function(e){try{return!o(e)&&(r.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;u.call(f)===u.call(document.all)&&(h=function(e){if((l||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==n)return!1}return!o(e)&&s(e)}:function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return s(e);if(o(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},48184:function(e,t,n){"use strict";var r,i=Object.prototype.toString,a=Function.prototype.toString,o=/^\s*(?:function)?\*/,s=n(49092)(),u=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(o.test(a.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!u)return!1;if(void 0===r){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();r=!!t&&u(t)}return u(e)===r}},35680:function(e,t,n){"use strict";var r=n(25767);e.exports=function(e){return!!r(e)}},76578:function(e){"use strict";e.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},65606:function(e){var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var s,u=[],c=!1,l=-1;function h(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&f())}function f(){if(!c){var e=o(h);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l<t;)s&&s[l].run();l=-1,t=u.length}s=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function p(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new m(e,t)),1!==u.length||c||o(f)},m.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},88483:function(e,t,n){"use strict";n.d(t,{c:function(){return l}});var r=n(75508),i=n(52616),a=n(55604),o=n(81485),s=n(94384),u=n(61209),c=n(7008),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var a,o=this,s=(a=e)&&a instanceof r.vU||function(e){return e&&(0,u.T)(e.next)&&(0,u.T)(e.error)&&(0,u.T)(e.complete)}(a)&&(0,i.Uv)(a)?e:new r.Ms(e,t,n);return(0,c.Y)((function(){var e=o,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?o._subscribe(s):o._trySubscribe(s))})),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=h(t))((function(t,i){var a=new r.Ms({next:function(t){try{e(t)}catch(e){i(e),a.unsubscribe()}},error:i,complete:t});n.subscribe(a)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[a.s]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,o.m)(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=h(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function h(e){var t;return null!==(t=null!=e?e:s.$.Promise)&&void 0!==t?t:Promise}},39741:function(e,t,n){"use strict";n.d(t,{m:function(){return o}});var r=n(31635),i=n(27291),a=n(31179),o=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=a.U);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return(0,r.C6)(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,u=1;u<r.length&&r[u]<=o;u+=2)s=u;s&&r.splice(0,s+1)}},t}(i.B)},27291:function(e,t,n){"use strict";n.d(t,{B:function(){return c}});var r=n(31635),i=n(88483),a=n(52616),o=(0,n(82947).L)((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),s=n(6174),u=n(7008),c=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,r.C6)(t,e),t.prototype.lift=function(e){var t=new l(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,u.Y)((function(){var n,i;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var a=(0,r.Ju)(t.currentObservers),o=a.next();!o.done;o=a.next()){o.value.next(e)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;(0,u.Y)((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;(0,u.Y)((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?a.Kn:(this.currentObservers=null,o.push(e),new a.yU((function(){t.currentObservers=null,(0,s.o)(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new i.c;return e.source=this,e},t.create=function(e,t){return new l(e,t)},t}(i.c),l=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,r.C6)(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:a.Kn},t}(c)},75508:function(e,t,n){"use strict";n.d(t,{Ms:function(){return y},vU:function(){return m}});var r=n(31635),i=n(61209),a=n(52616),o=n(94384),s=n(22564),u=n(92357),c=l("C",void 0,void 0);function l(e,t,n){return{kind:e,value:t,error:n}}var h=n(96744),f=n(7008),m=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,(0,a.Uv)(t)&&t.add(n)):n.destination=A,n}return(0,r.C6)(t,e),t.create=function(e,t,n){return new y(e,t,n)},t.prototype.next=function(e){this.isStopped?b(function(e){return l("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?b(l("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?b(c,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(a.yU),p=Function.prototype.bind;function d(e,t){return p.call(e,t)}var v=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){g(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){g(e)}else g(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){g(e)}},e}(),y=function(e){function t(t,n,r){var a,s,u=e.call(this)||this;(0,i.T)(t)||!t?a={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&o.$.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},a={next:t.next&&d(t.next,s),error:t.error&&d(t.error,s),complete:t.complete&&d(t.complete,s)}):a=t;return u.destination=new v(a),u}return(0,r.C6)(t,e),t}(m);function g(e){o.$.useDeprecatedSynchronousErrorHandling?(0,f.l)(e):(0,s.m)(e)}function b(e,t){var n=o.$.onStoppedNotification;n&&h.f.setTimeout((function(){return n(e,t)}))}var A={closed:!0,next:u.l,error:function(e){throw e},complete:u.l}},52616:function(e,t,n){"use strict";n.d(t,{Kn:function(){return u},yU:function(){return s},Uv:function(){return c}});var r=n(31635),i=n(61209),a=(0,n(82947).L)((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n  "):"",this.name="UnsubscriptionError",this.errors=t}})),o=n(6174),s=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,o,s;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var c=(0,r.Ju)(u),h=c.next();!h.done;h=c.next()){h.value.remove(this)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}else u.remove(this);var f=this.initialTeardown;if((0,i.T)(f))try{f()}catch(e){s=e instanceof a?e.errors:[e]}var m=this._finalizers;if(m){this._finalizers=null;try{for(var p=(0,r.Ju)(m),d=p.next();!d.done;d=p.next()){var v=d.value;try{l(v)}catch(e){s=null!=s?s:[],e instanceof a?s=(0,r.fX)((0,r.fX)([],(0,r.zs)(s)),(0,r.zs)(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}}if(s)throw new a(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.o)(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&(0,o.o)(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),u=s.EMPTY;function c(e){return e instanceof s||e&&"closed"in e&&(0,i.T)(e.remove)&&(0,i.T)(e.add)&&(0,i.T)(e.unsubscribe)}function l(e){(0,i.T)(e)?e():e.unsubscribe()}},94384:function(e,t,n){"use strict";n.d(t,{$:function(){return r}});var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},72985:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(76464),i=n(75508);function a(e,t){var n="object"==typeof t;return new Promise((function(a,o){var s=new i.Ms({next:function(e){a(e),s.unsubscribe()},error:o,complete:function(){n?a(t.defaultValue):o(new r.G)}});e.subscribe(s)}))}},84082:function(e,t,n){"use strict";n.d(t,{w:function(){return r}});var r=new(n(88483).c)((function(e){return e.complete()}))},45650:function(e,t,n){"use strict";n.d(t,{p:function(){return l}});var r=n(88483),i=n(24151),a=n(15964),o=n(82100),s=n(64878),u=n(57516),c=n(66450);function l(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,o.ms)(e),l=(0,i.D)(e),h=l.args,f=l.keys,m=new r.c((function(e){var t=h.length;if(t)for(var n=new Array(t),r=t,i=t,o=function(t){var o=!1;(0,a.Tg)(h[t]).subscribe((0,s._)(e,(function(e){o||(o=!0,i--),n[t]=e}),(function(){return r--}),void 0,(function(){r&&o||(i||e.next(f?(0,c.e)(f,n):n),e.complete())})))},u=0;u<t;u++)o(u);else e.complete()}));return n?m.pipe((0,u.I)(n)):m}},37968:function(e,t,n){"use strict";n.d(t,{H:function(){return _}});var r=n(15964),i=n(56315),a=n(92908),o=n(64878);function s(e,t){return void 0===t&&(t=0),(0,a.N)((function(n,r){n.subscribe((0,o._)(r,(function(n){return(0,i.N)(r,e,(function(){return r.next(n)}),t)}),(function(){return(0,i.N)(r,e,(function(){return r.complete()}),t)}),(function(n){return(0,i.N)(r,e,(function(){return r.error(n)}),t)})))}))}function u(e,t){return void 0===t&&(t=0),(0,a.N)((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}var c=n(88483);var l=n(12059),h=n(61209);function f(e,t){if(!e)throw new Error("Iterable cannot be null");return new c.c((function(n){(0,i.N)(n,t,(function(){var r=e[Symbol.asyncIterator]();(0,i.N)(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}var m=n(37541),p=n(3440),d=n(69391),v=n(58667),y=n(62471),g=n(43465),b=n(8438);function A(e,t){if(null!=e){if((0,m.l)(e))return function(e,t){return(0,r.Tg)(e).pipe(u(t),s(t))}(e,t);if((0,d.X)(e))return function(e,t){return new c.c((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if((0,p.y)(e))return function(e,t){return(0,r.Tg)(e).pipe(u(t),s(t))}(e,t);if((0,y.T)(e))return f(e,t);if((0,v.x)(e))return function(e,t){return new c.c((function(n){var r;return(0,i.N)(n,t,(function(){r=e[l.l](),(0,i.N)(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){return void n.error(e)}i?n.complete():n.next(t)}),0,!0)})),function(){return(0,h.T)(null==r?void 0:r.return)&&r.return()}}))}(e,t);if((0,b.U)(e))return function(e,t){return f((0,b.C)(e),t)}(e,t)}throw(0,g.L)(e)}function _(e,t){return t?A(e,t):(0,r.Tg)(e)}},15964:function(e,t,n){"use strict";n.d(t,{Tg:function(){return d}});var r=n(31635),i=n(69391),a=n(3440),o=n(88483),s=n(37541),u=n(62471),c=n(43465),l=n(58667),h=n(8438),f=n(61209),m=n(22564),p=n(55604);function d(e){if(e instanceof o.c)return e;if(null!=e){if((0,s.l)(e))return g=e,new o.c((function(e){var t=g[p.s]();if((0,f.T)(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if((0,i.X)(e))return y=e,new o.c((function(e){for(var t=0;t<y.length&&!e.closed;t++)e.next(y[t]);e.complete()}));if((0,a.y)(e))return d=e,new o.c((function(e){d.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,m.m)}));if((0,u.T)(e))return v(e);if((0,l.x)(e))return n=e,new o.c((function(e){var t,i;try{for(var a=(0,r.Ju)(n),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}e.complete()}));if((0,h.U)(e))return t=e,v((0,h.C)(t))}var t,n,d,y,g;throw(0,c.L)(e)}function v(e){return new o.c((function(t){(function(e,t){var n,i,a,o;return(0,r.sH)(this,void 0,void 0,(function(){var s,u;return(0,r.YH)(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=(0,r.xN)(e),c.label=1;case 1:return[4,n.next()];case 2:if((i=c.sent()).done)return[3,4];if(s=i.value,t.next(s),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=c.sent(),a={error:u},[3,11];case 6:return c.trys.push([6,,9,10]),i&&!i.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}},62467:function(e,t,n){"use strict";n.d(t,{of:function(){return a}});var r=n(82100),i=n(37968);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,r.lI)(e);return(0,i.H)(e,n)}},13288:function(e,t,n){"use strict";n.d(t,{$:function(){return a}});var r=n(88483),i=n(61209);function a(e,t){var n=(0,i.T)(e)?e:function(){return e},a=function(e){return e.error(n())};return new r.c(t?function(e){return t.schedule(a,0,e)}:a)}},39697:function(e,t,n){"use strict";n.d(t,{O:function(){return s}});var r=n(88483),i=n(47903),a=n(98820),o=n(86577);function s(e,t,n){void 0===e&&(e=0),void 0===n&&(n=i.b);var s=-1;return null!=t&&((0,a.m)(t)?n=t:s=t),new r.c((function(t){var r=(0,o.v)(e)?+e-n.now():e;r<0&&(r=0);var i=0;return n.schedule((function(){t.closed||(t.next(i++),0<=s?this.schedule(void 0,s):t.complete())}),r)}))}},64878:function(e,t,n){"use strict";n.d(t,{_:function(){return i}});var r=n(31635);function i(e,t,n,r,i){return new a(e,t,n,r,i)}var a=function(e){function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return(0,r.C6)(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(n(75508).vU)},66847:function(e,t,n){"use strict";n.d(t,{W:function(){return o}});var r=n(15964),i=n(64878),a=n(92908);function o(e){return(0,a.N)((function(t,n){var a,s=null,u=!1;s=t.subscribe((0,i._)(n,void 0,void 0,(function(i){a=(0,r.Tg)(e(i,o(e)(t))),s?(s.unsubscribe(),s=null,a.subscribe(n)):u=!0}))),u&&(s.unsubscribe(),s=null,a.subscribe(n))}))}},81080:function(e,t,n){"use strict";n.d(t,{p:function(){return s}});var r=n(81160),i=n(15964),a=n(92908),o=n(64878);function s(e,t){return t?function(n){return n.pipe(s((function(n,a){return(0,i.Tg)(e(n,a)).pipe((0,r.T)((function(e,r){return t(n,e,a,r)})))})))}:(0,a.N)((function(t,n){var r=0,a=null,s=!1;t.subscribe((0,o._)(n,(function(t){a||(a=(0,o._)(n,void 0,(function(){a=null,s&&n.complete()})),(0,i.Tg)(e(t,r++)).subscribe(a))}),(function(){s=!0,!a&&n.complete()})))}))}},16126:function(e,t,n){"use strict";n.d(t,{p:function(){return a}});var r=n(92908),i=n(64878);function a(e,t){return(0,r.N)((function(n,r){var a=0;n.subscribe((0,i._)(r,(function(n){return e.call(t,n,a++)&&r.next(n)})))}))}},99335:function(e,t,n){"use strict";n.d(t,{$:function(){return l}});var r=n(76464),i=n(16126),a=n(38975),o=n(92908),s=n(64878);function u(){return new r.G}var c=n(58307);function l(e,t){var n=arguments.length>=2;return function(l){return l.pipe(e?(0,i.p)((function(t,n){return e(t,n,l)})):c.D,(0,a.s)(1),n?function(e){return(0,o.N)((function(t,n){var r=!1;t.subscribe((0,s._)(n,(function(e){r=!0,n.next(e)}),(function(){r||n.next(e),n.complete()})))}))}(t):(void 0===(h=function(){return new r.G})&&(h=u),(0,o.N)((function(e,t){var n=!1;e.subscribe((0,s._)(t,(function(e){n=!0,t.next(e)}),(function(){return n?t.complete():t.error(h())})))}))));var h}}},81160:function(e,t,n){"use strict";n.d(t,{T:function(){return a}});var r=n(92908),i=n(64878);function a(e,t){return(0,r.N)((function(n,r){var a=0;n.subscribe((0,i._)(r,(function(n){r.next(e.call(t,n,a++))})))}))}},31731:function(e,t,n){"use strict";n.d(t,{u:function(){return u}});var r=n(84082),i=n(92908),a=n(64878),o=n(15964),s=n(39697);function u(e){var t,n,u=1/0;return null!=e&&("object"==typeof e?(t=e.count,u=void 0===t?1/0:t,n=e.delay):u=e),u<=0?function(){return r.w}:(0,i.N)((function(e,t){var r,i=0,c=function(){if(null==r||r.unsubscribe(),r=null,null!=n){var e="number"==typeof n?(0,s.O)(n):(0,o.Tg)(n(i)),u=(0,a._)(t,(function(){u.unsubscribe(),l()}));e.subscribe(u)}else l()},l=function(){var n=!1;r=e.subscribe((0,a._)(t,void 0,(function(){++i<u?r?c():n=!0:t.complete()}))),n&&c()};l()}))}},1005:function(e,t,n){"use strict";n.d(t,{u:function(){return u}});var r=n(31635),i=n(15964),a=n(27291),o=n(75508),s=n(92908);function u(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new a.B}:t,r=e.resetOnError,u=void 0===r||r,l=e.resetOnComplete,h=void 0===l||l,f=e.resetOnRefCountZero,m=void 0===f||f;return function(e){var t,r,a,l=0,f=!1,p=!1,d=function(){null==r||r.unsubscribe(),r=void 0},v=function(){d(),t=a=void 0,f=p=!1},y=function(){var e=t;v(),null==e||e.unsubscribe()};return(0,s.N)((function(e,s){l++,p||f||d();var g=a=null!=a?a:n();s.add((function(){0!==--l||p||f||(r=c(y,m))})),g.subscribe(s),!t&&l>0&&(t=new o.Ms({next:function(e){return g.next(e)},error:function(e){p=!0,d(),r=c(v,u,e),g.error(e)},complete:function(){f=!0,d(),r=c(v,h),g.complete()}}),(0,i.Tg)(e).subscribe(t))}))(e)}}function c(e,t){for(var n=[],a=2;a<arguments.length;a++)n[a-2]=arguments[a];if(!0!==t){if(!1!==t){var s=new o.Ms({next:function(){s.unsubscribe(),e()}});return(0,i.Tg)(t.apply(void 0,(0,r.fX)([],(0,r.zs)(n)))).subscribe(s)}}else e()}},38975:function(e,t,n){"use strict";n.d(t,{s:function(){return o}});var r=n(84082),i=n(92908),a=n(64878);function o(e){return e<=0?function(){return r.w}:(0,i.N)((function(t,n){var r=0;t.subscribe((0,a._)(n,(function(t){++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}},67791:function(e,t,n){"use strict";n.d(t,{Q:function(){return s}});var r=n(92908),i=n(64878),a=n(15964),o=n(92357);function s(e){return(0,r.N)((function(t,n){(0,a.Tg)(e).subscribe((0,i._)(n,(function(){return n.complete()}),o.l)),!n.closed&&t.subscribe(n)}))}},59099:function(e,t,n){"use strict";n.d(t,{M:function(){return s}});var r=n(61209),i=n(92908),a=n(64878),o=n(58307);function s(e,t,n){var s=(0,r.T)(e)||t||n?{next:e,error:t,complete:n}:e;return s?(0,i.N)((function(e,t){var n;null===(n=s.subscribe)||void 0===n||n.call(s);var r=!0;e.subscribe((0,a._)(t,(function(e){var n;null===(n=s.next)||void 0===n||n.call(s,e),t.next(e)}),(function(){var e;r=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()}),(function(e){var n;r=!1,null===(n=s.error)||void 0===n||n.call(s,e),t.error(e)}),(function(){var e,t;r&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)})))})):o.D}},49184:function(e,t,n){"use strict";n.d(t,{n:function(){return o}});var r=n(92908),i=n(64878),a=n(15964);function o(e,t){return(0,r.N)((function(n,r){var o=null!=t?t:{},s=o.leading,u=void 0===s||s,c=o.trailing,l=void 0!==c&&c,h=!1,f=null,m=null,p=!1,d=function(){null==m||m.unsubscribe(),m=null,l&&(g(),p&&r.complete())},v=function(){m=null,p&&r.complete()},y=function(t){return m=(0,a.Tg)(e(t)).subscribe((0,i._)(r,d,v))},g=function(){if(h){h=!1;var e=f;f=null,r.next(e),!p&&y(e)}};n.subscribe((0,i._)(r,(function(e){h=!0,f=e,(!m||m.closed)&&(u?g():y(e))}),(function(){p=!0,(!(l&&h&&m)||m.closed)&&r.complete()})))}))}},90593:function(e,t,n){"use strict";n.d(t,{w:function(){return h}});var r=n(47903),i=n(86577),a=n(92908),o=n(15964),s=n(82947),u=n(64878),c=n(56315),l=(0,s.L)((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function h(e,t){var n=(0,i.v)(e)?{first:e}:"number"==typeof e?{each:e}:e,s=n.first,l=n.each,h=n.with,m=void 0===h?f:h,p=n.scheduler,d=void 0===p?null!=t?t:r.E:p,v=n.meta,y=void 0===v?null:v;if(null==s&&null==l)throw new TypeError("No timeout provided.");return(0,a.N)((function(e,t){var n,r,i=null,a=0,h=function(e){r=(0,c.N)(t,d,(function(){try{n.unsubscribe(),(0,o.Tg)(m({meta:y,lastValue:i,seen:a})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe((0,u._)(t,(function(e){null==r||r.unsubscribe(),a++,t.next(i=e),l>0&&h(l)}),void 0,void 0,(function(){(null==r?void 0:r.closed)||null==r||r.unsubscribe(),i=null}))),!a&&h(null!=s?"number"==typeof s?s:+s-d.now():l)}))}function f(e){throw new l(e)}},47903:function(e,t,n){"use strict";n.d(t,{b:function(){return h},E:function(){return l}});var r=n(31635),i=function(e){function t(t,n){return e.call(this)||this}return(0,r.C6)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(52616).yU),a={setInterval:function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var o=a.delegate;return(null==o?void 0:o.setInterval)?o.setInterval.apply(o,(0,r.fX)([e,t],(0,r.zs)(n))):setInterval.apply(void 0,(0,r.fX)([e,t],(0,r.zs)(n)))},clearInterval:function(e){var t=a.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=n(6174),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,r.C6)(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),a.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&a.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.o)(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i),u=n(31179),c=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=u.U.now,e}(),l=new(function(e){function t(t,n){void 0===n&&(n=c.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return(0,r.C6)(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(c))(s),h=l},31179:function(e,t,n){"use strict";n.d(t,{U:function(){return r}});var r={now:function(){return(r.delegate||Date).now()},delegate:void 0}},96744:function(e,t,n){"use strict";n.d(t,{f:function(){return i}});var r=n(31635),i={setTimeout:function(e,t){for(var n=[],a=2;a<arguments.length;a++)n[a-2]=arguments[a];var o=i.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,(0,r.fX)([e,t],(0,r.zs)(n))):setTimeout.apply(void 0,(0,r.fX)([e,t],(0,r.zs)(n)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},12059:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},55604:function(e,t,n){"use strict";n.d(t,{s:function(){return r}});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},76464:function(e,t,n){"use strict";n.d(t,{G:function(){return r}});var r=(0,n(82947).L)((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}))},82100:function(e,t,n){"use strict";n.d(t,{lI:function(){return s},ms:function(){return o}});var r=n(61209),i=n(98820);function a(e){return e[e.length-1]}function o(e){return(0,r.T)(a(e))?e.pop():void 0}function s(e){return(0,i.m)(a(e))?e.pop():void 0}},24151:function(e,t,n){"use strict";n.d(t,{D:function(){return s}});var r=Array.isArray,i=Object.getPrototypeOf,a=Object.prototype,o=Object.keys;function s(e){if(1===e.length){var t=e[0];if(r(t))return{args:t,keys:null};if((s=t)&&"object"==typeof s&&i(s)===a){var n=o(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var s;return{args:e,keys:null}}},6174:function(e,t,n){"use strict";function r(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}n.d(t,{o:function(){return r}})},82947:function(e,t,n){"use strict";function r(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}n.d(t,{L:function(){return r}})},66450:function(e,t,n){"use strict";function r(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}n.d(t,{e:function(){return r}})},7008:function(e,t,n){"use strict";n.d(t,{Y:function(){return a},l:function(){return o}});var r=n(94384),i=null;function a(e){if(r.$.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var n=i,a=n.errorThrown,o=n.error;if(i=null,a)throw o}}else e()}function o(e){r.$.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},56315:function(e,t,n){"use strict";function r(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(a),!i)return a}n.d(t,{N:function(){return r}})},58307:function(e,t,n){"use strict";function r(e){return e}n.d(t,{D:function(){return r}})},69391:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});var r=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},62471:function(e,t,n){"use strict";n.d(t,{T:function(){return i}});var r=n(61209);function i(e){return Symbol.asyncIterator&&(0,r.T)(null==e?void 0:e[Symbol.asyncIterator])}},86577:function(e,t,n){"use strict";function r(e){return e instanceof Date&&!isNaN(e)}n.d(t,{v:function(){return r}})},61209:function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,{T:function(){return r}})},37541:function(e,t,n){"use strict";n.d(t,{l:function(){return a}});var r=n(55604),i=n(61209);function a(e){return(0,i.T)(e[r.s])}},58667:function(e,t,n){"use strict";n.d(t,{x:function(){return a}});var r=n(12059),i=n(61209);function a(e){return(0,i.T)(null==e?void 0:e[r.l])}},3440:function(e,t,n){"use strict";n.d(t,{y:function(){return i}});var r=n(61209);function i(e){return(0,r.T)(null==e?void 0:e.then)}},8438:function(e,t,n){"use strict";n.d(t,{C:function(){return a},U:function(){return o}});var r=n(31635),i=n(61209);function a(e){return(0,r.AQ)(this,arguments,(function(){var t,n,i;return(0,r.YH)(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,(0,r.N3)(t.read())];case 3:return n=a.sent(),i=n.value,n.done?[4,(0,r.N3)(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,(0,r.N3)(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function o(e){return(0,i.T)(null==e?void 0:e.getReader)}},98820:function(e,t,n){"use strict";n.d(t,{m:function(){return i}});var r=n(61209);function i(e){return e&&(0,r.T)(e.schedule)}},92908:function(e,t,n){"use strict";n.d(t,{N:function(){return i}});var r=n(61209);function i(e){return function(t){if(function(e){return(0,r.T)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},57516:function(e,t,n){"use strict";n.d(t,{I:function(){return o}});var r=n(31635),i=n(81160),a=Array.isArray;function o(e){return(0,i.T)((function(t){return function(e,t){return a(t)?e.apply(void 0,(0,r.fX)([],(0,r.zs)(t))):e(t)}(e,t)}))}},92357:function(e,t,n){"use strict";function r(){}n.d(t,{l:function(){return r}})},81485:function(e,t,n){"use strict";n.d(t,{F:function(){return i},m:function(){return a}});var r=n(58307);function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a(e)}function a(e){return 0===e.length?r.D:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}},22564:function(e,t,n){"use strict";n.d(t,{m:function(){return a}});var r=n(94384),i=n(96744);function a(e){i.f.setTimeout((function(){var t=r.$.onUnhandledError;if(!t)throw e;t(e)}))}},43465:function(e,t,n){"use strict";function r(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}n.d(t,{L:function(){return r}})},96897:function(e,t,n){"use strict";var r=n(70453),i=n(30041),a=n(30592)(),o=n(75795),s=n(69675),u=r("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||u(t)!==t)throw new s("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],r=!0,c=!0;if("length"in e&&o){var l=o(e,"length");l&&!l.configurable&&(r=!1),l&&!l.writable&&(c=!1)}return(r||c||!n)&&(a?i(e,"length",t,!0,!0):i(e,"length",t)),e}},61070:function(e,t){"use strict";t.V=void 0;var n=function(){function e(){this._dataLength=0,this._bufferLength=0,this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}return e.hashStr=function(e,t){return void 0===t&&(t=!1),this.onePassHasher.start().appendStr(e).end(t)},e.hashAsciiStr=function(e,t){return void 0===t&&(t=!1),this.onePassHasher.start().appendAsciiStr(e).end(t)},e._hex=function(t){var n,r,i,a,o=e.hexChars,s=e.hexOut;for(a=0;a<4;a+=1)for(r=8*a,n=t[a],i=0;i<8;i+=2)s[r+1+i]=o.charAt(15&n),n>>>=4,s[r+0+i]=o.charAt(15&n),n>>>=4;return s.join("")},e._md5cycle=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3];r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&i|~r&a)+t[0]-680876936|0)<<7|n>>>25)+r|0)&r|~n&i)+t[1]-389564586|0)<<12|a>>>20)+n|0)&n|~a&r)+t[2]+606105819|0)<<17|i>>>15)+a|0)&a|~i&n)+t[3]-1044525330|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&i|~r&a)+t[4]-176418897|0)<<7|n>>>25)+r|0)&r|~n&i)+t[5]+1200080426|0)<<12|a>>>20)+n|0)&n|~a&r)+t[6]-1473231341|0)<<17|i>>>15)+a|0)&a|~i&n)+t[7]-45705983|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&i|~r&a)+t[8]+1770035416|0)<<7|n>>>25)+r|0)&r|~n&i)+t[9]-1958414417|0)<<12|a>>>20)+n|0)&n|~a&r)+t[10]-42063|0)<<17|i>>>15)+a|0)&a|~i&n)+t[11]-1990404162|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&i|~r&a)+t[12]+1804603682|0)<<7|n>>>25)+r|0)&r|~n&i)+t[13]-40341101|0)<<12|a>>>20)+n|0)&n|~a&r)+t[14]-1502002290|0)<<17|i>>>15)+a|0)&a|~i&n)+t[15]+1236535329|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&a|i&~a)+t[1]-165796510|0)<<5|n>>>27)+r|0)&i|r&~i)+t[6]-1069501632|0)<<9|a>>>23)+n|0)&r|n&~r)+t[11]+643717713|0)<<14|i>>>18)+a|0)&n|a&~n)+t[0]-373897302|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&a|i&~a)+t[5]-701558691|0)<<5|n>>>27)+r|0)&i|r&~i)+t[10]+38016083|0)<<9|a>>>23)+n|0)&r|n&~r)+t[15]-660478335|0)<<14|i>>>18)+a|0)&n|a&~n)+t[4]-405537848|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&a|i&~a)+t[9]+568446438|0)<<5|n>>>27)+r|0)&i|r&~i)+t[14]-1019803690|0)<<9|a>>>23)+n|0)&r|n&~r)+t[3]-187363961|0)<<14|i>>>18)+a|0)&n|a&~n)+t[8]+1163531501|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&a|i&~a)+t[13]-1444681467|0)<<5|n>>>27)+r|0)&i|r&~i)+t[2]-51403784|0)<<9|a>>>23)+n|0)&r|n&~r)+t[7]+1735328473|0)<<14|i>>>18)+a|0)&n|a&~n)+t[12]-1926607734|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r^i^a)+t[5]-378558|0)<<4|n>>>28)+r|0)^r^i)+t[8]-2022574463|0)<<11|a>>>21)+n|0)^n^r)+t[11]+1839030562|0)<<16|i>>>16)+a|0)^a^n)+t[14]-35309556|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r^i^a)+t[1]-1530992060|0)<<4|n>>>28)+r|0)^r^i)+t[4]+1272893353|0)<<11|a>>>21)+n|0)^n^r)+t[7]-155497632|0)<<16|i>>>16)+a|0)^a^n)+t[10]-1094730640|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r^i^a)+t[13]+681279174|0)<<4|n>>>28)+r|0)^r^i)+t[0]-358537222|0)<<11|a>>>21)+n|0)^n^r)+t[3]-722521979|0)<<16|i>>>16)+a|0)^a^n)+t[6]+76029189|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r^i^a)+t[9]-640364487|0)<<4|n>>>28)+r|0)^r^i)+t[12]-421815835|0)<<11|a>>>21)+n|0)^n^r)+t[15]+530742520|0)<<16|i>>>16)+a|0)^a^n)+t[2]-995338651|0)<<23|r>>>9)+i|0,r=((r+=((a=((a+=(r^((n=((n+=(i^(r|~a))+t[0]-198630844|0)<<6|n>>>26)+r|0)|~i))+t[7]+1126891415|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~r))+t[14]-1416354905|0)<<15|i>>>17)+a|0)|~n))+t[5]-57434055|0)<<21|r>>>11)+i|0,r=((r+=((a=((a+=(r^((n=((n+=(i^(r|~a))+t[12]+1700485571|0)<<6|n>>>26)+r|0)|~i))+t[3]-1894986606|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~r))+t[10]-1051523|0)<<15|i>>>17)+a|0)|~n))+t[1]-2054922799|0)<<21|r>>>11)+i|0,r=((r+=((a=((a+=(r^((n=((n+=(i^(r|~a))+t[8]+1873313359|0)<<6|n>>>26)+r|0)|~i))+t[15]-30611744|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~r))+t[6]-1560198380|0)<<15|i>>>17)+a|0)|~n))+t[13]+1309151649|0)<<21|r>>>11)+i|0,r=((r+=((a=((a+=(r^((n=((n+=(i^(r|~a))+t[4]-145523070|0)<<6|n>>>26)+r|0)|~i))+t[11]-1120210379|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~r))+t[2]+718787259|0)<<15|i>>>17)+a|0)|~n))+t[9]-343485551|0)<<21|r>>>11)+i|0,e[0]=n+e[0]|0,e[1]=r+e[1]|0,e[2]=i+e[2]|0,e[3]=a+e[3]|0},e.prototype.start=function(){return this._dataLength=0,this._bufferLength=0,this._state.set(e.stateIdentity),this},e.prototype.appendStr=function(t){var n,r,i=this._buffer8,a=this._buffer32,o=this._bufferLength;for(r=0;r<t.length;r+=1){if((n=t.charCodeAt(r))<128)i[o++]=n;else if(n<2048)i[o++]=192+(n>>>6),i[o++]=63&n|128;else if(n<55296||n>56319)i[o++]=224+(n>>>12),i[o++]=n>>>6&63|128,i[o++]=63&n|128;else{if((n=1024*(n-55296)+(t.charCodeAt(++r)-56320)+65536)>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");i[o++]=240+(n>>>18),i[o++]=n>>>12&63|128,i[o++]=n>>>6&63|128,i[o++]=63&n|128}o>=64&&(this._dataLength+=64,e._md5cycle(this._state,a),o-=64,a[0]=a[16])}return this._bufferLength=o,this},e.prototype.appendAsciiStr=function(t){for(var n,r=this._buffer8,i=this._buffer32,a=this._bufferLength,o=0;;){for(n=Math.min(t.length-o,64-a);n--;)r[a++]=t.charCodeAt(o++);if(a<64)break;this._dataLength+=64,e._md5cycle(this._state,i),a=0}return this._bufferLength=a,this},e.prototype.appendByteArray=function(t){for(var n,r=this._buffer8,i=this._buffer32,a=this._bufferLength,o=0;;){for(n=Math.min(t.length-o,64-a);n--;)r[a++]=t[o++];if(a<64)break;this._dataLength+=64,e._md5cycle(this._state,i),a=0}return this._bufferLength=a,this},e.prototype.getState=function(){var e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}},e.prototype.setState=function(e){var t,n=e.buffer,r=e.state,i=this._state;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],t=0;t<n.length;t+=1)this._buffer8[t]=n.charCodeAt(t)},e.prototype.end=function(t){void 0===t&&(t=!1);var n=this._bufferLength,r=this._buffer8,i=this._buffer32,a=1+(n>>2);this._dataLength+=n;var o=8*this._dataLength;if(r[n]=128,r[n+1]=r[n+2]=r[n+3]=0,i.set(e.buffer32Identity.subarray(a),a),n>55&&(e._md5cycle(this._state,i),i.set(e.buffer32Identity)),o<=4294967295)i[14]=o;else{var s=o.toString(16).match(/(.*?)(.{0,8})$/);if(null===s)return;var u=parseInt(s[2],16),c=parseInt(s[1],16)||0;i[14]=u,i[15]=c}return e._md5cycle(this._state,i),t?this._state:e._hex(this._state)},e.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]),e.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),e.hexChars="0123456789abcdef",e.hexOut=[],e.onePassHasher=new e,e}();if(t.V=n,"5d41402abc4b2a76b9719d911017c592"!==n.hashStr("hello"))throw new Error("Md5 self test failed.")},81135:function(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},49032:function(e,t,n){"use strict";var r=n(47244),i=n(48184),a=n(25767),o=n(35680);function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=s(Object.prototype.toString),h=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),m=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(c)var d=s(Symbol.prototype.valueOf);function v(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function y(e){return"[object Map]"===l(e)}function g(e){return"[object Set]"===l(e)}function b(e){return"[object WeakMap]"===l(e)}function A(e){return"[object WeakSet]"===l(e)}function _(e){return"[object ArrayBuffer]"===l(e)}function M(e){return"undefined"!=typeof ArrayBuffer&&(_.working?_(e):e instanceof ArrayBuffer)}function k(e){return"[object DataView]"===l(e)}function w(e){return"undefined"!=typeof DataView&&(k.working?k(e):e instanceof DataView)}t.isArgumentsObject=r,t.isGeneratorFunction=i,t.isTypedArray=o,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):o(e)||w(e)},t.isUint8Array=function(e){return"Uint8Array"===a(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===a(e)},t.isUint16Array=function(e){return"Uint16Array"===a(e)},t.isUint32Array=function(e){return"Uint32Array"===a(e)},t.isInt8Array=function(e){return"Int8Array"===a(e)},t.isInt16Array=function(e){return"Int16Array"===a(e)},t.isInt32Array=function(e){return"Int32Array"===a(e)},t.isFloat32Array=function(e){return"Float32Array"===a(e)},t.isFloat64Array=function(e){return"Float64Array"===a(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===a(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===a(e)},y.working="undefined"!=typeof Map&&y(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(y.working?y(e):e instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(g.working?g(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},A.working="undefined"!=typeof WeakSet&&A(new WeakSet),t.isWeakSet=function(e){return A(e)},_.working="undefined"!=typeof ArrayBuffer&&_(new ArrayBuffer),t.isArrayBuffer=M,k.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&k(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=w;var T="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function x(e){return"[object SharedArrayBuffer]"===l(e)}function S(e){return void 0!==T&&(void 0===x.working&&(x.working=x(new T)),x.working?x(e):e instanceof T)}function C(e){return v(e,h)}function E(e){return v(e,f)}function R(e){return v(e,m)}function I(e){return u&&v(e,p)}function O(e){return c&&v(e,d)}t.isSharedArrayBuffer=S,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},t.isGeneratorObject=function(e){return"[object Generator]"===l(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},t.isNumberObject=C,t.isStringObject=E,t.isBooleanObject=R,t.isBigIntObject=I,t.isSymbolObject=O,t.isBoxedPrimitive=function(e){return C(e)||E(e)||R(e)||I(e)||O(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(M(e)||S(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},40537:function(e,t,n){var r=n(65606),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},a=/%[sdj%]/g;t.format=function(e){if(!b(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(c(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,o=String(e).replace(a,(function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),s=r[n];n<i;s=r[++n])y(s)||!M(s)?o+=" "+s:o+=" "+c(s);return o},t.deprecate=function(e,n){if(void 0!==r&&!0===r.noDeprecation)return e;if(void 0===r)return function(){return t.deprecate(e,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(r.throwDeprecation)throw new Error(n);r.traceDeprecation?console.trace(n):console.error(n),i=!0}return e.apply(this,arguments)}};var o={},s=/^$/;if(r.env.NODE_DEBUG){var u=r.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+u+"$","i")}function c(e,n){var r={seen:[],stylize:h};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),v(n)?r.showHidden=n:n&&t._extend(r,n),A(r.showHidden)&&(r.showHidden=!1),A(r.depth)&&(r.depth=2),A(r.colors)&&(r.colors=!1),A(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),f(r,e,r.depth)}function l(e,t){var n=c.styles[t];return n?"["+c.colors[n][0]+"m"+e+"["+c.colors[n][1]+"m":e}function h(e,t){return e}function f(e,n,r){if(e.customInspect&&n&&T(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return b(i)||(i=f(e,i,r)),i}var a=function(e,t){if(A(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(g(t))return e.stylize(""+t,"number");if(v(t))return e.stylize(""+t,"boolean");if(y(t))return e.stylize("null","null")}(e,n);if(a)return a;var o=Object.keys(n),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(n)),w(n)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return m(n);if(0===o.length){if(T(n)){var u=n.name?": "+n.name:"";return e.stylize("[Function"+u+"]","special")}if(_(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(k(n))return e.stylize(Date.prototype.toString.call(n),"date");if(w(n))return m(n)}var c,l="",h=!1,M=["{","}"];(d(n)&&(h=!0,M=["[","]"]),T(n))&&(l=" [Function"+(n.name?": "+n.name:"")+"]");return _(n)&&(l=" "+RegExp.prototype.toString.call(n)),k(n)&&(l=" "+Date.prototype.toUTCString.call(n)),w(n)&&(l=" "+m(n)),0!==o.length||h&&0!=n.length?r<0?_(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),c=h?function(e,t,n,r,i){for(var a=[],o=0,s=t.length;o<s;++o)E(t,String(o))?a.push(p(e,t,n,r,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(p(e,t,n,r,i,!0))})),a}(e,n,r,s,o):o.map((function(t){return p(e,n,r,s,t,h)})),e.seen.pop(),function(e,t,n){var r=e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(r>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(c,l,M)):M[0]+l+M[1]}function m(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,i,a){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),E(r,i)||(o="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=y(n)?f(e,u.value,null):f(e,u.value,n-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return"  "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return"   "+e})).join("\n")):s=e.stylize("[Circular]","special")),A(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function d(e){return Array.isArray(e)}function v(e){return"boolean"==typeof e}function y(e){return null===e}function g(e){return"number"==typeof e}function b(e){return"string"==typeof e}function A(e){return void 0===e}function _(e){return M(e)&&"[object RegExp]"===x(e)}function M(e){return"object"==typeof e&&null!==e}function k(e){return M(e)&&"[object Date]"===x(e)}function w(e){return M(e)&&("[object Error]"===x(e)||e instanceof Error)}function T(e){return"function"==typeof e}function x(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!o[e])if(s.test(e)){var n=r.pid;o[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else o[e]=function(){};return o[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=n(49032),t.isArray=d,t.isBoolean=v,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=b,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=A,t.isRegExp=_,t.types.isRegExp=_,t.isObject=M,t.isDate=k,t.types.isDate=k,t.isError=w,t.types.isNativeError=w,t.isFunction=T,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(81135);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(e=new Date,n=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":"),[e.getDate(),C[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(56698),t._extend=function(e,t){if(!t||!M(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(R&&e[R]){var t;if("function"!=typeof(t=e[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push((function(e,r){e?n(e):t(r)}));try{e.apply(this,i)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),R&&Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=R,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var a=this,o=function(){return i.apply(a,arguments)};e.apply(this,t).then((function(e){r.nextTick(o.bind(null,null,e))}),(function(e){r.nextTick(I.bind(null,e,o))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},25767:function(e,t,n){"use strict";var r=n(82682),i=n(39209),a=n(10487),o=n(38075),s=n(75795),u=o("Object.prototype.toString"),c=n(49092)(),l="undefined"==typeof globalThis?n.g:globalThis,h=i(),f=o("String.prototype.slice"),m=Object.getPrototypeOf,p=o("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},d={__proto__:null};r(h,c&&s&&m?function(e){var t=new l[e];if(Symbol.toStringTag in t){var n=m(t),r=s(n,Symbol.toStringTag);if(!r){var i=m(n);r=s(i,Symbol.toStringTag)}d["$"+e]=a(r.get)}}:function(e){var t=new l[e],n=t.slice||t.set;n&&(d["$"+e]=a(n))});e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!c){var t=f(u(e),8,-1);return p(h,t)>-1?t:"Object"===t&&function(e){var t=!1;return r(d,(function(n,r){if(!t)try{n(e),t=f(r,1)}catch(e){}})),t}(e)}return s?function(e){var t=!1;return r(d,(function(n,r){if(!t)try{"$"+n(e)===r&&(t=f(r,1))}catch(e){}})),t}(e):null}},4633:function(e,t,n){var r=n(73738).default;function i(){"use strict";e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},a=Object.prototype,o=a.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",h=u.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,n){return e[t]=n}}function m(e,t,n,r){var i=t&&t.prototype instanceof A?t:A,a=Object.create(i.prototype),o=new D(r||[]);return s(a,"_invoke",{value:E(e,n,o)}),a}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=m;var d="suspendedStart",v="suspendedYield",y="executing",g="completed",b={};function A(){}function _(){}function M(){}var k={};f(k,c,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(P([])));T&&T!==a&&o.call(T,c)&&(k=T);var x=M.prototype=A.prototype=Object.create(k);function S(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(i,a,s,u){var c=p(e[i],e,a);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==r(h)&&o.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}})}function E(e,n,r){var i=d;return function(a,o){if(i===y)throw Error("Generator is already running");if(i===g){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var u=R(s,r);if(u){if(u===b)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var c=p(e,n,r);if("normal"===c.type){if(i=r.done?g:v,c.arg===b)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=g,r.method="throw",r.arg=c.arg)}}}function R(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,R(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),b;var a=p(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,b;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,b):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function P(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(o.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return _.prototype=M,s(x,"constructor",{value:M,configurable:!0}),s(M,"constructor",{value:_,configurable:!0}),_.displayName=f(M,h,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,M):(e.__proto__=M,f(e,h,"GeneratorFunction")),e.prototype=Object.create(x),e},n.awrap=function(e){return{__await:e}},S(C.prototype),f(C.prototype,l,(function(){return this})),n.AsyncIterator=C,n.async=function(e,t,r,i,a){void 0===a&&(a=Promise);var o=new C(m(e,t,r,i),a);return n.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},S(x),f(x,h,"Generator"),f(x,c,(function(){return this})),f(x,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=P,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;O(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:P(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),b}},n}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},73738:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},54756:function(e,t,n){var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},39209:function(e,t,n){"use strict";var r=n(76578),i="undefined"==typeof globalThis?n.g:globalThis;e.exports=function(){for(var e=[],t=0;t<r.length;t++)"function"==typeof i[r[t]]&&(e[e.length]=r[t]);return e}},79306:function(e,t,n){"use strict";var r=n(94901),i=n(16823),a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(i(e)+" is not a function")}},35548:function(e,t,n){"use strict";var r=n(33517),i=n(16823),a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(i(e)+" is not a constructor")}},36194:function(e,t,n){"use strict";var r=n(72248).has;e.exports=function(e){return r(e),e}},73506:function(e,t,n){"use strict";var r=n(13925),i=String,a=TypeError;e.exports=function(e){if(r(e))return e;throw new a("Can't set "+i(e)+" as a prototype")}},97080:function(e,t,n){"use strict";var r=n(94402).has;e.exports=function(e){return r(e),e}},76557:function(e,t,n){"use strict";var r=n(44995).has;e.exports=function(e){return r(e),e}},6469:function(e,t,n){"use strict";var r=n(78227),i=n(2360),a=n(24913).f,o=r("unscopables"),s=Array.prototype;void 0===s[o]&&a(s,o,{configurable:!0,value:i(null)}),e.exports=function(e){s[o][e]=!0}},57829:function(e,t,n){"use strict";var r=n(68183).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},90679:function(e,t,n){"use strict";var r=n(1625),i=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw new i("Incorrect invocation")}},28551:function(e,t,n){"use strict";var r=n(20034),i=String,a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(i(e)+" is not an object")}},77811:function(e){"use strict";e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},67394:function(e,t,n){"use strict";var r=n(44576),i=n(46706),a=n(22195),o=r.ArrayBuffer,s=r.TypeError;e.exports=o&&i(o.prototype,"byteLength","get")||function(e){if("ArrayBuffer"!==a(e))throw new s("ArrayBuffer expected");return e.byteLength}},3238:function(e,t,n){"use strict";var r=n(44576),i=n(27476),a=n(67394),o=r.ArrayBuffer,s=o&&o.prototype,u=s&&i(s.slice);e.exports=function(e){if(0!==a(e))return!1;if(!u)return!1;try{return u(e,0,0),!1}catch(e){return!0}}},15652:function(e,t,n){"use strict";var r=n(79039);e.exports=r((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},55169:function(e,t,n){"use strict";var r=n(3238),i=TypeError;e.exports=function(e){if(r(e))throw new i("ArrayBuffer is detached");return e}},95636:function(e,t,n){"use strict";var r=n(44576),i=n(79504),a=n(46706),o=n(57696),s=n(55169),u=n(67394),c=n(94483),l=n(1548),h=r.structuredClone,f=r.ArrayBuffer,m=r.DataView,p=Math.min,d=f.prototype,v=m.prototype,y=i(d.slice),g=a(d,"resizable","get"),b=a(d,"maxByteLength","get"),A=i(v.getInt8),_=i(v.setInt8);e.exports=(l||c)&&function(e,t,n){var r,i=u(e),a=void 0===t?i:o(t),d=!g||!g(e);if(s(e),l&&(e=h(e,{transfer:[e]}),i===a&&(n||d)))return e;if(i>=a&&(!n||d))r=y(e,0,a);else{var v=n&&!d&&b?{maxByteLength:b(e)}:void 0;r=new f(a,v);for(var M=new m(e),k=new m(r),w=p(a,i),T=0;T<w;T++)_(k,T,A(M,T))}return l||c(e),r}},94644:function(e,t,n){"use strict";var r,i,a,o=n(77811),s=n(43724),u=n(44576),c=n(94901),l=n(20034),h=n(39297),f=n(36955),m=n(16823),p=n(66699),d=n(36840),v=n(62106),y=n(1625),g=n(42787),b=n(52967),A=n(78227),_=n(33392),M=n(91181),k=M.enforce,w=M.get,T=u.Int8Array,x=T&&T.prototype,S=u.Uint8ClampedArray,C=S&&S.prototype,E=T&&g(T),R=x&&g(x),I=Object.prototype,O=u.TypeError,D=A("toStringTag"),P=_("TYPED_ARRAY_TAG"),B="TypedArrayConstructor",F=o&&!!b&&"Opera"!==f(u.opera),N=!1,L={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},j={BigInt64Array:8,BigUint64Array:8},U=function(e){var t=g(e);if(l(t)){var n=w(t);return n&&h(n,B)?n[B]:U(t)}},V=function(e){if(!l(e))return!1;var t=f(e);return h(L,t)||h(j,t)};for(r in L)(a=(i=u[r])&&i.prototype)?k(a)[B]=i:F=!1;for(r in j)(a=(i=u[r])&&i.prototype)&&(k(a)[B]=i);if((!F||!c(E)||E===Function.prototype)&&(E=function(){throw new O("Incorrect invocation")},F))for(r in L)u[r]&&b(u[r],E);if((!F||!R||R===I)&&(R=E.prototype,F))for(r in L)u[r]&&b(u[r].prototype,R);if(F&&g(C)!==R&&b(C,R),s&&!h(R,D))for(r in N=!0,v(R,D,{configurable:!0,get:function(){return l(this)?this[P]:void 0}}),L)u[r]&&p(u[r],P,r);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:F,TYPED_ARRAY_TAG:N&&P,aTypedArray:function(e){if(V(e))return e;throw new O("Target is not a typed array")},aTypedArrayConstructor:function(e){if(c(e)&&(!b||y(E,e)))return e;throw new O(m(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(s){if(n)for(var i in L){var a=u[i];if(a&&h(a.prototype,e))try{delete a.prototype[e]}catch(n){try{a.prototype[e]=t}catch(e){}}}R[e]&&!n||d(R,e,n?t:F&&x[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,i;if(s){if(b){if(n)for(r in L)if((i=u[r])&&h(i,e))try{delete i[e]}catch(e){}if(E[e]&&!n)return;try{return d(E,e,n?t:F&&E[e]||t)}catch(e){}}for(r in L)!(i=u[r])||i[e]&&!n||d(i,e,t)}},getTypedArrayConstructor:U,isView:function(e){if(!l(e))return!1;var t=f(e);return"DataView"===t||h(L,t)||h(j,t)},isTypedArray:V,TypedArray:E,TypedArrayPrototype:R}},66346:function(e,t,n){"use strict";var r=n(44576),i=n(79504),a=n(43724),o=n(77811),s=n(10350),u=n(66699),c=n(62106),l=n(56279),h=n(79039),f=n(90679),m=n(91291),p=n(18014),d=n(57696),v=n(15617),y=n(88490),g=n(42787),b=n(52967),A=n(84373),_=n(67680),M=n(23167),k=n(77740),w=n(10687),T=n(91181),x=s.PROPER,S=s.CONFIGURABLE,C="ArrayBuffer",E="DataView",R="prototype",I="Wrong index",O=T.getterFor(C),D=T.getterFor(E),P=T.set,B=r[C],F=B,N=F&&F[R],L=r[E],j=L&&L[R],U=Object.prototype,V=r.Array,z=r.RangeError,H=i(A),G=i([].reverse),q=y.pack,W=y.unpack,K=function(e){return[255&e]},X=function(e){return[255&e,e>>8&255]},Y=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},$=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Z=function(e){return q(v(e),23,4)},Q=function(e){return q(e,52,8)},J=function(e,t,n){c(e[R],t,{configurable:!0,get:function(){return n(this)[t]}})},ee=function(e,t,n,r){var i=D(e),a=d(n),o=!!r;if(a+t>i.byteLength)throw new z(I);var s=i.bytes,u=a+i.byteOffset,c=_(s,u,u+t);return o?c:G(c)},te=function(e,t,n,r,i,a){var o=D(e),s=d(n),u=r(+i),c=!!a;if(s+t>o.byteLength)throw new z(I);for(var l=o.bytes,h=s+o.byteOffset,f=0;f<t;f++)l[h+f]=u[c?f:t-f-1]};if(o){var ne=x&&B.name!==C;h((function(){B(1)}))&&h((function(){new B(-1)}))&&!h((function(){return new B,new B(1.5),new B(NaN),1!==B.length||ne&&!S}))?ne&&S&&u(B,"name",C):((F=function(e){return f(this,N),M(new B(d(e)),this,F)})[R]=N,N.constructor=F,k(F,B)),b&&g(j)!==U&&b(j,U);var re=new L(new F(2)),ie=i(j.setInt8);re.setInt8(0,2147483648),re.setInt8(1,2147483649),!re.getInt8(0)&&re.getInt8(1)||l(j,{setInt8:function(e,t){ie(this,e,t<<24>>24)},setUint8:function(e,t){ie(this,e,t<<24>>24)}},{unsafe:!0})}else N=(F=function(e){f(this,N);var t=d(e);P(this,{type:C,bytes:H(V(t),0),byteLength:t}),a||(this.byteLength=t,this.detached=!1)})[R],j=(L=function(e,t,n){f(this,j),f(e,N);var r=O(e),i=r.byteLength,o=m(t);if(o<0||o>i)throw new z("Wrong offset");if(o+(n=void 0===n?i-o:p(n))>i)throw new z("Wrong length");P(this,{type:E,buffer:e,byteLength:n,byteOffset:o,bytes:r.bytes}),a||(this.buffer=e,this.byteLength=n,this.byteOffset=o)})[R],a&&(J(F,"byteLength",O),J(L,"buffer",D),J(L,"byteLength",D),J(L,"byteOffset",D)),l(j,{getInt8:function(e){return ee(this,1,e)[0]<<24>>24},getUint8:function(e){return ee(this,1,e)[0]},getInt16:function(e){var t=ee(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=ee(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return $(ee(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return $(ee(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return W(ee(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return W(ee(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){te(this,1,e,K,t)},setUint8:function(e,t){te(this,1,e,K,t)},setInt16:function(e,t){te(this,2,e,X,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){te(this,2,e,X,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){te(this,4,e,Y,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){te(this,4,e,Y,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){te(this,4,e,Z,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){te(this,8,e,Q,t,arguments.length>2&&arguments[2])}});w(F,C),w(L,E),e.exports={ArrayBuffer:F,DataView:L}},57029:function(e,t,n){"use strict";var r=n(48981),i=n(35610),a=n(26198),o=n(84606),s=Math.min;e.exports=[].copyWithin||function(e,t){var n=r(this),u=a(n),c=i(e,u),l=i(t,u),h=arguments.length>2?arguments[2]:void 0,f=s((void 0===h?u:i(h,u))-l,u-c),m=1;for(l<c&&c<l+f&&(m=-1,l+=f-1,c+=f-1);f-- >0;)l in n?n[c]=n[l]:o(n,c),c+=m,l+=m;return n}},84373:function(e,t,n){"use strict";var r=n(48981),i=n(35610),a=n(26198);e.exports=function(e){for(var t=r(this),n=a(t),o=arguments.length,s=i(o>1?arguments[1]:void 0,n),u=o>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>s;)t[s++]=e;return t}},90235:function(e,t,n){"use strict";var r=n(59213).forEach,i=n(34598)("forEach");e.exports=i?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},35370:function(e,t,n){"use strict";var r=n(26198);e.exports=function(e,t,n){for(var i=0,a=arguments.length>2?n:r(t),o=new e(a);a>i;)o[i]=t[i++];return o}},97916:function(e,t,n){"use strict";var r=n(76080),i=n(69565),a=n(48981),o=n(96319),s=n(44209),u=n(33517),c=n(26198),l=n(97040),h=n(70081),f=n(50851),m=Array;e.exports=function(e){var t=a(e),n=u(this),p=arguments.length,d=p>1?arguments[1]:void 0,v=void 0!==d;v&&(d=r(d,p>2?arguments[2]:void 0));var y,g,b,A,_,M,k=f(t),w=0;if(!k||this===m&&s(k))for(y=c(t),g=n?new this(y):m(y);y>w;w++)M=v?d(t[w],w):t[w],l(g,w,M);else for(g=n?new this:[],_=(A=h(t,k)).next;!(b=i(_,A)).done;w++)M=v?o(A,d,[b.value,w],!0):b.value,l(g,w,M);return g.length=w,g}},77957:function(e,t,n){"use strict";var r=n(76080),i=n(79504),a=n(47055),o=n(48981),s=n(56969),u=n(26198),c=n(2360),l=n(35370),h=Array,f=i([].push);e.exports=function(e,t,n,i){for(var m,p,d,v=o(e),y=a(v),g=r(t,n),b=c(null),A=u(y),_=0;A>_;_++)d=y[_],(p=s(g(d,_,v)))in b?f(b[p],d):b[p]=[d];if(i&&(m=i(v))!==h)for(p in b)b[p]=l(m,b[p]);return b}},19617:function(e,t,n){"use strict";var r=n(25397),i=n(35610),a=n(26198),o=function(e){return function(t,n,o){var s=r(t),u=a(s);if(0===u)return!e&&-1;var c,l=i(o,u);if(e&&n!=n){for(;u>l;)if((c=s[l++])!=c)return!0}else for(;u>l;l++)if((e||l in s)&&s[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},43839:function(e,t,n){"use strict";var r=n(76080),i=n(47055),a=n(48981),o=n(26198),s=function(e){var t=1===e;return function(n,s,u){for(var c,l=a(n),h=i(l),f=o(h),m=r(s,u);f-- >0;)if(m(c=h[f],f,l))switch(e){case 0:return c;case 1:return f}return t?-1:void 0}};e.exports={findLast:s(0),findLastIndex:s(1)}},59213:function(e,t,n){"use strict";var r=n(76080),i=n(79504),a=n(47055),o=n(48981),s=n(26198),u=n(1469),c=i([].push),l=function(e){var t=1===e,n=2===e,i=3===e,l=4===e,h=6===e,f=7===e,m=5===e||h;return function(p,d,v,y){for(var g,b,A=o(p),_=a(A),M=s(_),k=r(d,v),w=0,T=y||u,x=t?T(p,M):n||f?T(p,0):void 0;M>w;w++)if((m||w in _)&&(b=k(g=_[w],w,A),e))if(t)x[w]=b;else if(b)switch(e){case 3:return!0;case 5:return g;case 6:return w;case 2:c(x,g)}else switch(e){case 4:return!1;case 7:c(x,g)}return h?-1:i||l?l:x}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},8379:function(e,t,n){"use strict";var r=n(18745),i=n(25397),a=n(91291),o=n(26198),s=n(34598),u=Math.min,c=[].lastIndexOf,l=!!c&&1/[1].lastIndexOf(1,-0)<0,h=s("lastIndexOf"),f=l||!h;e.exports=f?function(e){if(l)return r(c,this,arguments)||0;var t=i(this),n=o(t);if(0===n)return-1;var s=n-1;for(arguments.length>1&&(s=u(s,a(arguments[1]))),s<0&&(s=n+s);s>=0;s--)if(s in t&&t[s]===e)return s||0;return-1}:c},70597:function(e,t,n){"use strict";var r=n(79039),i=n(78227),a=n(39519),o=i("species");e.exports=function(e){return a>=51||!r((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},34598:function(e,t,n){"use strict";var r=n(79039);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},80926:function(e,t,n){"use strict";var r=n(79306),i=n(48981),a=n(47055),o=n(26198),s=TypeError,u="Reduce of empty array with no initial value",c=function(e){return function(t,n,c,l){var h=i(t),f=a(h),m=o(h);if(r(n),0===m&&c<2)throw new s(u);var p=e?m-1:0,d=e?-1:1;if(c<2)for(;;){if(p in f){l=f[p],p+=d;break}if(p+=d,e?p<0:m<=p)throw new s(u)}for(;e?p>=0:m>p;p+=d)p in f&&(l=n(l,f[p],p,h));return l}};e.exports={left:c(!1),right:c(!0)}},34527:function(e,t,n){"use strict";var r=n(43724),i=n(34376),a=TypeError,o=Object.getOwnPropertyDescriptor,s=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(i(e)&&!o(e,"length").writable)throw new a("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},67680:function(e,t,n){"use strict";var r=n(79504);e.exports=r([].slice)},74488:function(e,t,n){"use strict";var r=n(67680),i=Math.floor,a=function(e,t){var n=e.length;if(n<8)for(var o,s,u=1;u<n;){for(s=u,o=e[u];s&&t(e[s-1],o)>0;)e[s]=e[--s];s!==u++&&(e[s]=o)}else for(var c=i(n/2),l=a(r(e,0,c),t),h=a(r(e,c),t),f=l.length,m=h.length,p=0,d=0;p<f||d<m;)e[p+d]=p<f&&d<m?t(l[p],h[d])<=0?l[p++]:h[d++]:p<f?l[p++]:h[d++];return e};e.exports=a},87433:function(e,t,n){"use strict";var r=n(34376),i=n(33517),a=n(20034),o=n(78227)("species"),s=Array;e.exports=function(e){var t;return r(e)&&(t=e.constructor,(i(t)&&(t===s||r(t.prototype))||a(t)&&null===(t=t[o]))&&(t=void 0)),void 0===t?s:t}},1469:function(e,t,n){"use strict";var r=n(87433);e.exports=function(e,t){return new(r(e))(0===t?0:t)}},37628:function(e,t,n){"use strict";var r=n(26198);e.exports=function(e,t){for(var n=r(e),i=new t(n),a=0;a<n;a++)i[a]=e[n-a-1];return i}},79565:function(e,t,n){"use strict";var r=n(79504),i=n(79306),a=n(64117),o=n(26198),s=n(48981),u=n(72248),c=n(26223),l=u.Map,h=u.has,f=u.set,m=r([].push);e.exports=function(e){var t,n,r,u=s(this),p=o(u),d=[],v=new l,y=a(e)?function(e){return e}:i(e);for(t=0;t<p;t++)r=y(n=u[t]),h(v,r)||f(v,r,n);return c(v,(function(e){m(d,e)})),d}},39928:function(e,t,n){"use strict";var r=n(26198),i=n(91291),a=RangeError;e.exports=function(e,t,n,o){var s=r(e),u=i(n),c=u<0?s+u:u;if(c>=s||c<0)throw new a("Incorrect index");for(var l=new t(s),h=0;h<s;h++)l[h]=h===c?o:e[h];return l}},20772:function(e,t,n){"use strict";var r=n(69565),i=n(97751),a=n(55966);e.exports=function(e,t,n,o){try{var s=a(e,"return");if(s)return i("Promise").resolve(r(s,e)).then((function(){t(n)}),(function(e){o(e)}))}catch(e){return o(e)}t(n)}},92059:function(e,t,n){"use strict";var r=n(69565),i=n(1103),a=n(28551),o=n(2360),s=n(66699),u=n(56279),c=n(78227),l=n(91181),h=n(97751),f=n(55966),m=n(53982),p=n(62529),d=n(9539),v=h("Promise"),y=c("toStringTag"),g="AsyncIteratorHelper",b="WrapForValidAsyncIterator",A=l.set,_=function(e){var t=!e,n=l.getterFor(e?b:g),s=function(e){var r=i((function(){return n(e)})),a=r.error,o=r.value;return a||t&&o.done?{exit:!0,value:a?v.reject(o):v.resolve(p(void 0,!0))}:{exit:!1,value:o}};return u(o(m),{next:function(){var e=s(this),t=e.value;if(e.exit)return t;var n=i((function(){return a(t.nextHandler(v))})),r=n.error,o=n.value;return r&&(t.done=!0),r?v.reject(o):v.resolve(o)},return:function(){var t=s(this),n=t.value;if(t.exit)return n;n.done=!0;var o,u,c=n.iterator,l=i((function(){if(n.inner)try{d(n.inner.iterator,"normal")}catch(e){return d(c,"throw",e)}return f(c,"return")}));return o=u=l.value,l.error?v.reject(u):void 0===o?v.resolve(p(void 0,!0)):(u=(l=i((function(){return r(o,c)}))).value,l.error?v.reject(u):e?v.resolve(u):v.resolve(u).then((function(e){return a(e),p(void 0,!0)})))}})},M=_(!0),k=_(!1);s(k,y,"Async Iterator Helper"),e.exports=function(e,t){var n=function(n,r){r?(r.iterator=n.iterator,r.next=n.next):r=n,r.type=t?b:g,r.nextHandler=e,r.counter=0,r.done=!1,A(this,r)};return n.prototype=t?M:k,n}},36639:function(e,t,n){"use strict";var r=n(69565),i=n(79306),a=n(28551),o=n(20034),s=n(96837),u=n(97751),c=n(1767),l=n(20772),h=function(e){var t=0===e,n=1===e,h=2===e,f=3===e;return function(e,m,p){a(e);var d=void 0!==m;!d&&t||i(m);var v=c(e),y=u("Promise"),g=v.iterator,b=v.next,A=0;return new y((function(e,i){var u=function(e){l(g,i,e,i)},c=function(){try{if(d)try{s(A)}catch(e){u(e)}y.resolve(a(r(b,g))).then((function(r){try{if(a(r).done)t?(p.length=A,e(p)):e(!f&&(h||void 0));else{var s=r.value;try{if(d){var v=m(s,A),b=function(r){if(n)c();else if(h)r?c():l(g,e,!1,i);else if(t)try{p[A++]=r,c()}catch(e){u(e)}else r?l(g,e,f||s,i):c()};o(v)?y.resolve(v).then(b,u):b(v)}else p[A++]=s,c()}catch(e){u(e)}}}catch(e){i(e)}}),i)}catch(e){i(e)}};c()}))}};e.exports={toArray:h(0),forEach:h(1),every:h(2),some:h(3),find:h(4)}},41750:function(e,t,n){"use strict";var r=n(69565),i=n(79306),a=n(28551),o=n(20034),s=n(1767),u=n(92059),c=n(62529),l=n(20772),h=u((function(e){var t=this,n=t.iterator,i=t.mapper;return new e((function(s,u){var h=function(e){t.done=!0,u(e)},f=function(e){l(n,h,e,h)};e.resolve(a(r(t.next,n))).then((function(n){try{if(a(n).done)t.done=!0,s(c(void 0,!0));else{var r=n.value;try{var u=i(r,t.counter++),l=function(e){s(c(e,!1))};o(u)?e.resolve(u).then(l,f):l(u)}catch(e){f(e)}}}catch(e){h(e)}}),h)}))}));e.exports=function(e){return a(this),i(e),new h(s(this),{mapper:e})}},53982:function(e,t,n){"use strict";var r,i,a=n(44576),o=n(77629),s=n(94901),u=n(2360),c=n(42787),l=n(36840),h=n(78227),f=n(96395),m="USE_FUNCTION_CONSTRUCTOR",p=h("asyncIterator"),d=a.AsyncIterator,v=o.AsyncIteratorPrototype;if(v)r=v;else if(s(d))r=d.prototype;else if(o[m]||a[m])try{i=c(c(c(Function("return async function*(){}()")()))),c(i)===Object.prototype&&(r=i)}catch(e){}r?f&&(r=u(r)):r={},s(r[p])||l(r,p,(function(){return this})),e.exports=r},92804:function(e){"use strict";var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=t+"+/",r=t+"-_",i=function(e){for(var t={},n=0;n<64;n++)t[e.charAt(n)]=n;return t};e.exports={i2c:n,c2i:i(n),i2cUrl:r,c2iUrl:i(r)}},96319:function(e,t,n){"use strict";var r=n(28551),i=n(9539);e.exports=function(e,t,n,a){try{return a?t(r(n)[0],n[1]):t(n)}catch(t){i(e,"throw",t)}}},84428:function(e,t,n){"use strict";var r=n(78227)("iterator"),i=!1;try{var a=0,o={next:function(){return{done:!!a++}},return:function(){i=!0}};o[r]=function(){return this},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){try{if(!t&&!i)return!1}catch(e){return!1}var n=!1;try{var a={};a[r]=function(){return{next:function(){return{done:n=!0}}}},e(a)}catch(e){}return n}},22195:function(e,t,n){"use strict";var r=n(79504),i=r({}.toString),a=r("".slice);e.exports=function(e){return a(i(e),8,-1)}},36955:function(e,t,n){"use strict";var r=n(92140),i=n(94901),a=n(22195),o=n(78227)("toStringTag"),s=Object,u="Arguments"===a(function(){return arguments}());e.exports=r?a:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),o))?n:u?a(t):"Object"===(r=a(t))&&i(t.callee)?"Arguments":r}},86938:function(e,t,n){"use strict";var r=n(2360),i=n(62106),a=n(56279),o=n(76080),s=n(90679),u=n(64117),c=n(72652),l=n(51088),h=n(62529),f=n(87633),m=n(43724),p=n(3451).fastKey,d=n(91181),v=d.set,y=d.getterFor;e.exports={getConstructor:function(e,t,n,l){var h=e((function(e,i){s(e,f),v(e,{type:t,index:r(null),first:null,last:null,size:0}),m||(e.size=0),u(i)||c(i,e[l],{that:e,AS_ENTRIES:n})})),f=h.prototype,d=y(t),g=function(e,t,n){var r,i,a=d(e),o=b(e,t);return o?o.value=n:(a.last=o={index:i=p(t,!0),key:t,value:n,previous:r=a.last,next:null,removed:!1},a.first||(a.first=o),r&&(r.next=o),m?a.size++:e.size++,"F"!==i&&(a.index[i]=o)),e},b=function(e,t){var n,r=d(e),i=p(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key===t)return n};return a(f,{clear:function(){for(var e=d(this),t=e.first;t;)t.removed=!0,t.previous&&(t.previous=t.previous.next=null),t=t.next;e.first=e.last=null,e.index=r(null),m?e.size=0:this.size=0},delete:function(e){var t=this,n=d(t),r=b(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first===r&&(n.first=i),n.last===r&&(n.last=a),m?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=d(this),r=o(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!b(this,e)}}),a(f,n?{get:function(e){var t=b(this,e);return t&&t.value},set:function(e,t){return g(this,0===e?0:e,t)}}:{add:function(e){return g(this,e=0===e?0:e,e)}}),m&&i(f,"size",{configurable:!0,get:function(){return d(this).size}}),h},setStrong:function(e,t,n){var r=t+" Iterator",i=y(t),a=y(r);l(e,t,(function(e,t){v(this,{type:r,target:e,state:i(e),kind:t,last:null})}),(function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?h("keys"===t?n.key:"values"===t?n.value:[n.key,n.value],!1):(e.target=null,h(void 0,!0))}),n?"entries":"values",!n,!0),f(t)}}},91625:function(e,t,n){"use strict";var r=n(79504),i=n(56279),a=n(3451).getWeakData,o=n(90679),s=n(28551),u=n(64117),c=n(20034),l=n(72652),h=n(59213),f=n(39297),m=n(91181),p=m.set,d=m.getterFor,v=h.find,y=h.findIndex,g=r([].splice),b=0,A=function(e){return e.frozen||(e.frozen=new _)},_=function(){this.entries=[]},M=function(e,t){return v(e.entries,(function(e){return e[0]===t}))};_.prototype={get:function(e){var t=M(this,e);if(t)return t[1]},has:function(e){return!!M(this,e)},set:function(e,t){var n=M(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=y(this.entries,(function(t){return t[0]===e}));return~t&&g(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,n,r){var h=e((function(e,i){o(e,m),p(e,{type:t,id:b++,frozen:null}),u(i)||l(i,e[r],{that:e,AS_ENTRIES:n})})),m=h.prototype,v=d(t),y=function(e,t,n){var r=v(e),i=a(s(t),!0);return!0===i?A(r).set(t,n):i[r.id]=n,e};return i(m,{delete:function(e){var t=v(this);if(!c(e))return!1;var n=a(e);return!0===n?A(t).delete(e):n&&f(n,t.id)&&delete n[t.id]},has:function(e){var t=v(this);if(!c(e))return!1;var n=a(e);return!0===n?A(t).has(e):n&&f(n,t.id)}}),i(m,n?{get:function(e){var t=v(this);if(c(e)){var n=a(e);if(!0===n)return A(t).get(e);if(n)return n[t.id]}},set:function(e,t){return y(this,e,t)}}:{add:function(e){return y(this,e,!0)}}),h}}},16468:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(79504),o=n(92796),s=n(36840),u=n(3451),c=n(72652),l=n(90679),h=n(94901),f=n(64117),m=n(20034),p=n(79039),d=n(84428),v=n(10687),y=n(23167);e.exports=function(e,t,n){var g=-1!==e.indexOf("Map"),b=-1!==e.indexOf("Weak"),A=g?"set":"add",_=i[e],M=_&&_.prototype,k=_,w={},T=function(e){var t=a(M[e]);s(M,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(b&&!m(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return b&&!m(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(b&&!m(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(o(e,!h(_)||!(b||M.forEach&&!p((function(){(new _).entries().next()})))))k=n.getConstructor(t,e,g,A),u.enable();else if(o(e,!0)){var x=new k,S=x[A](b?{}:-0,1)!==x,C=p((function(){x.has(1)})),E=d((function(e){new _(e)})),R=!b&&p((function(){for(var e=new _,t=5;t--;)e[A](t,t);return!e.has(-0)}));E||((k=t((function(e,t){l(e,M);var n=y(new _,e,k);return f(t)||c(t,n[A],{that:n,AS_ENTRIES:g}),n}))).prototype=M,M.constructor=k),(C||R)&&(T("delete"),T("has"),g&&T("get")),(R||S)&&T(A),b&&M.clear&&delete M.clear}return w[e]=k,r({global:!0,constructor:!0,forced:k!==_},w),v(k,e),b||n.setStrong(k,e,g),k}},77740:function(e,t,n){"use strict";var r=n(39297),i=n(35031),a=n(77347),o=n(24913);e.exports=function(e,t,n){for(var s=i(t),u=o.f,c=a.f,l=0;l<s.length;l++){var h=s[l];r(e,h)||n&&r(n,h)||u(e,h,c(t,h))}}},41436:function(e,t,n){"use strict";var r=n(78227)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},12211:function(e,t,n){"use strict";var r=n(79039);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},77240:function(e,t,n){"use strict";var r=n(79504),i=n(67750),a=n(655),o=/"/g,s=r("".replace);e.exports=function(e,t,n,r){var u=a(i(e)),c="<"+t;return""!==n&&(c+=" "+n+'="'+s(a(r),o,"&quot;")+'"'),c+">"+u+"</"+t+">"}},62529:function(e){"use strict";e.exports=function(e,t){return{value:e,done:t}}},66699:function(e,t,n){"use strict";var r=n(43724),i=n(24913),a=n(6980);e.exports=r?function(e,t,n){return i.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},6980:function(e){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},97040:function(e,t,n){"use strict";var r=n(43724),i=n(24913),a=n(6980);e.exports=function(e,t,n){r?i.f(e,t,a(0,n)):e[t]=n}},62106:function(e,t,n){"use strict";var r=n(50283),i=n(24913);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),i.f(e,t,n)}},36840:function(e,t,n){"use strict";var r=n(94901),i=n(24913),a=n(50283),o=n(39433);e.exports=function(e,t,n,s){s||(s={});var u=s.enumerable,c=void 0!==s.name?s.name:t;if(r(n)&&a(n,c,s),s.global)u?e[t]=n:o(t,n);else{try{s.unsafe?e[t]&&(u=!0):delete e[t]}catch(e){}u?e[t]=n:i.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},56279:function(e,t,n){"use strict";var r=n(36840);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},39433:function(e,t,n){"use strict";var r=n(44576),i=Object.defineProperty;e.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},84606:function(e,t,n){"use strict";var r=n(16823),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw new i("Cannot delete property "+r(t)+" of "+r(e))}},43724:function(e,t,n){"use strict";var r=n(79039);e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},94483:function(e,t,n){"use strict";var r,i,a,o,s=n(44576),u=n(89429),c=n(1548),l=s.structuredClone,h=s.ArrayBuffer,f=s.MessageChannel,m=!1;if(c)m=function(e){l(e,{transfer:[e]})};else if(h)try{f||(r=u("worker_threads"))&&(f=r.MessageChannel),f&&(i=new f,a=new h(2),o=function(e){i.port1.postMessage(null,[e])},2===a.byteLength&&(o(a),0===a.byteLength&&(m=o)))}catch(e){}e.exports=m},4055:function(e,t,n){"use strict";var r=n(44576),i=n(20034),a=r.document,o=i(a)&&i(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},96837:function(e){"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},55002:function(e){"use strict";e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},67400:function(e){"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},79296:function(e,t,n){"use strict";var r=n(4055)("span").classList,i=r&&r.constructor&&r.constructor.prototype;e.exports=i===Object.prototype?void 0:i},88727:function(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},13709:function(e,t,n){"use strict";var r=n(82839).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},13763:function(e,t,n){"use strict";var r=n(82839);e.exports=/MSIE|Trident/.test(r)},44265:function(e,t,n){"use strict";var r=n(82839);e.exports=/ipad|iphone|ipod/i.test(r)&&"undefined"!=typeof Pebble},89544:function(e,t,n){"use strict";var r=n(82839);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},16193:function(e,t,n){"use strict";var r=n(84215);e.exports="NODE"===r},7860:function(e,t,n){"use strict";var r=n(82839);e.exports=/web0s(?!.*chrome)/i.test(r)},82839:function(e,t,n){"use strict";var r=n(44576).navigator,i=r&&r.userAgent;e.exports=i?String(i):""},39519:function(e,t,n){"use strict";var r,i,a=n(44576),o=n(82839),s=a.process,u=a.Deno,c=s&&s.versions||u&&u.version,l=c&&c.v8;l&&(i=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(i=+r[1]),e.exports=i},3607:function(e,t,n){"use strict";var r=n(82839).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},84215:function(e,t,n){"use strict";var r=n(44576),i=n(82839),a=n(22195),o=function(e){return i.slice(0,e.length)===e};e.exports=o("Bun/")?"BUN":o("Cloudflare-Workers")?"CLOUDFLARE":o("Deno/")?"DENO":o("Node.js/")?"NODE":r.Bun&&"string"==typeof Bun.version?"BUN":r.Deno&&"object"==typeof Deno.version?"DENO":"process"===a(r.process)?"NODE":r.window&&r.document?"BROWSER":"REST"},38574:function(e,t,n){"use strict";var r=n(79504),i=Error,a=r("".replace),o=String(new i("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,u=s.test(o);e.exports=function(e,t){if(u&&"string"==typeof e&&!i.prepareStackTrace)for(;t--;)e=a(e,s,"");return e}},80747:function(e,t,n){"use strict";var r=n(66699),i=n(38574),a=n(24659),o=Error.captureStackTrace;e.exports=function(e,t,n,s){a&&(o?o(e,t):r(e,"stack",i(n,s)))}},24659:function(e,t,n){"use strict";var r=n(79039),i=n(6980);e.exports=!r((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)}))},77536:function(e,t,n){"use strict";var r=n(43724),i=n(79039),a=n(28551),o=n(32603),s=Error.prototype.toString,u=i((function(){if(r){var e=Object.create(Object.defineProperty({},"name",{get:function(){return this===e}}));if("true"!==s.call(e))return!0}return"2: 1"!==s.call({message:1,name:2})||"Error"!==s.call({})}));e.exports=u?function(){var e=a(this),t=o(e.name,"Error"),n=o(e.message);return t?n?t+": "+n:t:n}:s},46518:function(e,t,n){"use strict";var r=n(44576),i=n(77347).f,a=n(66699),o=n(36840),s=n(39433),u=n(77740),c=n(92796);e.exports=function(e,t){var n,l,h,f,m,p=e.target,d=e.global,v=e.stat;if(n=d?r:v?r[p]||s(p,{}):r[p]&&r[p].prototype)for(l in t){if(f=t[l],h=e.dontCallGetSet?(m=i(n,l))&&m.value:n[l],!c(d?l:p+(v?".":"#")+l,e.forced)&&void 0!==h){if(typeof f==typeof h)continue;u(f,h)}(e.sham||h&&h.sham)&&a(f,"sham",!0),o(n,l,f,e)}}},79039:function(e){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},89228:function(e,t,n){"use strict";n(27495);var r=n(69565),i=n(36840),a=n(57323),o=n(79039),s=n(78227),u=n(66699),c=s("species"),l=RegExp.prototype;e.exports=function(e,t,n,h){var f=s(e),m=!o((function(){var t={};return t[f]=function(){return 7},7!==""[e](t)})),p=m&&!o((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[f]=/./[f]),n.exec=function(){return t=!0,null},n[f](""),!t}));if(!m||!p||n){var d=/./[f],v=t(f,""[e],(function(e,t,n,i,o){var s=t.exec;return s===a||s===l.exec?m&&!o?{done:!0,value:r(d,t,n,i)}:{done:!0,value:r(e,n,t,i)}:{done:!1}}));i(String.prototype,e,v[0]),i(l,f,v[1])}h&&u(l[f],"sham",!0)}},92744:function(e,t,n){"use strict";var r=n(79039);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},18745:function(e,t,n){"use strict";var r=n(40616),i=Function.prototype,a=i.apply,o=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?o.bind(a):function(){return o.apply(a,arguments)})},76080:function(e,t,n){"use strict";var r=n(27476),i=n(79306),a=n(40616),o=r(r.bind);e.exports=function(e,t){return i(e),void 0===t?e:a?o(e,t):function(){return e.apply(t,arguments)}}},40616:function(e,t,n){"use strict";var r=n(79039);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},30566:function(e,t,n){"use strict";var r=n(79504),i=n(79306),a=n(20034),o=n(39297),s=n(67680),u=n(40616),c=Function,l=r([].concat),h=r([].join),f={};e.exports=u?c.bind:function(e){var t=i(this),n=t.prototype,r=s(arguments,1),u=function(){var n=l(r,s(arguments));return this instanceof u?function(e,t,n){if(!o(f,t)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";f[t]=c("C,a","return new C("+h(r,",")+")")}return f[t](e,n)}(t,n.length,n):t.apply(e,n)};return a(n)&&(u.prototype=n),u}},69565:function(e,t,n){"use strict";var r=n(40616),i=Function.prototype.call;e.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},10350:function(e,t,n){"use strict";var r=n(43724),i=n(39297),a=Function.prototype,o=r&&Object.getOwnPropertyDescriptor,s=i(a,"name"),u=s&&"something"===function(){}.name,c=s&&(!r||r&&o(a,"name").configurable);e.exports={EXISTS:s,PROPER:u,CONFIGURABLE:c}},46706:function(e,t,n){"use strict";var r=n(79504),i=n(79306);e.exports=function(e,t,n){try{return r(i(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},27476:function(e,t,n){"use strict";var r=n(22195),i=n(79504);e.exports=function(e){if("Function"===r(e))return i(e)}},79504:function(e,t,n){"use strict";var r=n(40616),i=Function.prototype,a=i.call,o=r&&i.bind.bind(a,a);e.exports=r?o:function(e){return function(){return a.apply(e,arguments)}}},89429:function(e,t,n){"use strict";var r=n(44576),i=n(16193);e.exports=function(e){if(i){try{return r.process.getBuiltinModule(e)}catch(e){}try{return Function('return require("'+e+'")')()}catch(e){}}}},97751:function(e,t,n){"use strict";var r=n(44576),i=n(94901);e.exports=function(e,t){return arguments.length<2?(n=r[e],i(n)?n:void 0):r[e]&&r[e][t];var n}},1767:function(e){"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},50851:function(e,t,n){"use strict";var r=n(36955),i=n(55966),a=n(64117),o=n(26269),s=n(78227)("iterator");e.exports=function(e){if(!a(e))return i(e,s)||i(e,"@@iterator")||o[r(e)]}},70081:function(e,t,n){"use strict";var r=n(69565),i=n(79306),a=n(28551),o=n(16823),s=n(50851),u=TypeError;e.exports=function(e,t){var n=arguments.length<2?s(e):t;if(i(n))return a(r(n,e));throw new u(o(e)+" is not iterable")}},66933:function(e,t,n){"use strict";var r=n(79504),i=n(34376),a=n(94901),o=n(22195),s=n(655),u=r([].push);e.exports=function(e){if(a(e))return e;if(i(e)){for(var t=e.length,n=[],r=0;r<t;r++){var c=e[r];"string"==typeof c?u(n,c):"number"!=typeof c&&"Number"!==o(c)&&"String"!==o(c)||u(n,s(c))}var l=n.length,h=!0;return function(e,t){if(h)return h=!1,t;if(i(this))return t;for(var r=0;r<l;r++)if(n[r]===e)return t}}}},55966:function(e,t,n){"use strict";var r=n(79306),i=n(64117);e.exports=function(e,t){var n=e[t];return i(n)?void 0:r(n)}},83789:function(e,t,n){"use strict";var r=n(79306),i=n(28551),a=n(69565),o=n(91291),s=n(1767),u="Invalid size",c=RangeError,l=TypeError,h=Math.max,f=function(e,t){this.set=e,this.size=h(t,0),this.has=r(e.has),this.keys=r(e.keys)};f.prototype={getIterator:function(){return s(i(a(this.keys,this.set)))},includes:function(e){return a(this.has,this.set,e)}},e.exports=function(e){i(e);var t=+e.size;if(t!=t)throw new l(u);var n=o(t);if(n<0)throw new c(u);return new f(e,n)}},2478:function(e,t,n){"use strict";var r=n(79504),i=n(48981),a=Math.floor,o=r("".charAt),s=r("".replace),u=r("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,h,f){var m=n+e.length,p=r.length,d=l;return void 0!==h&&(h=i(h),d=c),s(f,d,(function(i,s){var c;switch(o(s,0)){case"$":return"$";case"&":return e;case"`":return u(t,0,n);case"'":return u(t,m);case"<":c=h[u(s,1,-1)];break;default:var l=+s;if(0===l)return i;if(l>p){var f=a(l/10);return 0===f?i:f<=p?void 0===r[f-1]?o(s,1):r[f-1]+o(s,1):i}c=r[l-1]}return void 0===c?"":c}))}},44576:function(e,t,n){"use strict";var r=function(e){return e&&e.Math===Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||r("object"==typeof this&&this)||function(){return this}()||Function("return this")()},39297:function(e,t,n){"use strict";var r=n(79504),i=n(48981),a=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return a(i(e),t)}},30421:function(e){"use strict";e.exports={}},90757:function(e){"use strict";e.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},20397:function(e,t,n){"use strict";var r=n(97751);e.exports=r("document","documentElement")},35917:function(e,t,n){"use strict";var r=n(43724),i=n(79039),a=n(4055);e.exports=!r&&!i((function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},88490:function(e){"use strict";var t=Array,n=Math.abs,r=Math.pow,i=Math.floor,a=Math.log,o=Math.LN2;e.exports={pack:function(e,s,u){var c,l,h,f=t(u),m=8*u-s-1,p=(1<<m)-1,d=p>>1,v=23===s?r(2,-24)-r(2,-77):0,y=e<0||0===e&&1/e<0?1:0,g=0;for((e=n(e))!=e||e===1/0?(l=e!=e?1:0,c=p):(c=i(a(e)/o),e*(h=r(2,-c))<1&&(c--,h*=2),(e+=c+d>=1?v/h:v*r(2,1-d))*h>=2&&(c++,h/=2),c+d>=p?(l=0,c=p):c+d>=1?(l=(e*h-1)*r(2,s),c+=d):(l=e*r(2,d-1)*r(2,s),c=0));s>=8;)f[g++]=255&l,l/=256,s-=8;for(c=c<<s|l,m+=s;m>0;)f[g++]=255&c,c/=256,m-=8;return f[g-1]|=128*y,f},unpack:function(e,t){var n,i=e.length,a=8*i-t-1,o=(1<<a)-1,s=o>>1,u=a-7,c=i-1,l=e[c--],h=127&l;for(l>>=7;u>0;)h=256*h+e[c--],u-=8;for(n=h&(1<<-u)-1,h>>=-u,u+=t;u>0;)n=256*n+e[c--],u-=8;if(0===h)h=1-s;else{if(h===o)return n?NaN:l?-1/0:1/0;n+=r(2,t),h-=s}return(l?-1:1)*n*r(2,h-t)}}},47055:function(e,t,n){"use strict";var r=n(79504),i=n(79039),a=n(22195),o=Object,s=r("".split);e.exports=i((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"===a(e)?s(e,""):o(e)}:o},23167:function(e,t,n){"use strict";var r=n(94901),i=n(20034),a=n(52967);e.exports=function(e,t,n){var o,s;return a&&r(o=t.constructor)&&o!==n&&i(s=o.prototype)&&s!==n.prototype&&a(e,s),e}},33706:function(e,t,n){"use strict";var r=n(79504),i=n(94901),a=n(77629),o=r(Function.toString);i(a.inspectSource)||(a.inspectSource=function(e){return o(e)}),e.exports=a.inspectSource},77584:function(e,t,n){"use strict";var r=n(20034),i=n(66699);e.exports=function(e,t){r(t)&&"cause"in t&&i(e,"cause",t.cause)}},3451:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(30421),o=n(20034),s=n(39297),u=n(24913).f,c=n(38480),l=n(10298),h=n(34124),f=n(33392),m=n(92744),p=!1,d=f("meta"),v=0,y=function(e){u(e,d,{value:{objectID:"O"+v++,weakData:{}}})},g=e.exports={enable:function(){g.enable=function(){},p=!0;var e=c.f,t=i([].splice),n={};n[d]=1,e(n).length&&(c.f=function(n){for(var r=e(n),i=0,a=r.length;i<a;i++)if(r[i]===d){t(r,i,1);break}return r},r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:l.f}))},fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,d)){if(!h(e))return"F";if(!t)return"E";y(e)}return e[d].objectID},getWeakData:function(e,t){if(!s(e,d)){if(!h(e))return!0;if(!t)return!1;y(e)}return e[d].weakData},onFreeze:function(e){return m&&p&&h(e)&&!s(e,d)&&y(e),e}};a[d]=!0},91181:function(e,t,n){"use strict";var r,i,a,o=n(58622),s=n(44576),u=n(20034),c=n(66699),l=n(39297),h=n(77629),f=n(66119),m=n(30421),p="Object already initialized",d=s.TypeError,v=s.WeakMap;if(o||h.state){var y=h.state||(h.state=new v);y.get=y.get,y.has=y.has,y.set=y.set,r=function(e,t){if(y.has(e))throw new d(p);return t.facade=e,y.set(e,t),t},i=function(e){return y.get(e)||{}},a=function(e){return y.has(e)}}else{var g=f("state");m[g]=!0,r=function(e,t){if(l(e,g))throw new d(p);return t.facade=e,c(e,g,t),t},i=function(e){return l(e,g)?e[g]:{}},a=function(e){return l(e,g)}}e.exports={set:r,get:i,has:a,enforce:function(e){return a(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!u(t)||(n=i(t)).type!==e)throw new d("Incompatible receiver, "+e+" required");return n}}}},44209:function(e,t,n){"use strict";var r=n(78227),i=n(26269),a=r("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[a]===e)}},34376:function(e,t,n){"use strict";var r=n(22195);e.exports=Array.isArray||function(e){return"Array"===r(e)}},18727:function(e,t,n){"use strict";var r=n(36955);e.exports=function(e){var t=r(e);return"BigInt64Array"===t||"BigUint64Array"===t}},94901:function(e){"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},33517:function(e,t,n){"use strict";var r=n(79504),i=n(79039),a=n(94901),o=n(36955),s=n(97751),u=n(33706),c=function(){},l=s("Reflect","construct"),h=/^\s*(?:class|function)\b/,f=r(h.exec),m=!h.test(c),p=function(e){if(!a(e))return!1;try{return l(c,[],e),!0}catch(e){return!1}},d=function(e){if(!a(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return m||!!f(h,u(e))}catch(e){return!0}};d.sham=!0,e.exports=!l||i((function(){var e;return p(p.call)||!p(Object)||!p((function(){e=!0}))||e}))?d:p},92796:function(e,t,n){"use strict";var r=n(79039),i=n(94901),a=/#|\.prototype\./,o=function(e,t){var n=u[s(e)];return n===l||n!==c&&(i(t)?r(t):!!t)},s=o.normalize=function(e){return String(e).replace(a,".").toLowerCase()},u=o.data={},c=o.NATIVE="N",l=o.POLYFILL="P";e.exports=o},2087:function(e,t,n){"use strict";var r=n(20034),i=Math.floor;e.exports=Number.isInteger||function(e){return!r(e)&&isFinite(e)&&i(e)===e}},31563:function(e,t,n){"use strict";var r=n(36955),i=n(39297),a=n(64117),o=n(78227),s=n(26269),u=o("iterator"),c=Object;e.exports=function(e){if(a(e))return!1;var t=c(e);return void 0!==t[u]||"@@iterator"in t||i(s,r(t))}},64117:function(e){"use strict";e.exports=function(e){return null==e}},20034:function(e,t,n){"use strict";var r=n(94901);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},13925:function(e,t,n){"use strict";var r=n(20034);e.exports=function(e){return r(e)||null===e}},96395:function(e){"use strict";e.exports=!1},60788:function(e,t,n){"use strict";var r=n(20034),i=n(22195),a=n(78227)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[a])?!!t:"RegExp"===i(e))}},10757:function(e,t,n){"use strict";var r=n(97751),i=n(94901),a=n(1625),o=n(7040),s=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return i(t)&&a(t.prototype,s(e))}},40507:function(e,t,n){"use strict";var r=n(69565);e.exports=function(e,t,n){for(var i,a,o=n?e:e.iterator,s=e.next;!(i=r(s,o)).done;)if(void 0!==(a=t(i.value)))return a}},72652:function(e,t,n){"use strict";var r=n(76080),i=n(69565),a=n(28551),o=n(16823),s=n(44209),u=n(26198),c=n(1625),l=n(70081),h=n(50851),f=n(9539),m=TypeError,p=function(e,t){this.stopped=e,this.result=t},d=p.prototype;e.exports=function(e,t,n){var v,y,g,b,A,_,M,k=n&&n.that,w=!(!n||!n.AS_ENTRIES),T=!(!n||!n.IS_RECORD),x=!(!n||!n.IS_ITERATOR),S=!(!n||!n.INTERRUPTED),C=r(t,k),E=function(e){return v&&f(v,"normal",e),new p(!0,e)},R=function(e){return w?(a(e),S?C(e[0],e[1],E):C(e[0],e[1])):S?C(e,E):C(e)};if(T)v=e.iterator;else if(x)v=e;else{if(!(y=h(e)))throw new m(o(e)+" is not iterable");if(s(y)){for(g=0,b=u(e);b>g;g++)if((A=R(e[g]))&&c(d,A))return A;return new p(!1)}v=l(e,y)}for(_=T?e.next:v.next;!(M=i(_,v)).done;){try{A=R(M.value)}catch(e){f(v,"throw",e)}if("object"==typeof A&&A&&c(d,A))return A}return new p(!1)}},9539:function(e,t,n){"use strict";var r=n(69565),i=n(28551),a=n(55966);e.exports=function(e,t,n){var o,s;i(e);try{if(!(o=a(e,"return"))){if("throw"===t)throw n;return n}o=r(o,e)}catch(e){s=!0,o=e}if("throw"===t)throw n;if(s)throw o;return i(o),n}},33994:function(e,t,n){"use strict";var r=n(57657).IteratorPrototype,i=n(2360),a=n(6980),o=n(10687),s=n(26269),u=function(){return this};e.exports=function(e,t,n,c){var l=t+" Iterator";return e.prototype=i(r,{next:a(+!c,n)}),o(e,l,!1,!0),s[l]=u,e}},19462:function(e,t,n){"use strict";var r=n(69565),i=n(2360),a=n(66699),o=n(56279),s=n(78227),u=n(91181),c=n(55966),l=n(57657).IteratorPrototype,h=n(62529),f=n(9539),m=s("toStringTag"),p="IteratorHelper",d="WrapForValidIterator",v=u.set,y=function(e){var t=u.getterFor(e?d:p);return o(i(l),{next:function(){var n=t(this);if(e)return n.nextHandler();try{var r=n.done?void 0:n.nextHandler();return h(r,n.done)}catch(e){throw n.done=!0,e}},return:function(){var n=t(this),i=n.iterator;if(n.done=!0,e){var a=c(i,"return");return a?r(a,i):h(void 0,!0)}if(n.inner)try{f(n.inner.iterator,"normal")}catch(e){return f(i,"throw",e)}return i&&f(i,"normal"),h(void 0,!0)}})},g=y(!0),b=y(!1);a(b,m,"Iterator Helper"),e.exports=function(e,t){var n=function(n,r){r?(r.iterator=n.iterator,r.next=n.next):r=n,r.type=t?d:p,r.nextHandler=e,r.counter=0,r.done=!1,v(this,r)};return n.prototype=t?g:b,n}},51088:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(96395),o=n(10350),s=n(94901),u=n(33994),c=n(42787),l=n(52967),h=n(10687),f=n(66699),m=n(36840),p=n(78227),d=n(26269),v=n(57657),y=o.PROPER,g=o.CONFIGURABLE,b=v.IteratorPrototype,A=v.BUGGY_SAFARI_ITERATORS,_=p("iterator"),M="keys",k="values",w="entries",T=function(){return this};e.exports=function(e,t,n,o,p,v,x){u(n,t,o);var S,C,E,R=function(e){if(e===p&&B)return B;if(!A&&e&&e in D)return D[e];switch(e){case M:case k:case w:return function(){return new n(this,e)}}return function(){return new n(this)}},I=t+" Iterator",O=!1,D=e.prototype,P=D[_]||D["@@iterator"]||p&&D[p],B=!A&&P||R(p),F="Array"===t&&D.entries||P;if(F&&(S=c(F.call(new e)))!==Object.prototype&&S.next&&(a||c(S)===b||(l?l(S,b):s(S[_])||m(S,_,T)),h(S,I,!0,!0),a&&(d[I]=T)),y&&p===k&&P&&P.name!==k&&(!a&&g?f(D,"name",k):(O=!0,B=function(){return i(P,this)})),p)if(C={values:R(k),keys:v?B:R(M),entries:R(w)},x)for(E in C)(A||O||!(E in D))&&m(D,E,C[E]);else r({target:t,proto:!0,forced:A||O},C);return a&&!x||D[_]===B||m(D,_,B,{name:p}),d[t]=B,C}},20713:function(e,t,n){"use strict";var r=n(69565),i=n(79306),a=n(28551),o=n(1767),s=n(19462),u=n(96319),c=s((function(){var e=this.iterator,t=a(r(this.next,e));if(!(this.done=!!t.done))return u(e,this.mapper,[t.value,this.counter++],!0)}));e.exports=function(e){return a(this),i(e),new c(o(this),{mapper:e})}},57657:function(e,t,n){"use strict";var r,i,a,o=n(79039),s=n(94901),u=n(20034),c=n(2360),l=n(42787),h=n(36840),f=n(78227),m=n(96395),p=f("iterator"),d=!1;[].keys&&("next"in(a=[].keys())?(i=l(l(a)))!==Object.prototype&&(r=i):d=!0),!u(r)||o((function(){var e={};return r[p].call(e)!==e}))?r={}:m&&(r=c(r)),s(r[p])||h(r,p,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},26269:function(e){"use strict";e.exports={}},26198:function(e,t,n){"use strict";var r=n(18014);e.exports=function(e){return r(e.length)}},50283:function(e,t,n){"use strict";var r=n(79504),i=n(79039),a=n(94901),o=n(39297),s=n(43724),u=n(10350).CONFIGURABLE,c=n(33706),l=n(91181),h=l.enforce,f=l.get,m=String,p=Object.defineProperty,d=r("".slice),v=r("".replace),y=r([].join),g=s&&!i((function(){return 8!==p((function(){}),"length",{value:8}).length})),b=String(String).split("String"),A=e.exports=function(e,t,n){"Symbol("===d(m(t),0,7)&&(t="["+v(m(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!o(e,"name")||u&&e.name!==t)&&(s?p(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&o(n,"arity")&&e.length!==n.arity&&p(e,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?s&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=h(e);return o(r,"source")||(r.source=y(b,"string"==typeof t?t:"")),e};Function.prototype.toString=A((function(){return a(this)&&f(this).source||c(this)}),"toString")},72248:function(e,t,n){"use strict";var r=n(79504),i=Map.prototype;e.exports={Map:Map,set:r(i.set),get:r(i.get),has:r(i.has),remove:r(i.delete),proto:i}},26223:function(e,t,n){"use strict";var r=n(79504),i=n(40507),a=n(72248),o=a.Map,s=a.proto,u=r(s.forEach),c=r(s.entries),l=c(new o).next;e.exports=function(e,t,n){return n?i({iterator:c(e),next:l},(function(e){return t(e[1],e[0])})):u(e,t)}},33164:function(e,t,n){"use strict";var r=n(77782),i=Math.abs,a=2220446049250313e-31,o=1/a;e.exports=function(e,t,n,s){var u=+e,c=i(u),l=r(u);if(c<s)return l*function(e){return e+o-o}(c/s/t)*s*t;var h=(1+t/a)*c,f=h-(h-c);return f>n||f!=f?l*(1/0):l*f}},15617:function(e,t,n){"use strict";var r=n(33164);e.exports=Math.fround||function(e){return r(e,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}},77782:function(e){"use strict";e.exports=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1}},80741:function(e){"use strict";var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},91955:function(e,t,n){"use strict";var r,i,a,o,s,u=n(44576),c=n(93389),l=n(76080),h=n(59225).set,f=n(18265),m=n(89544),p=n(44265),d=n(7860),v=n(16193),y=u.MutationObserver||u.WebKitMutationObserver,g=u.document,b=u.process,A=u.Promise,_=c("queueMicrotask");if(!_){var M=new f,k=function(){var e,t;for(v&&(e=b.domain)&&e.exit();t=M.get();)try{t()}catch(e){throw M.head&&r(),e}e&&e.enter()};m||v||d||!y||!g?!p&&A&&A.resolve?((o=A.resolve(void 0)).constructor=A,s=l(o.then,o),r=function(){s(k)}):v?r=function(){b.nextTick(k)}:(h=l(h,u),r=function(){h(k)}):(i=!0,a=g.createTextNode(""),new y(k).observe(a,{characterData:!0}),r=function(){a.data=i=!i}),_=function(e){M.head||r(),M.add(e)}}e.exports=_},36043:function(e,t,n){"use strict";var r=n(79306),i=TypeError,a=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw new i("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new a(e)}},32603:function(e,t,n){"use strict";var r=n(655);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:r(e)}},60511:function(e,t,n){"use strict";var r=n(60788),i=TypeError;e.exports=function(e){if(r(e))throw new i("The method doesn't accept regular expressions");return e}},50360:function(e,t,n){"use strict";var r=n(44576).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&r(e)}},33904:function(e,t,n){"use strict";var r=n(44576),i=n(79039),a=n(79504),o=n(655),s=n(43802).trim,u=n(47452),c=a("".charAt),l=r.parseFloat,h=r.Symbol,f=h&&h.iterator,m=1/l(u+"-0")!=-1/0||f&&!i((function(){l(Object(f))}));e.exports=m?function(e){var t=s(o(e)),n=l(t);return 0===n&&"-"===c(t,0)?-0:n}:l},44213:function(e,t,n){"use strict";var r=n(43724),i=n(79504),a=n(69565),o=n(79039),s=n(71072),u=n(33717),c=n(48773),l=n(48981),h=n(47055),f=Object.assign,m=Object.defineProperty,p=i([].concat);e.exports=!f||o((function(){if(r&&1!==f({b:1},f(m({},"a",{enumerable:!0,get:function(){m(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol("assign detection"),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!==f({},e)[n]||s(f({},t)).join("")!==i}))?function(e,t){for(var n=l(e),i=arguments.length,o=1,f=u.f,m=c.f;i>o;)for(var d,v=h(arguments[o++]),y=f?p(s(v),f(v)):s(v),g=y.length,b=0;g>b;)d=y[b++],r&&!a(m,v,d)||(n[d]=v[d]);return n}:f},2360:function(e,t,n){"use strict";var r,i=n(28551),a=n(96801),o=n(88727),s=n(30421),u=n(20397),c=n(4055),l=n(66119),h="prototype",f="script",m=l("IE_PROTO"),p=function(){},d=function(e){return"<"+f+">"+e+"</"+f+">"},v=function(e){e.write(d("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;y="undefined"!=typeof document?document.domain&&r?v(r):(t=c("iframe"),n="java"+f+":",t.style.display="none",u.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(d("document.F=Object")),e.close(),e.F):v(r);for(var i=o.length;i--;)delete y[h][o[i]];return y()};s[m]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(p[h]=i(e),n=new p,p[h]=null,n[m]=e):n=y(),void 0===t?n:a.f(n,t)}},96801:function(e,t,n){"use strict";var r=n(43724),i=n(48686),a=n(24913),o=n(28551),s=n(25397),u=n(71072);t.f=r&&!i?Object.defineProperties:function(e,t){o(e);for(var n,r=s(t),i=u(t),c=i.length,l=0;c>l;)a.f(e,n=i[l++],r[n]);return e}},24913:function(e,t,n){"use strict";var r=n(43724),i=n(35917),a=n(48686),o=n(28551),s=n(56969),u=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,h="enumerable",f="configurable",m="writable";t.f=r?a?function(e,t,n){if(o(e),t=s(t),o(n),"function"==typeof e&&"prototype"===t&&"value"in n&&m in n&&!n[m]){var r=l(e,t);r&&r[m]&&(e[t]=n.value,n={configurable:f in n?n[f]:r[f],enumerable:h in n?n[h]:r[h],writable:!1})}return c(e,t,n)}:c:function(e,t,n){if(o(e),t=s(t),o(n),i)try{return c(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new u("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},77347:function(e,t,n){"use strict";var r=n(43724),i=n(69565),a=n(48773),o=n(6980),s=n(25397),u=n(56969),c=n(39297),l=n(35917),h=Object.getOwnPropertyDescriptor;t.f=r?h:function(e,t){if(e=s(e),t=u(t),l)try{return h(e,t)}catch(e){}if(c(e,t))return o(!i(a.f,e,t),e[t])}},10298:function(e,t,n){"use strict";var r=n(22195),i=n(25397),a=n(38480).f,o=n(67680),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"===r(e)?function(e){try{return a(e)}catch(e){return o(s)}}(e):a(i(e))}},38480:function(e,t,n){"use strict";var r=n(61828),i=n(88727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},33717:function(e,t){"use strict";t.f=Object.getOwnPropertySymbols},42787:function(e,t,n){"use strict";var r=n(39297),i=n(94901),a=n(48981),o=n(66119),s=n(12211),u=o("IE_PROTO"),c=Object,l=c.prototype;e.exports=s?c.getPrototypeOf:function(e){var t=a(e);if(r(t,u))return t[u];var n=t.constructor;return i(n)&&t instanceof n?n.prototype:t instanceof c?l:null}},34124:function(e,t,n){"use strict";var r=n(79039),i=n(20034),a=n(22195),o=n(15652),s=Object.isExtensible,u=r((function(){s(1)}));e.exports=u||o?function(e){return!!i(e)&&((!o||"ArrayBuffer"!==a(e))&&(!s||s(e)))}:s},1625:function(e,t,n){"use strict";var r=n(79504);e.exports=r({}.isPrototypeOf)},61828:function(e,t,n){"use strict";var r=n(79504),i=n(39297),a=n(25397),o=n(19617).indexOf,s=n(30421),u=r([].push);e.exports=function(e,t){var n,r=a(e),c=0,l=[];for(n in r)!i(s,n)&&i(r,n)&&u(l,n);for(;t.length>c;)i(r,n=t[c++])&&(~o(l,n)||u(l,n));return l}},71072:function(e,t,n){"use strict";var r=n(61828),i=n(88727);e.exports=Object.keys||function(e){return r(e,i)}},48773:function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},52967:function(e,t,n){"use strict";var r=n(46706),i=n(20034),a=n(67750),o=n(73506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return a(n),o(r),i(n)?(t?e(n,r):n.__proto__=r,n):n}}():void 0)},32357:function(e,t,n){"use strict";var r=n(43724),i=n(79039),a=n(79504),o=n(42787),s=n(71072),u=n(25397),c=a(n(48773).f),l=a([].push),h=r&&i((function(){var e=Object.create(null);return e[2]=2,!c(e,2)})),f=function(e){return function(t){for(var n,i=u(t),a=s(i),f=h&&null===o(i),m=a.length,p=0,d=[];m>p;)n=a[p++],r&&!(f?n in i:c(i,n))||l(d,e?[n,i[n]]:i[n]);return d}};e.exports={entries:f(!0),values:f(!1)}},53179:function(e,t,n){"use strict";var r=n(92140),i=n(36955);e.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}},84270:function(e,t,n){"use strict";var r=n(69565),i=n(94901),a=n(20034),o=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&i(n=e.toString)&&!a(s=r(n,e)))return s;if(i(n=e.valueOf)&&!a(s=r(n,e)))return s;if("string"!==t&&i(n=e.toString)&&!a(s=r(n,e)))return s;throw new o("Can't convert object to primitive value")}},35031:function(e,t,n){"use strict";var r=n(97751),i=n(79504),a=n(38480),o=n(33717),s=n(28551),u=i([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=a.f(s(e)),n=o.f;return n?u(t,n(e)):t}},616:function(e,t,n){"use strict";var r=n(79504),i=n(39297),a=SyntaxError,o=parseInt,s=String.fromCharCode,u=r("".charAt),c=r("".slice),l=r(/./.exec),h={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},f=/^[\da-f]{4}$/i,m=/^[\u0000-\u001F]$/;e.exports=function(e,t){for(var n=!0,r="";t<e.length;){var p=u(e,t);if("\\"===p){var d=c(e,t,t+2);if(i(h,d))r+=h[d],t+=2;else{if("\\u"!==d)throw new a('Unknown escape sequence: "'+d+'"');var v=c(e,t+=2,t+4);if(!l(f,v))throw new a("Bad Unicode escape at: "+t);r+=s(o(v,16)),t+=4}}else{if('"'===p){n=!1,t++;break}if(l(m,p))throw new a("Bad control character in string literal at: "+t);r+=p,t++}}if(n)throw new a("Unterminated string at: "+t);return{value:r,end:t}}},19167:function(e,t,n){"use strict";var r=n(44576);e.exports=r},1103:function(e){"use strict";e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},10916:function(e,t,n){"use strict";var r=n(44576),i=n(80550),a=n(94901),o=n(92796),s=n(33706),u=n(78227),c=n(84215),l=n(96395),h=n(39519),f=i&&i.prototype,m=u("species"),p=!1,d=a(r.PromiseRejectionEvent),v=o("Promise",(function(){var e=s(i),t=e!==String(i);if(!t&&66===h)return!0;if(l&&(!f.catch||!f.finally))return!0;if(!h||h<51||!/native code/.test(e)){var n=new i((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[m]=r,!(p=n.then((function(){}))instanceof r))return!0}return!(t||"BROWSER"!==c&&"DENO"!==c||d)}));e.exports={CONSTRUCTOR:v,REJECTION_EVENT:d,SUBCLASSING:p}},80550:function(e,t,n){"use strict";var r=n(44576);e.exports=r.Promise},93438:function(e,t,n){"use strict";var r=n(28551),i=n(20034),a=n(36043);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=a.f(e);return(0,n.resolve)(t),n.promise}},90537:function(e,t,n){"use strict";var r=n(80550),i=n(84428),a=n(10916).CONSTRUCTOR;e.exports=a||!i((function(e){r.all(e).then(void 0,(function(){}))}))},11056:function(e,t,n){"use strict";var r=n(24913).f;e.exports=function(e,t,n){n in e||r(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})}},18265:function(e){"use strict";var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},56682:function(e,t,n){"use strict";var r=n(69565),i=n(28551),a=n(94901),o=n(22195),s=n(57323),u=TypeError;e.exports=function(e,t){var n=e.exec;if(a(n)){var c=r(n,e,t);return null!==c&&i(c),c}if("RegExp"===o(e))return r(s,e,t);throw new u("RegExp#exec called on incompatible receiver")}},57323:function(e,t,n){"use strict";var r,i,a=n(69565),o=n(79504),s=n(655),u=n(67979),c=n(58429),l=n(25745),h=n(2360),f=n(91181).get,m=n(83635),p=n(18814),d=l("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,y=v,g=o("".charAt),b=o("".indexOf),A=o("".replace),_=o("".slice),M=(i=/b*/g,a(v,r=/a/,"a"),a(v,i,"a"),0!==r.lastIndex||0!==i.lastIndex),k=c.BROKEN_CARET,w=void 0!==/()??/.exec("")[1];(M||w||k||m||p)&&(y=function(e){var t,n,r,i,o,c,l,m=this,p=f(m),T=s(e),x=p.raw;if(x)return x.lastIndex=m.lastIndex,t=a(y,x,T),m.lastIndex=x.lastIndex,t;var S=p.groups,C=k&&m.sticky,E=a(u,m),R=m.source,I=0,O=T;if(C&&(E=A(E,"y",""),-1===b(E,"g")&&(E+="g"),O=_(T,m.lastIndex),m.lastIndex>0&&(!m.multiline||m.multiline&&"\n"!==g(T,m.lastIndex-1))&&(R="(?: "+R+")",O=" "+O,I++),n=new RegExp("^(?:"+R+")",E)),w&&(n=new RegExp("^"+R+"$(?!\\s)",E)),M&&(r=m.lastIndex),i=a(v,C?n:m,O),C?i?(i.input=_(i.input,I),i[0]=_(i[0],I),i.index=m.lastIndex,m.lastIndex+=i[0].length):m.lastIndex=0:M&&i&&(m.lastIndex=m.global?i.index+i[0].length:r),w&&i&&i.length>1&&a(d,i[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&S)for(i.groups=c=h(null),o=0;o<S.length;o++)c[(l=S[o])[0]]=i[l[1]];return i}),e.exports=y},67979:function(e,t,n){"use strict";var r=n(28551);e.exports=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},61034:function(e,t,n){"use strict";var r=n(69565),i=n(39297),a=n(1625),o=n(67979),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||i(e,"flags")||!a(s,e)?t:r(o,e)}},58429:function(e,t,n){"use strict";var r=n(79039),i=n(44576).RegExp,a=r((function(){var e=i("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),o=a||r((function(){return!i("a","y").sticky})),s=a||r((function(){var e=i("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:o,UNSUPPORTED_Y:a}},83635:function(e,t,n){"use strict";var r=n(79039),i=n(44576).RegExp;e.exports=r((function(){var e=i(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},18814:function(e,t,n){"use strict";var r=n(79039),i=n(44576).RegExp;e.exports=r((function(){var e=i("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},67750:function(e,t,n){"use strict";var r=n(64117),i=TypeError;e.exports=function(e){if(r(e))throw new i("Can't call method on "+e);return e}},93389:function(e,t,n){"use strict";var r=n(44576),i=n(43724),a=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!i)return r[e];var t=a(r,e);return t&&t.value}},33317:function(e){"use strict";e.exports=function(e,t){return e===t||e!=e&&t!=t}},3470:function(e){"use strict";e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},89286:function(e,t,n){"use strict";var r=n(94402),i=n(38469),a=r.Set,o=r.add;e.exports=function(e){var t=new a;return i(e,(function(e){o(t,e)})),t}},83440:function(e,t,n){"use strict";var r=n(97080),i=n(94402),a=n(89286),o=n(25170),s=n(83789),u=n(38469),c=n(40507),l=i.has,h=i.remove;e.exports=function(e){var t=r(this),n=s(e),i=a(t);return o(t)<=n.size?u(t,(function(e){n.includes(e)&&h(i,e)})):c(n.getIterator(),(function(e){l(t,e)&&h(i,e)})),i}},94402:function(e,t,n){"use strict";var r=n(79504),i=Set.prototype;e.exports={Set:Set,add:r(i.add),has:r(i.has),remove:r(i.delete),proto:i}},68750:function(e,t,n){"use strict";var r=n(97080),i=n(94402),a=n(25170),o=n(83789),s=n(38469),u=n(40507),c=i.Set,l=i.add,h=i.has;e.exports=function(e){var t=r(this),n=o(e),i=new c;return a(t)>n.size?u(n.getIterator(),(function(e){h(t,e)&&l(i,e)})):s(t,(function(e){n.includes(e)&&l(i,e)})),i}},64449:function(e,t,n){"use strict";var r=n(97080),i=n(94402).has,a=n(25170),o=n(83789),s=n(38469),u=n(40507),c=n(9539);e.exports=function(e){var t=r(this),n=o(e);if(a(t)<=n.size)return!1!==s(t,(function(e){if(n.includes(e))return!1}),!0);var l=n.getIterator();return!1!==u(l,(function(e){if(i(t,e))return c(l,"normal",!1)}))}},53838:function(e,t,n){"use strict";var r=n(97080),i=n(25170),a=n(38469),o=n(83789);e.exports=function(e){var t=r(this),n=o(e);return!(i(t)>n.size)&&!1!==a(t,(function(e){if(!n.includes(e))return!1}),!0)}},28527:function(e,t,n){"use strict";var r=n(97080),i=n(94402).has,a=n(25170),o=n(83789),s=n(40507),u=n(9539);e.exports=function(e){var t=r(this),n=o(e);if(a(t)<n.size)return!1;var c=n.getIterator();return!1!==s(c,(function(e){if(!i(t,e))return u(c,"normal",!1)}))}},38469:function(e,t,n){"use strict";var r=n(79504),i=n(40507),a=n(94402),o=a.Set,s=a.proto,u=r(s.forEach),c=r(s.keys),l=c(new o).next;e.exports=function(e,t,n){return n?i({iterator:c(e),next:l},t):u(e,t)}},84916:function(e,t,n){"use strict";var r=n(97751),i=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};e.exports=function(e){var t=r("Set");try{(new t)[e](i(0));try{return(new t)[e](i(-1)),!1}catch(e){return!0}}catch(e){return!1}}},25170:function(e,t,n){"use strict";var r=n(46706),i=n(94402);e.exports=r(i.proto,"size","get")||function(e){return e.size}},87633:function(e,t,n){"use strict";var r=n(97751),i=n(62106),a=n(78227),o=n(43724),s=a("species");e.exports=function(e){var t=r(e);o&&t&&!t[s]&&i(t,s,{configurable:!0,get:function(){return this}})}},83650:function(e,t,n){"use strict";var r=n(97080),i=n(94402),a=n(89286),o=n(83789),s=n(40507),u=i.add,c=i.has,l=i.remove;e.exports=function(e){var t=r(this),n=o(e).getIterator(),i=a(t);return s(n,(function(e){c(t,e)?l(i,e):u(i,e)})),i}},10687:function(e,t,n){"use strict";var r=n(24913).f,i=n(39297),a=n(78227)("toStringTag");e.exports=function(e,t,n){e&&!n&&(e=e.prototype),e&&!i(e,a)&&r(e,a,{configurable:!0,value:t})}},44204:function(e,t,n){"use strict";var r=n(97080),i=n(94402).add,a=n(89286),o=n(83789),s=n(40507);e.exports=function(e){var t=r(this),n=o(e).getIterator(),u=a(t);return s(n,(function(e){i(u,e)})),u}},66119:function(e,t,n){"use strict";var r=n(25745),i=n(33392),a=r("keys");e.exports=function(e){return a[e]||(a[e]=i(e))}},77629:function(e,t,n){"use strict";var r=n(96395),i=n(44576),a=n(39433),o="__core-js_shared__",s=e.exports=i[o]||a(o,{});(s.versions||(s.versions=[])).push({version:"3.39.0",mode:r?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},25745:function(e,t,n){"use strict";var r=n(77629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},2293:function(e,t,n){"use strict";var r=n(28551),i=n(35548),a=n(64117),o=n(78227)("species");e.exports=function(e,t){var n,s=r(e).constructor;return void 0===s||a(n=r(s)[o])?t:i(n)}},23061:function(e,t,n){"use strict";var r=n(79039);e.exports=function(e){return r((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},68183:function(e,t,n){"use strict";var r=n(79504),i=n(91291),a=n(655),o=n(67750),s=r("".charAt),u=r("".charCodeAt),c=r("".slice),l=function(e){return function(t,n){var r,l,h=a(o(t)),f=i(n),m=h.length;return f<0||f>=m?e?"":void 0:(r=u(h,f))<55296||r>56319||f+1===m||(l=u(h,f+1))<56320||l>57343?e?s(h,f):r:e?c(h,f,f+2):l-56320+(r-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},83063:function(e,t,n){"use strict";var r=n(82839);e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(r)},60533:function(e,t,n){"use strict";var r=n(79504),i=n(18014),a=n(655),o=n(72333),s=n(67750),u=r(o),c=r("".slice),l=Math.ceil,h=function(e){return function(t,n,r){var o,h,f=a(s(t)),m=i(n),p=f.length,d=void 0===r?" ":a(r);return m<=p||""===d?f:((h=u(d,l((o=m-p)/d.length))).length>o&&(h=c(h,0,o)),e?f+h:h+f)}};e.exports={start:h(!1),end:h(!0)}},3717:function(e,t,n){"use strict";var r=n(79504),i=2147483647,a=/[^\0-\u007E]/,o=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",u=RangeError,c=r(o.exec),l=Math.floor,h=String.fromCharCode,f=r("".charCodeAt),m=r([].join),p=r([].push),d=r("".replace),v=r("".split),y=r("".toLowerCase),g=function(e){return e+22+75*(e<26)},b=function(e,t,n){var r=0;for(e=n?l(e/700):e>>1,e+=l(e/t);e>455;)e=l(e/35),r+=36;return l(r+36*e/(e+38))},A=function(e){var t=[];e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=f(e,n++);if(i>=55296&&i<=56319&&n<r){var a=f(e,n++);56320==(64512&a)?p(t,((1023&i)<<10)+(1023&a)+65536):(p(t,i),n--)}else p(t,i)}return t}(e);var n,r,a=e.length,o=128,c=0,d=72;for(n=0;n<e.length;n++)(r=e[n])<128&&p(t,h(r));var v=t.length,y=v;for(v&&p(t,"-");y<a;){var A=i;for(n=0;n<e.length;n++)(r=e[n])>=o&&r<A&&(A=r);var _=y+1;if(A-o>l((i-c)/_))throw new u(s);for(c+=(A-o)*_,o=A,n=0;n<e.length;n++){if((r=e[n])<o&&++c>i)throw new u(s);if(r===o){for(var M=c,k=36;;){var w=k<=d?1:k>=d+26?26:k-d;if(M<w)break;var T=M-w,x=36-w;p(t,h(g(w+T%x))),M=l(T/x),k+=36}p(t,h(g(M))),d=b(c,_,y===v),c=0,y++}}c++,o++}return m(t,"")};e.exports=function(e){var t,n,r=[],i=v(d(y(e),o,"."),".");for(t=0;t<i.length;t++)n=i[t],p(r,c(a,n)?"xn--"+A(n):n);return m(r,".")}},72333:function(e,t,n){"use strict";var r=n(91291),i=n(655),a=n(67750),o=RangeError;e.exports=function(e){var t=i(a(this)),n="",s=r(e);if(s<0||s===1/0)throw new o("Wrong number of repetitions");for(;s>0;(s>>>=1)&&(t+=t))1&s&&(n+=t);return n}},60706:function(e,t,n){"use strict";var r=n(10350).PROPER,i=n(79039),a=n(47452);e.exports=function(e){return i((function(){return!!a[e]()||"​᠎"!=="​᠎"[e]()||r&&a[e].name!==e}))}},43802:function(e,t,n){"use strict";var r=n(79504),i=n(67750),a=n(655),o=n(47452),s=r("".replace),u=RegExp("^["+o+"]+"),c=RegExp("(^|[^"+o+"])["+o+"]+$"),l=function(e){return function(t){var n=a(i(t));return 1&e&&(n=s(n,u,"")),2&e&&(n=s(n,c,"$1")),n}};e.exports={start:l(1),end:l(2),trim:l(3)}},1548:function(e,t,n){"use strict";var r=n(44576),i=n(79039),a=n(39519),o=n(84215),s=r.structuredClone;e.exports=!!s&&!i((function(){if("DENO"===o&&a>92||"NODE"===o&&a>94||"BROWSER"===o&&a>97)return!1;var e=new ArrayBuffer(8),t=s(e,{transfer:[e]});return 0!==e.byteLength||8!==t.byteLength}))},4495:function(e,t,n){"use strict";var r=n(39519),i=n(79039),a=n(44576).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!a(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},58242:function(e,t,n){"use strict";var r=n(69565),i=n(97751),a=n(78227),o=n(36840);e.exports=function(){var e=i("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,s=a("toPrimitive");t&&!t[s]&&o(t,s,(function(e){return r(n,this)}),{arity:1})}},91296:function(e,t,n){"use strict";var r=n(4495);e.exports=r&&!!Symbol.for&&!!Symbol.keyFor},59225:function(e,t,n){"use strict";var r,i,a,o,s=n(44576),u=n(18745),c=n(76080),l=n(94901),h=n(39297),f=n(79039),m=n(20397),p=n(67680),d=n(4055),v=n(22812),y=n(89544),g=n(16193),b=s.setImmediate,A=s.clearImmediate,_=s.process,M=s.Dispatch,k=s.Function,w=s.MessageChannel,T=s.String,x=0,S={},C="onreadystatechange";f((function(){r=s.location}));var E=function(e){if(h(S,e)){var t=S[e];delete S[e],t()}},R=function(e){return function(){E(e)}},I=function(e){E(e.data)},O=function(e){s.postMessage(T(e),r.protocol+"//"+r.host)};b&&A||(b=function(e){v(arguments.length,1);var t=l(e)?e:k(e),n=p(arguments,1);return S[++x]=function(){u(t,void 0,n)},i(x),x},A=function(e){delete S[e]},g?i=function(e){_.nextTick(R(e))}:M&&M.now?i=function(e){M.now(R(e))}:w&&!y?(o=(a=new w).port2,a.port1.onmessage=I,i=c(o.postMessage,o)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&r&&"file:"!==r.protocol&&!f(O)?(i=O,s.addEventListener("message",I,!1)):i=C in d("script")?function(e){m.appendChild(d("script"))[C]=function(){m.removeChild(this),E(e)}}:function(e){setTimeout(R(e),0)}),e.exports={set:b,clear:A}},31240:function(e,t,n){"use strict";var r=n(79504);e.exports=r(1..valueOf)},35610:function(e,t,n){"use strict";var r=n(91291),i=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):a(n,t)}},75854:function(e,t,n){"use strict";var r=n(72777),i=TypeError;e.exports=function(e){var t=r(e,"number");if("number"==typeof t)throw new i("Can't convert number to bigint");return BigInt(t)}},57696:function(e,t,n){"use strict";var r=n(91291),i=n(18014),a=RangeError;e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw new a("Wrong length or index");return n}},25397:function(e,t,n){"use strict";var r=n(47055),i=n(67750);e.exports=function(e){return r(i(e))}},91291:function(e,t,n){"use strict";var r=n(80741);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},18014:function(e,t,n){"use strict";var r=n(91291),i=Math.min;e.exports=function(e){var t=r(e);return t>0?i(t,9007199254740991):0}},48981:function(e,t,n){"use strict";var r=n(67750),i=Object;e.exports=function(e){return i(r(e))}},58229:function(e,t,n){"use strict";var r=n(99590),i=RangeError;e.exports=function(e,t){var n=r(e);if(n%t)throw new i("Wrong offset");return n}},99590:function(e,t,n){"use strict";var r=n(91291),i=RangeError;e.exports=function(e){var t=r(e);if(t<0)throw new i("The argument can't be less than 0");return t}},72777:function(e,t,n){"use strict";var r=n(69565),i=n(20034),a=n(10757),o=n(55966),s=n(84270),u=n(78227),c=TypeError,l=u("toPrimitive");e.exports=function(e,t){if(!i(e)||a(e))return e;var n,u=o(e,l);if(u){if(void 0===t&&(t="default"),n=r(u,e,t),!i(n)||a(n))return n;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},56969:function(e,t,n){"use strict";var r=n(72777),i=n(10757);e.exports=function(e){var t=r(e,"string");return i(t)?t:t+""}},47650:function(e,t,n){"use strict";var r=n(97751),i=n(94901),a=n(31563),o=n(20034),s=r("Set");e.exports=function(e){return function(e){return o(e)&&"number"==typeof e.size&&i(e.has)&&i(e.keys)}(e)?e:a(e)?new s(e):e}},92140:function(e,t,n){"use strict";var r={};r[n(78227)("toStringTag")]="z",e.exports="[object z]"===String(r)},655:function(e,t,n){"use strict";var r=n(36955),i=String;e.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},58319:function(e){"use strict";var t=Math.round;e.exports=function(e){var n=t(e);return n<0?0:n>255?255:255&n}},16823:function(e){"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},15823:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(69565),o=n(43724),s=n(72805),u=n(94644),c=n(66346),l=n(90679),h=n(6980),f=n(66699),m=n(2087),p=n(18014),d=n(57696),v=n(58229),y=n(58319),g=n(56969),b=n(39297),A=n(36955),_=n(20034),M=n(10757),k=n(2360),w=n(1625),T=n(52967),x=n(38480).f,S=n(43251),C=n(59213).forEach,E=n(87633),R=n(62106),I=n(24913),O=n(77347),D=n(35370),P=n(91181),B=n(23167),F=P.get,N=P.set,L=P.enforce,j=I.f,U=O.f,V=i.RangeError,z=c.ArrayBuffer,H=z.prototype,G=c.DataView,q=u.NATIVE_ARRAY_BUFFER_VIEWS,W=u.TYPED_ARRAY_TAG,K=u.TypedArray,X=u.TypedArrayPrototype,Y=u.isTypedArray,$="BYTES_PER_ELEMENT",Z="Wrong length",Q=function(e,t){R(e,t,{configurable:!0,get:function(){return F(this)[t]}})},J=function(e){var t;return w(H,e)||"ArrayBuffer"===(t=A(e))||"SharedArrayBuffer"===t},ee=function(e,t){return Y(e)&&!M(t)&&t in e&&m(+t)&&t>=0},te=function(e,t){return t=g(t),ee(e,t)?h(2,e[t]):U(e,t)},ne=function(e,t,n){return t=g(t),!(ee(e,t)&&_(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?j(e,t,n):(e[t]=n.value,e)};o?(q||(O.f=te,I.f=ne,Q(X,"buffer"),Q(X,"byteOffset"),Q(X,"byteLength"),Q(X,"length")),r({target:"Object",stat:!0,forced:!q},{getOwnPropertyDescriptor:te,defineProperty:ne}),e.exports=function(e,t,n){var o=e.match(/\d+/)[0]/8,u=e+(n?"Clamped":"")+"Array",c="get"+e,h="set"+e,m=i[u],g=m,b=g&&g.prototype,A={},M=function(e,t){j(e,t,{get:function(){return function(e,t){var n=F(e);return n.view[c](t*o+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var i=F(e);i.view[h](t*o+i.byteOffset,n?y(r):r,!0)}(this,t,e)},enumerable:!0})};q?s&&(g=t((function(e,t,n,r){return l(e,b),B(_(t)?J(t)?void 0!==r?new m(t,v(n,o),r):void 0!==n?new m(t,v(n,o)):new m(t):Y(t)?D(g,t):a(S,g,t):new m(d(t)),e,g)})),T&&T(g,K),C(x(m),(function(e){e in g||f(g,e,m[e])})),g.prototype=b):(g=t((function(e,t,n,r){l(e,b);var i,s,u,c=0,h=0;if(_(t)){if(!J(t))return Y(t)?D(g,t):a(S,g,t);i=t,h=v(n,o);var f=t.byteLength;if(void 0===r){if(f%o)throw new V(Z);if((s=f-h)<0)throw new V(Z)}else if((s=p(r)*o)+h>f)throw new V(Z);u=s/o}else u=d(t),i=new z(s=u*o);for(N(e,{buffer:i,byteOffset:h,byteLength:s,length:u,view:new G(i)});c<u;)M(e,c++)})),T&&T(g,K),b=g.prototype=k(X)),b.constructor!==g&&f(b,"constructor",g),L(b).TypedArrayConstructor=g,W&&f(b,W,u);var w=g!==m;A[u]=g,r({global:!0,constructor:!0,forced:w,sham:!q},A),$ in g||f(g,$,o),$ in b||f(b,$,o),E(u)}):e.exports=function(){}},72805:function(e,t,n){"use strict";var r=n(44576),i=n(79039),a=n(84428),o=n(94644).NATIVE_ARRAY_BUFFER_VIEWS,s=r.ArrayBuffer,u=r.Int8Array;e.exports=!o||!i((function(){u(1)}))||!i((function(){new u(-1)}))||!a((function(e){new u,new u(null),new u(1.5),new u(e)}),!0)||i((function(){return 1!==new u(new s(2),1,void 0).length}))},29948:function(e,t,n){"use strict";var r=n(35370),i=n(94644).getTypedArrayConstructor;e.exports=function(e,t){return r(i(e),t)}},43251:function(e,t,n){"use strict";var r=n(76080),i=n(69565),a=n(35548),o=n(48981),s=n(26198),u=n(70081),c=n(50851),l=n(44209),h=n(18727),f=n(94644).aTypedArrayConstructor,m=n(75854);e.exports=function(e){var t,n,p,d,v,y,g,b,A=a(this),_=o(e),M=arguments.length,k=M>1?arguments[1]:void 0,w=void 0!==k,T=c(_);if(T&&!l(T))for(b=(g=u(_,T)).next,_=[];!(y=i(b,g)).done;)_.push(y.value);for(w&&M>2&&(k=r(k,arguments[2])),n=s(_),p=new(f(A))(n),d=h(p),t=0;n>t;t++)v=w?k(_[t],t):_[t],p[t]=d?m(v):+v;return p}},33392:function(e,t,n){"use strict";var r=n(79504),i=0,a=Math.random(),o=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++i+a,36)}},67416:function(e,t,n){"use strict";var r=n(79039),i=n(78227),a=n(43724),o=n(96395),s=i("iterator");e.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,n=new URLSearchParams("a=1&a=2&b=3"),r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),n.delete("a",2),n.delete("b",void 0),o&&(!e.toJSON||!n.has("a",1)||n.has("a",2)||!n.has("a",void 0)||n.has("b"))||!t.size&&(o||!a)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==r||"x"!==new URL("https://x",void 0).host}))},7040:function(e,t,n){"use strict";var r=n(4495);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},48686:function(e,t,n){"use strict";var r=n(43724),i=n(79039);e.exports=r&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},22812:function(e){"use strict";var t=TypeError;e.exports=function(e,n){if(e<n)throw new t("Not enough arguments");return e}},58622:function(e,t,n){"use strict";var r=n(44576),i=n(94901),a=r.WeakMap;e.exports=i(a)&&/native code/.test(String(a))},44995:function(e,t,n){"use strict";var r=n(79504),i=WeakMap.prototype;e.exports={WeakMap:WeakMap,set:r(i.set),get:r(i.get),has:r(i.has),remove:r(i.delete)}},70511:function(e,t,n){"use strict";var r=n(19167),i=n(39297),a=n(1951),o=n(24913).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});i(t,e)||o(t,e,{value:a.f(e)})}},1951:function(e,t,n){"use strict";var r=n(78227);t.f=r},78227:function(e,t,n){"use strict";var r=n(44576),i=n(25745),a=n(39297),o=n(33392),s=n(4495),u=n(7040),c=r.Symbol,l=i("wks"),h=u?c.for||c:c&&c.withoutSetter||o;e.exports=function(e){return a(l,e)||(l[e]=s&&a(c,e)?c[e]:h("Symbol."+e)),l[e]}},47452:function(e){"use strict";e.exports="\t\n\v\f\r                　\u2028\u2029\ufeff"},14601:function(e,t,n){"use strict";var r=n(97751),i=n(39297),a=n(66699),o=n(1625),s=n(52967),u=n(77740),c=n(11056),l=n(23167),h=n(32603),f=n(77584),m=n(80747),p=n(43724),d=n(96395);e.exports=function(e,t,n,v){var y="stackTraceLimit",g=v?2:1,b=e.split("."),A=b[b.length-1],_=r.apply(null,b);if(_){var M=_.prototype;if(!d&&i(M,"cause")&&delete M.cause,!n)return _;var k=r("Error"),w=t((function(e,t){var n=h(v?t:e,void 0),r=v?new _(e):new _;return void 0!==n&&a(r,"message",n),m(r,w,r.stack,2),this&&o(M,this)&&l(r,this,w),arguments.length>g&&f(r,arguments[g]),r}));if(w.prototype=M,"Error"!==A?s?s(w,k):u(w,k,{name:!0}):p&&y in _&&(c(w,_,y),c(w,_,"prepareStackTrace")),u(w,_),!d)try{M.name!==A&&a(M,"name",A),M.constructor=w}catch(e){}return w}}},54743:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(66346),o=n(87633),s="ArrayBuffer",u=a[s];r({global:!0,constructor:!0,forced:i[s]!==u},{ArrayBuffer:u}),o(s)},16573:function(e,t,n){"use strict";var r=n(43724),i=n(62106),a=n(3238),o=ArrayBuffer.prototype;r&&!("detached"in o)&&i(o,"detached",{configurable:!0,get:function(){return a(this)}})},77936:function(e,t,n){"use strict";var r=n(46518),i=n(95636);i&&r({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return i(this,arguments.length?arguments[0]:void 0,!1)}})},78100:function(e,t,n){"use strict";var r=n(46518),i=n(95636);i&&r({target:"ArrayBuffer",proto:!0},{transfer:function(){return i(this,arguments.length?arguments[0]:void 0,!0)}})},28706:function(e,t,n){"use strict";var r=n(46518),i=n(79039),a=n(34376),o=n(20034),s=n(48981),u=n(26198),c=n(96837),l=n(97040),h=n(1469),f=n(70597),m=n(78227),p=n(39519),d=m("isConcatSpreadable"),v=p>=51||!i((function(){var e=[];return e[d]=!1,e.concat()[0]!==e})),y=function(e){if(!o(e))return!1;var t=e[d];return void 0!==t?!!t:a(e)};r({target:"Array",proto:!0,arity:1,forced:!v||!f("concat")},{concat:function(e){var t,n,r,i,a,o=s(this),f=h(o,0),m=0;for(t=-1,r=arguments.length;t<r;t++)if(y(a=-1===t?o:arguments[t]))for(i=u(a),c(m+i),n=0;n<i;n++,m++)n in a&&l(f,m,a[n]);else c(m+1),l(f,m++,a);return f.length=m,f}})},33771:function(e,t,n){"use strict";var r=n(46518),i=n(84373),a=n(6469);r({target:"Array",proto:!0},{fill:i}),a("fill")},2008:function(e,t,n){"use strict";var r=n(46518),i=n(59213).filter;r({target:"Array",proto:!0,forced:!n(70597)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},48980:function(e,t,n){"use strict";var r=n(46518),i=n(59213).findIndex,a=n(6469),o="findIndex",s=!0;o in[]&&Array(1)[o]((function(){s=!1})),r({target:"Array",proto:!0,forced:s},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a(o)},50113:function(e,t,n){"use strict";var r=n(46518),i=n(59213).find,a=n(6469),o="find",s=!0;o in[]&&Array(1)[o]((function(){s=!1})),r({target:"Array",proto:!0,forced:s},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a(o)},23418:function(e,t,n){"use strict";var r=n(46518),i=n(97916);r({target:"Array",stat:!0,forced:!n(84428)((function(e){Array.from(e)}))},{from:i})},74423:function(e,t,n){"use strict";var r=n(46518),i=n(19617).includes,a=n(79039),o=n(6469);r({target:"Array",proto:!0,forced:a((function(){return!Array(1).includes()}))},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},23792:function(e,t,n){"use strict";var r=n(25397),i=n(6469),a=n(26269),o=n(91181),s=n(24913).f,u=n(51088),c=n(62529),l=n(96395),h=n(43724),f="Array Iterator",m=o.set,p=o.getterFor(f);e.exports=u(Array,"Array",(function(e,t){m(this,{type:f,target:r(e),index:0,kind:t})}),(function(){var e=p(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,c(void 0,!0);switch(e.kind){case"keys":return c(n,!1);case"values":return c(t[n],!1)}return c([n,t[n]],!1)}),"values");var d=a.Arguments=a.Array;if(i("keys"),i("values"),i("entries"),!l&&h&&"values"!==d.name)try{s(d,"name",{value:"values"})}catch(e){}},48598:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(47055),o=n(25397),s=n(34598),u=i([].join);r({target:"Array",proto:!0,forced:a!==Object||!s("join",",")},{join:function(e){return u(o(this),void 0===e?",":e)}})},62062:function(e,t,n){"use strict";var r=n(46518),i=n(59213).map;r({target:"Array",proto:!0,forced:!n(70597)("map")},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},44114:function(e,t,n){"use strict";var r=n(46518),i=n(48981),a=n(26198),o=n(34527),s=n(96837);r({target:"Array",proto:!0,arity:1,forced:n(79039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=i(this),n=a(t),r=arguments.length;s(n+r);for(var u=0;u<r;u++)t[n]=arguments[u],n++;return o(t,n),n}})},34782:function(e,t,n){"use strict";var r=n(46518),i=n(34376),a=n(33517),o=n(20034),s=n(35610),u=n(26198),c=n(25397),l=n(97040),h=n(78227),f=n(70597),m=n(67680),p=f("slice"),d=h("species"),v=Array,y=Math.max;r({target:"Array",proto:!0,forced:!p},{slice:function(e,t){var n,r,h,f=c(this),p=u(f),g=s(e,p),b=s(void 0===t?p:t,p);if(i(f)&&(n=f.constructor,(a(n)&&(n===v||i(n.prototype))||o(n)&&null===(n=n[d]))&&(n=void 0),n===v||void 0===n))return m(f,g,b);for(r=new(void 0===n?v:n)(y(b-g,0)),h=0;g<b;g++,h++)g in f&&l(r,h,f[g]);return r.length=h,r}})},26910:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(79306),o=n(48981),s=n(26198),u=n(84606),c=n(655),l=n(79039),h=n(74488),f=n(34598),m=n(13709),p=n(13763),d=n(39519),v=n(3607),y=[],g=i(y.sort),b=i(y.push),A=l((function(){y.sort(void 0)})),_=l((function(){y.sort(null)})),M=f("sort"),k=!l((function(){if(d)return d<70;if(!(m&&m>3)){if(p)return!0;if(v)return v<603;var e,t,n,r,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)y.push({k:t+r,v:n})}for(y.sort((function(e,t){return t.v-e.v})),r=0;r<y.length;r++)t=y[r].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));r({target:"Array",proto:!0,forced:A||!_||!M||!k},{sort:function(e){void 0!==e&&a(e);var t=o(this);if(k)return void 0===e?g(t):g(t,e);var n,r,i=[],l=s(t);for(r=0;r<l;r++)r in t&&b(i,t[r]);for(h(i,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:c(t)>c(n)?1:-1}}(e)),n=s(i),r=0;r<n;)t[r]=i[r++];for(;r<l;)u(t,r++);return t}})},54554:function(e,t,n){"use strict";var r=n(46518),i=n(48981),a=n(35610),o=n(91291),s=n(26198),u=n(34527),c=n(96837),l=n(1469),h=n(97040),f=n(84606),m=n(70597)("splice"),p=Math.max,d=Math.min;r({target:"Array",proto:!0,forced:!m},{splice:function(e,t){var n,r,m,v,y,g,b=i(this),A=s(b),_=a(e,A),M=arguments.length;for(0===M?n=r=0:1===M?(n=0,r=A-_):(n=M-2,r=d(p(o(t),0),A-_)),c(A+n-r),m=l(b,r),v=0;v<r;v++)(y=_+v)in b&&h(m,v,b[y]);if(m.length=r,n<r){for(v=_;v<A-r;v++)g=v+n,(y=v+r)in b?b[g]=b[y]:f(b,g);for(v=A;v>A-r+n;v--)f(b,v-1)}else if(n>r)for(v=A-r;v>_;v--)g=v+n-1,(y=v+r-1)in b?b[g]=b[y]:f(b,g);for(v=0;v<n;v++)b[v+_]=arguments[v+2];return u(b,A-r+n),m}})},13609:function(e,t,n){"use strict";var r=n(46518),i=n(48981),a=n(26198),o=n(34527),s=n(84606),u=n(96837);r({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}()},{unshift:function(e){var t=i(this),n=a(t),r=arguments.length;if(r){u(n+r);for(var c=n;c--;){var l=c+r;c in t?t[l]=t[c]:s(t,l)}for(var h=0;h<r;h++)t[h]=arguments[h]}return o(t,n+r)}})},16280:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(18745),o=n(14601),s="WebAssembly",u=i[s],c=7!==new Error("e",{cause:7}).cause,l=function(e,t){var n={};n[e]=o(e,t,c),r({global:!0,constructor:!0,arity:1,forced:c},n)},h=function(e,t){if(u&&u[e]){var n={};n[e]=o(s+"."+e,t,c),r({target:s,stat:!0,constructor:!0,arity:1,forced:c},n)}};l("Error",(function(e){return function(t){return a(e,this,arguments)}})),l("EvalError",(function(e){return function(t){return a(e,this,arguments)}})),l("RangeError",(function(e){return function(t){return a(e,this,arguments)}})),l("ReferenceError",(function(e){return function(t){return a(e,this,arguments)}})),l("SyntaxError",(function(e){return function(t){return a(e,this,arguments)}})),l("TypeError",(function(e){return function(t){return a(e,this,arguments)}})),l("URIError",(function(e){return function(t){return a(e,this,arguments)}})),h("CompileError",(function(e){return function(t){return a(e,this,arguments)}})),h("LinkError",(function(e){return function(t){return a(e,this,arguments)}})),h("RuntimeError",(function(e){return function(t){return a(e,this,arguments)}}))},62010:function(e,t,n){"use strict";var r=n(43724),i=n(10350).EXISTS,a=n(79504),o=n(62106),s=Function.prototype,u=a(s.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,l=a(c.exec);r&&!i&&o(s,"name",{configurable:!0,get:function(){try{return l(c,u(this))[1]}catch(e){return""}}})},18111:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(90679),o=n(28551),s=n(94901),u=n(42787),c=n(62106),l=n(97040),h=n(79039),f=n(39297),m=n(78227),p=n(57657).IteratorPrototype,d=n(43724),v=n(96395),y="constructor",g="Iterator",b=m("toStringTag"),A=TypeError,_=i[g],M=v||!s(_)||_.prototype!==p||!h((function(){_({})})),k=function(){if(a(this,p),u(this)===p)throw new A("Abstract class Iterator not directly constructable")},w=function(e,t){d?c(p,e,{configurable:!0,get:function(){return t},set:function(t){if(o(this),this===p)throw new A("You can't redefine this property");f(this,e)?this[e]=t:l(this,e,t)}}):p[e]=t};f(p,b)||w(b,g),!M&&f(p,y)&&p[y]!==Object||w(y,k),k.prototype=p,r({global:!0,constructor:!0,forced:M},{Iterator:k})},81148:function(e,t,n){"use strict";var r=n(46518),i=n(72652),a=n(79306),o=n(28551),s=n(1767);r({target:"Iterator",proto:!0,real:!0},{every:function(e){o(this),a(e);var t=s(this),n=0;return!i(t,(function(t,r){if(!e(t,n++))return r()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},22489:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(79306),o=n(28551),s=n(1767),u=n(19462),c=n(96319),l=n(96395),h=u((function(){for(var e,t,n=this.iterator,r=this.predicate,a=this.next;;){if(e=o(i(a,n)),this.done=!!e.done)return;if(t=e.value,c(n,r,[t,this.counter++],!0))return t}}));r({target:"Iterator",proto:!0,real:!0,forced:l},{filter:function(e){return o(this),a(e),new h(s(this),{predicate:e})}})},20116:function(e,t,n){"use strict";var r=n(46518),i=n(72652),a=n(79306),o=n(28551),s=n(1767);r({target:"Iterator",proto:!0,real:!0},{find:function(e){o(this),a(e);var t=s(this),n=0;return i(t,(function(t,r){if(e(t,n++))return r(t)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},7588:function(e,t,n){"use strict";var r=n(46518),i=n(72652),a=n(79306),o=n(28551),s=n(1767);r({target:"Iterator",proto:!0,real:!0},{forEach:function(e){o(this),a(e);var t=s(this),n=0;i(t,(function(t){e(t,n++)}),{IS_RECORD:!0})}})},61701:function(e,t,n){"use strict";var r=n(46518),i=n(20713);r({target:"Iterator",proto:!0,real:!0,forced:n(96395)},{map:i})},18237:function(e,t,n){"use strict";var r=n(46518),i=n(72652),a=n(79306),o=n(28551),s=n(1767),u=TypeError;r({target:"Iterator",proto:!0,real:!0},{reduce:function(e){o(this),a(e);var t=s(this),n=arguments.length<2,r=n?void 0:arguments[1],c=0;if(i(t,(function(t){n?(n=!1,r=t):r=e(r,t,c),c++}),{IS_RECORD:!0}),n)throw new u("Reduce of empty iterator with no initial value");return r}})},13579:function(e,t,n){"use strict";var r=n(46518),i=n(72652),a=n(79306),o=n(28551),s=n(1767);r({target:"Iterator",proto:!0,real:!0},{some:function(e){o(this),a(e);var t=s(this),n=0;return i(t,(function(t,r){if(e(t,n++))return r()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},61806:function(e,t,n){"use strict";var r=n(46518),i=n(28551),a=n(72652),o=n(1767),s=[].push;r({target:"Iterator",proto:!0,real:!0},{toArray:function(){var e=[];return a(o(i(this)),s,{that:e,IS_RECORD:!0}),e}})},33110:function(e,t,n){"use strict";var r=n(46518),i=n(97751),a=n(18745),o=n(69565),s=n(79504),u=n(79039),c=n(94901),l=n(10757),h=n(67680),f=n(66933),m=n(4495),p=String,d=i("JSON","stringify"),v=s(/./.exec),y=s("".charAt),g=s("".charCodeAt),b=s("".replace),A=s(1..toString),_=/[\uD800-\uDFFF]/g,M=/^[\uD800-\uDBFF]$/,k=/^[\uDC00-\uDFFF]$/,w=!m||u((function(){var e=i("Symbol")("stringify detection");return"[null]"!==d([e])||"{}"!==d({a:e})||"{}"!==d(Object(e))})),T=u((function(){return'"\\udf06\\ud834"'!==d("\udf06\ud834")||'"\\udead"'!==d("\udead")})),x=function(e,t){var n=h(arguments),r=f(t);if(c(r)||void 0!==e&&!l(e))return n[1]=function(e,t){if(c(r)&&(t=o(r,this,p(e),t)),!l(t))return t},a(d,null,n)},S=function(e,t,n){var r=y(n,t-1),i=y(n,t+1);return v(M,e)&&!v(k,i)||v(k,e)&&!v(M,r)?"\\u"+A(g(e,0),16):e};d&&r({target:"JSON",stat:!0,arity:3,forced:w||T},{stringify:function(e,t,n){var r=h(arguments),i=a(w?x:d,null,r);return T&&"string"==typeof i?b(i,_,S):i}})},48523:function(e,t,n){"use strict";n(16468)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),n(86938))},36033:function(e,t,n){"use strict";n(48523)},11367:function(e,t,n){"use strict";var r=n(46518),i=Math.log,a=Math.LN2;r({target:"Math",stat:!0},{log2:function(e){return i(e)/a}})},2892:function(e,t,n){"use strict";var r=n(46518),i=n(96395),a=n(43724),o=n(44576),s=n(19167),u=n(79504),c=n(92796),l=n(39297),h=n(23167),f=n(1625),m=n(10757),p=n(72777),d=n(79039),v=n(38480).f,y=n(77347).f,g=n(24913).f,b=n(31240),A=n(43802).trim,_="Number",M=o[_],k=s[_],w=M.prototype,T=o.TypeError,x=u("".slice),S=u("".charCodeAt),C=function(e){var t,n,r,i,a,o,s,u,c=p(e,"number");if(m(c))throw new T("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=A(c),43===(t=S(c,0))||45===t){if(88===(n=S(c,2))||120===n)return NaN}else if(48===t){switch(S(c,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+c}for(o=(a=x(c,2)).length,s=0;s<o;s++)if((u=S(a,s))<48||u>i)return NaN;return parseInt(a,r)}return+c},E=c(_,!M(" 0o1")||!M("0b1")||M("+0x1")),R=function(e){var t,n=arguments.length<1?0:M(function(e){var t=p(e,"number");return"bigint"==typeof t?t:C(t)}(e));return f(w,t=this)&&d((function(){b(t)}))?h(Object(n),this,R):n};R.prototype=w,E&&!i&&(w.constructor=R),r({global:!0,constructor:!0,wrap:!0,forced:E},{Number:R});var I=function(e,t){for(var n,r=a?v(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;r.length>i;i++)l(t,n=r[i])&&!l(e,n)&&g(e,n,y(t,n))};i&&k&&I(s[_],k),(E||i)&&I(s[_],M)},45374:function(e,t,n){"use strict";n(46518)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},25428:function(e,t,n){"use strict";n(46518)({target:"Number",stat:!0},{isFinite:n(50360)})},32637:function(e,t,n){"use strict";n(46518)({target:"Number",stat:!0},{isInteger:n(2087)})},40150:function(e,t,n){"use strict";n(46518)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},59149:function(e,t,n){"use strict";var r=n(46518),i=n(2087),a=Math.abs;r({target:"Number",stat:!0},{isSafeInteger:function(e){return i(e)&&a(e)<=9007199254740991}})},64601:function(e,t,n){"use strict";n(46518)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},44435:function(e,t,n){"use strict";n(46518)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},87220:function(e,t,n){"use strict";var r=n(46518),i=n(33904);r({target:"Number",stat:!0,forced:Number.parseFloat!==i},{parseFloat:i})},9868:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(91291),o=n(31240),s=n(72333),u=n(79039),c=RangeError,l=String,h=Math.floor,f=i(s),m=i("".slice),p=i(1..toFixed),d=function(e,t,n){return 0===t?n:t%2==1?d(e,t-1,n*e):d(e*e,t/2,n)},v=function(e,t,n){for(var r=-1,i=n;++r<6;)i+=t*e[r],e[r]=i%1e7,i=h(i/1e7)},y=function(e,t){for(var n=6,r=0;--n>=0;)r+=e[n],e[n]=h(r/t),r=r%t*1e7},g=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var r=l(e[t]);n=""===n?r:n+f("0",7-r.length)+r}return n};r({target:"Number",proto:!0,forced:u((function(){return"0.000"!==p(8e-5,3)||"1"!==p(.9,0)||"1.25"!==p(1.255,2)||"1000000000000000128"!==p(0xde0b6b3a7640080,0)}))||!u((function(){p({})}))},{toFixed:function(e){var t,n,r,i,s=o(this),u=a(e),h=[0,0,0,0,0,0],p="",b="0";if(u<0||u>20)throw new c("Incorrect fraction digits");if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return l(s);if(s<0&&(p="-",s=-s),s>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(s*d(2,69,1))-69)<0?s*d(2,-t,1):s/d(2,t,1),n*=4503599627370496,(t=52-t)>0){for(v(h,0,n),r=u;r>=7;)v(h,1e7,0),r-=7;for(v(h,d(10,r,1),0),r=t-1;r>=23;)y(h,1<<23),r-=23;y(h,1<<r),v(h,1,1),y(h,2),b=g(h)}else v(h,0,n),v(h,1<<-t,0),b=g(h)+f("0",u);return b=u>0?p+((i=b.length)<=u?"0."+f("0",u-i)+b:m(b,0,i-u)+"."+m(b,i-u)):p+b}})},69085:function(e,t,n){"use strict";var r=n(46518),i=n(44213);r({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},5506:function(e,t,n){"use strict";var r=n(46518),i=n(32357).entries;r({target:"Object",stat:!0},{entries:function(e){return i(e)}})},83851:function(e,t,n){"use strict";var r=n(46518),i=n(79039),a=n(25397),o=n(77347).f,s=n(43724);r({target:"Object",stat:!0,forced:!s||i((function(){o(1)})),sham:!s},{getOwnPropertyDescriptor:function(e,t){return o(a(e),t)}})},81278:function(e,t,n){"use strict";var r=n(46518),i=n(43724),a=n(35031),o=n(25397),s=n(77347),u=n(97040);r({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,n,r=o(e),i=s.f,c=a(r),l={},h=0;c.length>h;)void 0!==(n=i(r,t=c[h++]))&&u(l,t,n);return l}})},49773:function(e,t,n){"use strict";var r=n(46518),i=n(4495),a=n(79039),o=n(33717),s=n(48981);r({target:"Object",stat:!0,forced:!i||a((function(){o.f(1)}))},{getOwnPropertySymbols:function(e){var t=o.f;return t?t(s(e)):[]}})},79432:function(e,t,n){"use strict";var r=n(46518),i=n(48981),a=n(71072);r({target:"Object",stat:!0,forced:n(79039)((function(){a(1)}))},{keys:function(e){return a(i(e))}})},26099:function(e,t,n){"use strict";var r=n(92140),i=n(36840),a=n(53179);r||i(Object.prototype,"toString",a,{unsafe:!0})},16034:function(e,t,n){"use strict";var r=n(46518),i=n(32357).values;r({target:"Object",stat:!0},{values:function(e){return i(e)}})},96167:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(79306),o=n(36043),s=n(1103),u=n(72652);r({target:"Promise",stat:!0,forced:n(90537)},{allSettled:function(e){var t=this,n=o.f(t),r=n.resolve,c=n.reject,l=s((function(){var n=a(t.resolve),o=[],s=0,c=1;u(e,(function(e){var a=s++,u=!1;c++,i(n,t,e).then((function(e){u||(u=!0,o[a]={status:"fulfilled",value:e},--c||r(o))}),(function(e){u||(u=!0,o[a]={status:"rejected",reason:e},--c||r(o))}))})),--c||r(o)}));return l.error&&c(l.value),n.promise}})},16499:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(79306),o=n(36043),s=n(1103),u=n(72652);r({target:"Promise",stat:!0,forced:n(90537)},{all:function(e){var t=this,n=o.f(t),r=n.resolve,c=n.reject,l=s((function(){var n=a(t.resolve),o=[],s=0,l=1;u(e,(function(e){var a=s++,u=!1;l++,i(n,t,e).then((function(e){u||(u=!0,o[a]=e,--l||r(o))}),c)})),--l||r(o)}));return l.error&&c(l.value),n.promise}})},82003:function(e,t,n){"use strict";var r=n(46518),i=n(96395),a=n(10916).CONSTRUCTOR,o=n(80550),s=n(97751),u=n(94901),c=n(36840),l=o&&o.prototype;if(r({target:"Promise",proto:!0,forced:a,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&u(o)){var h=s("Promise").prototype.catch;l.catch!==h&&c(l,"catch",h,{unsafe:!0})}},10436:function(e,t,n){"use strict";var r,i,a,o=n(46518),s=n(96395),u=n(16193),c=n(44576),l=n(69565),h=n(36840),f=n(52967),m=n(10687),p=n(87633),d=n(79306),v=n(94901),y=n(20034),g=n(90679),b=n(2293),A=n(59225).set,_=n(91955),M=n(90757),k=n(1103),w=n(18265),T=n(91181),x=n(80550),S=n(10916),C=n(36043),E="Promise",R=S.CONSTRUCTOR,I=S.REJECTION_EVENT,O=S.SUBCLASSING,D=T.getterFor(E),P=T.set,B=x&&x.prototype,F=x,N=B,L=c.TypeError,j=c.document,U=c.process,V=C.f,z=V,H=!!(j&&j.createEvent&&c.dispatchEvent),G="unhandledrejection",q=function(e){var t;return!(!y(e)||!v(t=e.then))&&t},W=function(e,t){var n,r,i,a=t.value,o=1===t.state,s=o?e.ok:e.fail,u=e.resolve,c=e.reject,h=e.domain;try{s?(o||(2===t.rejection&&Z(t),t.rejection=1),!0===s?n=a:(h&&h.enter(),n=s(a),h&&(h.exit(),i=!0)),n===e.promise?c(new L("Promise-chain cycle")):(r=q(n))?l(r,n,u,c):u(n)):c(a)}catch(e){h&&!i&&h.exit(),c(e)}},K=function(e,t){e.notified||(e.notified=!0,_((function(){for(var n,r=e.reactions;n=r.get();)W(n,e);e.notified=!1,t&&!e.rejection&&Y(e)})))},X=function(e,t,n){var r,i;H?((r=j.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),c.dispatchEvent(r)):r={promise:t,reason:n},!I&&(i=c["on"+e])?i(r):e===G&&M("Unhandled promise rejection",n)},Y=function(e){l(A,c,(function(){var t,n=e.facade,r=e.value;if($(e)&&(t=k((function(){u?U.emit("unhandledRejection",r,n):X(G,n,r)})),e.rejection=u||$(e)?2:1,t.error))throw t.value}))},$=function(e){return 1!==e.rejection&&!e.parent},Z=function(e){l(A,c,(function(){var t=e.facade;u?U.emit("rejectionHandled",t):X("rejectionhandled",t,e.value)}))},Q=function(e,t,n){return function(r){e(t,r,n)}},J=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,K(e,!0))},ee=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new L("Promise can't be resolved itself");var r=q(t);r?_((function(){var n={done:!1};try{l(r,t,Q(ee,n,e),Q(J,n,e))}catch(t){J(n,t,e)}})):(e.value=t,e.state=1,K(e,!1))}catch(t){J({done:!1},t,e)}}};if(R&&(N=(F=function(e){g(this,N),d(e),l(r,this);var t=D(this);try{e(Q(ee,t),Q(J,t))}catch(e){J(t,e)}}).prototype,(r=function(e){P(this,{type:E,done:!1,notified:!1,parent:!1,reactions:new w,rejection:!1,state:0,value:null})}).prototype=h(N,"then",(function(e,t){var n=D(this),r=V(b(this,F));return n.parent=!0,r.ok=!v(e)||e,r.fail=v(t)&&t,r.domain=u?U.domain:void 0,0===n.state?n.reactions.add(r):_((function(){W(r,n)})),r.promise})),i=function(){var e=new r,t=D(e);this.promise=e,this.resolve=Q(ee,t),this.reject=Q(J,t)},C.f=V=function(e){return e===F||undefined===e?new i(e):z(e)},!s&&v(x)&&B!==Object.prototype)){a=B.then,O||h(B,"then",(function(e,t){var n=this;return new F((function(e,t){l(a,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete B.constructor}catch(e){}f&&f(B,N)}o({global:!0,constructor:!0,wrap:!0,forced:R},{Promise:F}),m(F,E,!1,!0),p(E)},3362:function(e,t,n){"use strict";n(10436),n(16499),n(82003),n(7743),n(51481),n(40280)},7743:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(79306),o=n(36043),s=n(1103),u=n(72652);r({target:"Promise",stat:!0,forced:n(90537)},{race:function(e){var t=this,n=o.f(t),r=n.reject,c=s((function(){var o=a(t.resolve);u(e,(function(e){i(o,t,e).then(n.resolve,r)}))}));return c.error&&r(c.value),n.promise}})},51481:function(e,t,n){"use strict";var r=n(46518),i=n(36043);r({target:"Promise",stat:!0,forced:n(10916).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return(0,t.reject)(e),t.promise}})},40280:function(e,t,n){"use strict";var r=n(46518),i=n(97751),a=n(96395),o=n(80550),s=n(10916).CONSTRUCTOR,u=n(93438),c=i("Promise"),l=a&&!s;r({target:"Promise",stat:!0,forced:a||s},{resolve:function(e){return u(l&&this===c?o:this,e)}})},60825:function(e,t,n){"use strict";var r=n(46518),i=n(97751),a=n(18745),o=n(30566),s=n(35548),u=n(28551),c=n(20034),l=n(2360),h=n(79039),f=i("Reflect","construct"),m=Object.prototype,p=[].push,d=h((function(){function e(){}return!(f((function(){}),[],e)instanceof e)})),v=!h((function(){f((function(){}))})),y=d||v;r({target:"Reflect",stat:!0,forced:y,sham:y},{construct:function(e,t){s(e),u(t);var n=arguments.length<3?e:s(arguments[2]);if(v&&!d)return f(e,t,n);if(e===n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return a(p,r,t),new(a(o,e,r))}var i=n.prototype,h=l(c(i)?i:m),y=a(e,h,t);return c(y)?y:h}})},84864:function(e,t,n){"use strict";var r=n(43724),i=n(44576),a=n(79504),o=n(92796),s=n(23167),u=n(66699),c=n(2360),l=n(38480).f,h=n(1625),f=n(60788),m=n(655),p=n(61034),d=n(58429),v=n(11056),y=n(36840),g=n(79039),b=n(39297),A=n(91181).enforce,_=n(87633),M=n(78227),k=n(83635),w=n(18814),T=M("match"),x=i.RegExp,S=x.prototype,C=i.SyntaxError,E=a(S.exec),R=a("".charAt),I=a("".replace),O=a("".indexOf),D=a("".slice),P=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,B=/a/g,F=/a/g,N=new x(B)!==B,L=d.MISSED_STICKY,j=d.UNSUPPORTED_Y,U=r&&(!N||L||k||w||g((function(){return F[T]=!1,x(B)!==B||x(F)===F||"/a/i"!==String(x(B,"i"))})));if(o("RegExp",U)){for(var V=function(e,t){var n,r,i,a,o,l,d=h(S,this),v=f(e),y=void 0===t,g=[],_=e;if(!d&&v&&y&&e.constructor===V)return e;if((v||h(S,e))&&(e=e.source,y&&(t=p(_))),e=void 0===e?"":m(e),t=void 0===t?"":m(t),_=e,k&&"dotAll"in B&&(r=!!t&&O(t,"s")>-1)&&(t=I(t,/s/g,"")),n=t,L&&"sticky"in B&&(i=!!t&&O(t,"y")>-1)&&j&&(t=I(t,/y/g,"")),w&&(a=function(e){for(var t,n=e.length,r=0,i="",a=[],o=c(null),s=!1,u=!1,l=0,h="";r<=n;r++){if("\\"===(t=R(e,r)))t+=R(e,++r);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:if(i+=t,"?:"===D(e,r+1,r+3))continue;E(P,D(e,r+1))&&(r+=2,u=!0),l++;continue;case">"===t&&u:if(""===h||b(o,h))throw new C("Invalid capture group name");o[h]=!0,a[a.length]=[h,l],u=!1,h="";continue}u?h+=t:i+=t}return[i,a]}(e),e=a[0],g=a[1]),o=s(x(e,t),d?this:S,V),(r||i||g.length)&&(l=A(o),r&&(l.dotAll=!0,l.raw=V(function(e){for(var t,n=e.length,r=0,i="",a=!1;r<=n;r++)"\\"!==(t=R(e,r))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]":i+=t+R(e,++r);return i}(e),n)),i&&(l.sticky=!0),g.length&&(l.groups=g)),e!==_)try{u(o,"source",""===_?"(?:)":_)}catch(e){}return o},z=l(x),H=0;z.length>H;)v(V,x,z[H++]);S.constructor=V,V.prototype=S,y(i,"RegExp",V,{constructor:!0})}_("RegExp")},57465:function(e,t,n){"use strict";var r=n(43724),i=n(83635),a=n(22195),o=n(62106),s=n(91181).get,u=RegExp.prototype,c=TypeError;r&&i&&o(u,"dotAll",{configurable:!0,get:function(){if(this!==u){if("RegExp"===a(this))return!!s(this).dotAll;throw new c("Incompatible receiver, RegExp required")}}})},27495:function(e,t,n){"use strict";var r=n(46518),i=n(57323);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},69479:function(e,t,n){"use strict";var r=n(44576),i=n(43724),a=n(62106),o=n(67979),s=n(79039),u=r.RegExp,c=u.prototype;i&&s((function(){var e=!0;try{u(".","d")}catch(t){e=!1}var t={},n="",r=e?"dgimsy":"gimsy",i=function(e,r){Object.defineProperty(t,e,{get:function(){return n+=r,!0}})},a={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var o in e&&(a.hasIndices="d"),a)i(o,a[o]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(t)!==r||n!==r}))&&a(c,"flags",{configurable:!0,get:o})},87745:function(e,t,n){"use strict";var r=n(43724),i=n(58429).MISSED_STICKY,a=n(22195),o=n(62106),s=n(91181).get,u=RegExp.prototype,c=TypeError;r&&i&&o(u,"sticky",{configurable:!0,get:function(){if(this!==u){if("RegExp"===a(this))return!!s(this).sticky;throw new c("Incompatible receiver, RegExp required")}}})},90906:function(e,t,n){"use strict";n(27495);var r,i,a=n(46518),o=n(69565),s=n(94901),u=n(28551),c=n(655),l=(r=!1,(i=/[ac]/).exec=function(){return r=!0,/./.exec.apply(this,arguments)},!0===i.test("abc")&&r),h=/./.test;a({target:"RegExp",proto:!0,forced:!l},{test:function(e){var t=u(this),n=c(e),r=t.exec;if(!s(r))return o(h,t,n);var i=o(r,t,n);return null!==i&&(u(i),!0)}})},38781:function(e,t,n){"use strict";var r=n(10350).PROPER,i=n(36840),a=n(28551),o=n(655),s=n(79039),u=n(61034),c="toString",l=RegExp.prototype,h=l[c],f=s((function(){return"/a/b"!==h.call({source:"a",flags:"b"})})),m=r&&h.name!==c;(f||m)&&i(l,c,(function(){var e=a(this);return"/"+o(e.source)+"/"+o(u(e))}),{unsafe:!0})},92405:function(e,t,n){"use strict";n(16468)("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),n(86938))},17642:function(e,t,n){"use strict";var r=n(46518),i=n(83440);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("difference")},{difference:i})},58004:function(e,t,n){"use strict";var r=n(46518),i=n(79039),a=n(68750);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("intersection")||i((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:a})},33853:function(e,t,n){"use strict";var r=n(46518),i=n(64449);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("isDisjointFrom")},{isDisjointFrom:i})},45876:function(e,t,n){"use strict";var r=n(46518),i=n(53838);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("isSubsetOf")},{isSubsetOf:i})},32475:function(e,t,n){"use strict";var r=n(46518),i=n(28527);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("isSupersetOf")},{isSupersetOf:i})},31415:function(e,t,n){"use strict";n(92405)},15024:function(e,t,n){"use strict";var r=n(46518),i=n(83650);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("symmetricDifference")},{symmetricDifference:i})},31698:function(e,t,n){"use strict";var r=n(46518),i=n(44204);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("union")},{union:i})},99449:function(e,t,n){"use strict";var r,i=n(46518),a=n(27476),o=n(77347).f,s=n(18014),u=n(655),c=n(60511),l=n(67750),h=n(41436),f=n(96395),m=a("".slice),p=Math.min,d=h("endsWith");i({target:"String",proto:!0,forced:!!(f||d||(r=o(String.prototype,"endsWith"),!r||r.writable))&&!d},{endsWith:function(e){var t=u(l(this));c(e);var n=arguments.length>1?arguments[1]:void 0,r=t.length,i=void 0===n?r:p(s(n),r),a=u(e);return m(t,i-a.length,i)===a}})},27337:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(35610),o=RangeError,s=String.fromCharCode,u=String.fromCodePoint,c=i([].join);r({target:"String",stat:!0,arity:1,forced:!!u&&1!==u.length},{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,i=0;r>i;){if(t=+arguments[i++],a(t,1114111)!==t)throw new o(t+" is not a valid code point");n[i]=t<65536?s(t):s(55296+((t-=65536)>>10),t%1024+56320)}return c(n,"")}})},21699:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(60511),o=n(67750),s=n(655),u=n(41436),c=i("".indexOf);r({target:"String",proto:!0,forced:!u("includes")},{includes:function(e){return!!~c(s(o(this)),s(a(e)),arguments.length>1?arguments[1]:void 0)}})},47764:function(e,t,n){"use strict";var r=n(68183).charAt,i=n(655),a=n(91181),o=n(51088),s=n(62529),u="String Iterator",c=a.set,l=a.getterFor(u);o(String,"String",(function(e){c(this,{type:u,string:i(e),index:0})}),(function(){var e,t=l(this),n=t.string,i=t.index;return i>=n.length?s(void 0,!0):(e=r(n,i),t.index+=e.length,s(e,!1))}))},28543:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(27476),o=n(33994),s=n(62529),u=n(67750),c=n(18014),l=n(655),h=n(28551),f=n(64117),m=n(22195),p=n(60788),d=n(61034),v=n(55966),y=n(36840),g=n(79039),b=n(78227),A=n(2293),_=n(57829),M=n(56682),k=n(91181),w=n(96395),T=b("matchAll"),x="RegExp String",S=x+" Iterator",C=k.set,E=k.getterFor(S),R=RegExp.prototype,I=TypeError,O=a("".indexOf),D=a("".matchAll),P=!!D&&!g((function(){D("a",/./)})),B=o((function(e,t,n,r){C(this,{type:S,regexp:e,string:t,global:n,unicode:r,done:!1})}),x,(function(){var e=E(this);if(e.done)return s(void 0,!0);var t=e.regexp,n=e.string,r=M(t,n);return null===r?(e.done=!0,s(void 0,!0)):e.global?(""===l(r[0])&&(t.lastIndex=_(n,c(t.lastIndex),e.unicode)),s(r,!1)):(e.done=!0,s(r,!1))})),F=function(e){var t,n,r,i=h(this),a=l(e),o=A(i,RegExp),s=l(d(i));return t=new o(o===RegExp?i.source:i,s),n=!!~O(s,"g"),r=!!~O(s,"u"),t.lastIndex=c(i.lastIndex),new B(t,a,n,r)};r({target:"String",proto:!0,forced:P},{matchAll:function(e){var t,n,r,a,o=u(this);if(f(e)){if(P)return D(o,e)}else{if(p(e)&&(t=l(u(d(e))),!~O(t,"g")))throw new I("`.matchAll` does not allow non-global regexes");if(P)return D(o,e);if(void 0===(r=v(e,T))&&w&&"RegExp"===m(e)&&(r=F),r)return i(r,e,o)}return n=l(o),a=new RegExp(e,"g"),w?i(F,a,n):a[T](n)}}),w||T in R||y(R,T,F)},71761:function(e,t,n){"use strict";var r=n(69565),i=n(89228),a=n(28551),o=n(64117),s=n(18014),u=n(655),c=n(67750),l=n(55966),h=n(57829),f=n(56682);i("match",(function(e,t,n){return[function(t){var n=c(this),i=o(t)?void 0:l(t,e);return i?r(i,t,n):new RegExp(t)[e](u(n))},function(e){var r=a(this),i=u(e),o=n(t,r,i);if(o.done)return o.value;if(!r.global)return f(r,i);var c=r.unicode;r.lastIndex=0;for(var l,m=[],p=0;null!==(l=f(r,i));){var d=u(l[0]);m[p]=d,""===d&&(r.lastIndex=h(i,s(r.lastIndex),c)),p++}return 0===p?null:m}]}))},35701:function(e,t,n){"use strict";var r=n(46518),i=n(60533).end;r({target:"String",proto:!0,forced:n(83063)},{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},68156:function(e,t,n){"use strict";var r=n(46518),i=n(60533).start;r({target:"String",proto:!0,forced:n(83063)},{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},42781:function(e,t,n){"use strict";n(46518)({target:"String",proto:!0},{repeat:n(72333)})},25440:function(e,t,n){"use strict";var r=n(18745),i=n(69565),a=n(79504),o=n(89228),s=n(79039),u=n(28551),c=n(94901),l=n(64117),h=n(91291),f=n(18014),m=n(655),p=n(67750),d=n(57829),v=n(55966),y=n(2478),g=n(56682),b=n(78227)("replace"),A=Math.max,_=Math.min,M=a([].concat),k=a([].push),w=a("".indexOf),T=a("".slice),x="$0"==="a".replace(/./,"$0"),S=!!/./[b]&&""===/./[b]("a","$0");o("replace",(function(e,t,n){var a=S?"$":"$0";return[function(e,n){var r=p(this),a=l(e)?void 0:v(e,b);return a?i(a,e,r,n):i(t,m(r),e,n)},function(e,i){var o=u(this),s=m(e);if("string"==typeof i&&-1===w(i,a)&&-1===w(i,"$<")){var l=n(t,o,s,i);if(l.done)return l.value}var p=c(i);p||(i=m(i));var v,b=o.global;b&&(v=o.unicode,o.lastIndex=0);for(var x,S=[];null!==(x=g(o,s))&&(k(S,x),b);){""===m(x[0])&&(o.lastIndex=d(s,f(o.lastIndex),v))}for(var C,E="",R=0,I=0;I<S.length;I++){for(var O,D=m((x=S[I])[0]),P=A(_(h(x.index),s.length),0),B=[],F=1;F<x.length;F++)k(B,void 0===(C=x[F])?C:String(C));var N=x.groups;if(p){var L=M([D],B,P,s);void 0!==N&&k(L,N),O=m(r(i,void 0,L))}else O=y(D,s,P,B,N,i);P>=R&&(E+=T(s,R,P)+O,R=P+D.length)}return E+T(s,R)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!x||S)},5746:function(e,t,n){"use strict";var r=n(69565),i=n(89228),a=n(28551),o=n(64117),s=n(67750),u=n(3470),c=n(655),l=n(55966),h=n(56682);i("search",(function(e,t,n){return[function(t){var n=s(this),i=o(t)?void 0:l(t,e);return i?r(i,t,n):new RegExp(t)[e](c(n))},function(e){var r=a(this),i=c(e),o=n(t,r,i);if(o.done)return o.value;var s=r.lastIndex;u(s,0)||(r.lastIndex=0);var l=h(r,i);return u(r.lastIndex,s)||(r.lastIndex=s),null===l?-1:l.index}]}))},90744:function(e,t,n){"use strict";var r=n(69565),i=n(79504),a=n(89228),o=n(28551),s=n(64117),u=n(67750),c=n(2293),l=n(57829),h=n(18014),f=n(655),m=n(55966),p=n(56682),d=n(58429),v=n(79039),y=d.UNSUPPORTED_Y,g=Math.min,b=i([].push),A=i("".slice),_=!v((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),M="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;a("split",(function(e,t,n){var i="0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:r(t,this,e,n)}:t;return[function(t,n){var a=u(this),o=s(t)?void 0:m(t,e);return o?r(o,t,a,n):r(i,f(a),t,n)},function(e,r){var a=o(this),s=f(e);if(!M){var u=n(i,a,s,r,i!==t);if(u.done)return u.value}var m=c(a,RegExp),d=a.unicode,v=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(y?"g":"y"),_=new m(y?"^(?:"+a.source+")":a,v),k=void 0===r?4294967295:r>>>0;if(0===k)return[];if(0===s.length)return null===p(_,s)?[s]:[];for(var w=0,T=0,x=[];T<s.length;){_.lastIndex=y?0:T;var S,C=p(_,y?A(s,T):s);if(null===C||(S=g(h(_.lastIndex+(y?T:0)),s.length))===w)T=l(s,T,d);else{if(b(x,A(s,w,T)),x.length===k)return x;for(var E=1;E<=C.length-1;E++)if(b(x,C[E]),x.length===k)return x;T=w=S}}return b(x,A(s,w)),x}]}),M||!_,y)},11392:function(e,t,n){"use strict";var r,i=n(46518),a=n(27476),o=n(77347).f,s=n(18014),u=n(655),c=n(60511),l=n(67750),h=n(41436),f=n(96395),m=a("".slice),p=Math.min,d=h("startsWith");i({target:"String",proto:!0,forced:!!(f||d||(r=o(String.prototype,"startsWith"),!r||r.writable))&&!d},{startsWith:function(e){var t=u(l(this));c(e);var n=s(p(arguments.length>1?arguments[1]:void 0,t.length)),r=u(e);return m(t,n,n+r.length)===r}})},48718:function(e,t,n){"use strict";var r=n(46518),i=n(77240);r({target:"String",proto:!0,forced:n(23061)("sub")},{sub:function(){return i(this,"sub","","")}})},42762:function(e,t,n){"use strict";var r=n(46518),i=n(43802).trim;r({target:"String",proto:!0,forced:n(60706)("trim")},{trim:function(){return i(this)}})},6761:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(69565),o=n(79504),s=n(96395),u=n(43724),c=n(4495),l=n(79039),h=n(39297),f=n(1625),m=n(28551),p=n(25397),d=n(56969),v=n(655),y=n(6980),g=n(2360),b=n(71072),A=n(38480),_=n(10298),M=n(33717),k=n(77347),w=n(24913),T=n(96801),x=n(48773),S=n(36840),C=n(62106),E=n(25745),R=n(66119),I=n(30421),O=n(33392),D=n(78227),P=n(1951),B=n(70511),F=n(58242),N=n(10687),L=n(91181),j=n(59213).forEach,U=R("hidden"),V="Symbol",z="prototype",H=L.set,G=L.getterFor(V),q=Object[z],W=i.Symbol,K=W&&W[z],X=i.RangeError,Y=i.TypeError,$=i.QObject,Z=k.f,Q=w.f,J=_.f,ee=x.f,te=o([].push),ne=E("symbols"),re=E("op-symbols"),ie=E("wks"),ae=!$||!$[z]||!$[z].findChild,oe=function(e,t,n){var r=Z(q,t);r&&delete q[t],Q(e,t,n),r&&e!==q&&Q(q,t,r)},se=u&&l((function(){return 7!==g(Q({},"a",{get:function(){return Q(this,"a",{value:7}).a}})).a}))?oe:Q,ue=function(e,t){var n=ne[e]=g(K);return H(n,{type:V,tag:e,description:t}),u||(n.description=t),n},ce=function(e,t,n){e===q&&ce(re,t,n),m(e);var r=d(t);return m(n),h(ne,r)?(n.enumerable?(h(e,U)&&e[U][r]&&(e[U][r]=!1),n=g(n,{enumerable:y(0,!1)})):(h(e,U)||Q(e,U,y(1,g(null))),e[U][r]=!0),se(e,r,n)):Q(e,r,n)},le=function(e,t){m(e);var n=p(t),r=b(n).concat(pe(n));return j(r,(function(t){u&&!a(he,n,t)||ce(e,t,n[t])})),e},he=function(e){var t=d(e),n=a(ee,this,t);return!(this===q&&h(ne,t)&&!h(re,t))&&(!(n||!h(this,t)||!h(ne,t)||h(this,U)&&this[U][t])||n)},fe=function(e,t){var n=p(e),r=d(t);if(n!==q||!h(ne,r)||h(re,r)){var i=Z(n,r);return!i||!h(ne,r)||h(n,U)&&n[U][r]||(i.enumerable=!0),i}},me=function(e){var t=J(p(e)),n=[];return j(t,(function(e){h(ne,e)||h(I,e)||te(n,e)})),n},pe=function(e){var t=e===q,n=J(t?re:p(e)),r=[];return j(n,(function(e){!h(ne,e)||t&&!h(q,e)||te(r,ne[e])})),r};c||(W=function(){if(f(K,this))throw new Y("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?v(arguments[0]):void 0,t=O(e),n=function(e){var r=void 0===this?i:this;r===q&&a(n,re,e),h(r,U)&&h(r[U],t)&&(r[U][t]=!1);var o=y(1,e);try{se(r,t,o)}catch(e){if(!(e instanceof X))throw e;oe(r,t,o)}};return u&&ae&&se(q,t,{configurable:!0,set:n}),ue(t,e)},S(K=W[z],"toString",(function(){return G(this).tag})),S(W,"withoutSetter",(function(e){return ue(O(e),e)})),x.f=he,w.f=ce,T.f=le,k.f=fe,A.f=_.f=me,M.f=pe,P.f=function(e){return ue(D(e),e)},u&&(C(K,"description",{configurable:!0,get:function(){return G(this).description}}),s||S(q,"propertyIsEnumerable",he,{unsafe:!0}))),r({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:W}),j(b(ie),(function(e){B(e)})),r({target:V,stat:!0,forced:!c},{useSetter:function(){ae=!0},useSimple:function(){ae=!1}}),r({target:"Object",stat:!0,forced:!c,sham:!u},{create:function(e,t){return void 0===t?g(e):le(g(e),t)},defineProperty:ce,defineProperties:le,getOwnPropertyDescriptor:fe}),r({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:me}),F(),N(W,V),I[U]=!0},89463:function(e,t,n){"use strict";var r=n(46518),i=n(43724),a=n(44576),o=n(79504),s=n(39297),u=n(94901),c=n(1625),l=n(655),h=n(62106),f=n(77740),m=a.Symbol,p=m&&m.prototype;if(i&&u(m)&&(!("description"in p)||void 0!==m().description)){var d={},v=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),t=c(p,this)?new m(e):void 0===e?m():m(e);return""===e&&(d[t]=!0),t};f(v,m),v.prototype=p,p.constructor=v;var y="Symbol(description detection)"===String(m("description detection")),g=o(p.valueOf),b=o(p.toString),A=/^Symbol\((.*)\)[^)]+$/,_=o("".replace),M=o("".slice);h(p,"description",{configurable:!0,get:function(){var e=g(this);if(s(d,e))return"";var t=b(e),n=y?M(t,7,-1):_(t,A,"$1");return""===n?void 0:n}}),r({global:!0,constructor:!0,forced:!0},{Symbol:v})}},81510:function(e,t,n){"use strict";var r=n(46518),i=n(97751),a=n(39297),o=n(655),s=n(25745),u=n(91296),c=s("string-to-symbol-registry"),l=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!u},{for:function(e){var t=o(e);if(a(c,t))return c[t];var n=i("Symbol")(t);return c[t]=n,l[n]=t,n}})},2259:function(e,t,n){"use strict";n(70511)("iterator")},52675:function(e,t,n){"use strict";n(6761),n(81510),n(97812),n(33110),n(49773)},97812:function(e,t,n){"use strict";var r=n(46518),i=n(39297),a=n(10757),o=n(16823),s=n(25745),u=n(91296),c=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!u},{keyFor:function(e){if(!a(e))throw new TypeError(o(e)+" is not a symbol");if(i(c,e))return c[e]}})},48140:function(e,t,n){"use strict";var r=n(94644),i=n(26198),a=n(91291),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("at",(function(e){var t=o(this),n=i(t),r=a(e),s=r>=0?r:n+r;return s<0||s>=n?void 0:t[s]}))},81630:function(e,t,n){"use strict";var r=n(79504),i=n(94644),a=r(n(57029)),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("copyWithin",(function(e,t){return a(o(this),e,t,arguments.length>2?arguments[2]:void 0)}))},72170:function(e,t,n){"use strict";var r=n(94644),i=n(59213).every,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("every",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},75044:function(e,t,n){"use strict";var r=n(94644),i=n(84373),a=n(75854),o=n(36955),s=n(69565),u=n(79504),c=n(79039),l=r.aTypedArray,h=r.exportTypedArrayMethod,f=u("".slice);h("fill",(function(e){var t=arguments.length;l(this);var n="Big"===f(o(this),0,3)?a(e):+e;return s(i,this,n,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),c((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})))},69539:function(e,t,n){"use strict";var r=n(94644),i=n(59213).filter,a=n(29948),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("filter",(function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return a(this,t)}))},89955:function(e,t,n){"use strict";var r=n(94644),i=n(59213).findIndex,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("findIndex",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},91134:function(e,t,n){"use strict";var r=n(94644),i=n(43839).findLastIndex,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("findLastIndex",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},21903:function(e,t,n){"use strict";var r=n(94644),i=n(43839).findLast,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("findLast",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},31694:function(e,t,n){"use strict";var r=n(94644),i=n(59213).find,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("find",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},34594:function(e,t,n){"use strict";n(15823)("Float32",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},33206:function(e,t,n){"use strict";var r=n(94644),i=n(59213).forEach,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("forEach",(function(e){i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},44496:function(e,t,n){"use strict";var r=n(94644),i=n(19617).includes,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("includes",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},66651:function(e,t,n){"use strict";var r=n(94644),i=n(19617).indexOf,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("indexOf",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},72107:function(e,t,n){"use strict";n(15823)("Int16",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},95477:function(e,t,n){"use strict";n(15823)("Int32",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},46594:function(e,t,n){"use strict";n(15823)("Int8",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},12887:function(e,t,n){"use strict";var r=n(44576),i=n(79039),a=n(79504),o=n(94644),s=n(23792),u=n(78227)("iterator"),c=r.Uint8Array,l=a(s.values),h=a(s.keys),f=a(s.entries),m=o.aTypedArray,p=o.exportTypedArrayMethod,d=c&&c.prototype,v=!i((function(){d[u].call([1])})),y=!!d&&d.values&&d[u]===d.values&&"values"===d.values.name,g=function(){return l(m(this))};p("entries",(function(){return f(m(this))}),v),p("keys",(function(){return h(m(this))}),v),p("values",g,v||!y,{name:"values"}),p(u,g,v||!y,{name:"values"})},19369:function(e,t,n){"use strict";var r=n(94644),i=n(79504),a=r.aTypedArray,o=r.exportTypedArrayMethod,s=i([].join);o("join",(function(e){return s(a(this),e)}))},66812:function(e,t,n){"use strict";var r=n(94644),i=n(18745),a=n(8379),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return i(a,o(this),t>1?[e,arguments[1]]:[e])}))},8995:function(e,t,n){"use strict";var r=n(94644),i=n(59213).map,a=r.aTypedArray,o=r.getTypedArrayConstructor;(0,r.exportTypedArrayMethod)("map",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(o(e))(t)}))}))},36072:function(e,t,n){"use strict";var r=n(94644),i=n(80926).right,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return i(a(this),e,t,t>1?arguments[1]:void 0)}))},31575:function(e,t,n){"use strict";var r=n(94644),i=n(80926).left,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return i(a(this),e,t,t>1?arguments[1]:void 0)}))},88747:function(e,t,n){"use strict";var r=n(94644),i=r.aTypedArray,a=r.exportTypedArrayMethod,o=Math.floor;a("reverse",(function(){for(var e,t=this,n=i(t).length,r=o(n/2),a=0;a<r;)e=t[a],t[a++]=t[--n],t[n]=e;return t}))},28845:function(e,t,n){"use strict";var r=n(44576),i=n(69565),a=n(94644),o=n(26198),s=n(58229),u=n(48981),c=n(79039),l=r.RangeError,h=r.Int8Array,f=h&&h.prototype,m=f&&f.set,p=a.aTypedArray,d=a.exportTypedArrayMethod,v=!c((function(){var e=new Uint8ClampedArray(2);return i(m,e,{length:1,0:3},1),3!==e[1]})),y=v&&a.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var e=new h(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));d("set",(function(e){p(this);var t=s(arguments.length>1?arguments[1]:void 0,1),n=u(e);if(v)return i(m,this,n,t);var r=this.length,a=o(n),c=0;if(a+t>r)throw new l("Wrong length");for(;c<a;)this[t+c]=n[c++]}),!v||y)},29423:function(e,t,n){"use strict";var r=n(94644),i=n(79039),a=n(67680),o=r.aTypedArray,s=r.getTypedArrayConstructor;(0,r.exportTypedArrayMethod)("slice",(function(e,t){for(var n=a(o(this),e,t),r=s(this),i=0,u=n.length,c=new r(u);u>i;)c[i]=n[i++];return c}),i((function(){new Int8Array(1).slice()})))},57301:function(e,t,n){"use strict";var r=n(94644),i=n(59213).some,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("some",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},373:function(e,t,n){"use strict";var r=n(44576),i=n(27476),a=n(79039),o=n(79306),s=n(74488),u=n(94644),c=n(13709),l=n(13763),h=n(39519),f=n(3607),m=u.aTypedArray,p=u.exportTypedArrayMethod,d=r.Uint16Array,v=d&&i(d.prototype.sort),y=!(!v||a((function(){v(new d(2),null)}))&&a((function(){v(new d(2),{})}))),g=!!v&&!a((function(){if(h)return h<74;if(c)return c<67;if(l)return!0;if(f)return f<602;var e,t,n=new d(516),r=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(v(n,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(n[e]!==r[e])return!0}));p("sort",(function(e){return void 0!==e&&o(e),g?v(this,e):s(m(this),function(e){return function(t,n){return void 0!==e?+e(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?1/t>0&&1/n<0?1:-1:t>n}}(e))}),!g||y)},86614:function(e,t,n){"use strict";var r=n(94644),i=n(18014),a=n(35610),o=r.aTypedArray,s=r.getTypedArrayConstructor;(0,r.exportTypedArrayMethod)("subarray",(function(e,t){var n=o(this),r=n.length,u=a(e,r);return new(s(n))(n.buffer,n.byteOffset+u*n.BYTES_PER_ELEMENT,i((void 0===t?r:a(t,r))-u))}))},41405:function(e,t,n){"use strict";var r=n(44576),i=n(18745),a=n(94644),o=n(79039),s=n(67680),u=r.Int8Array,c=a.aTypedArray,l=a.exportTypedArrayMethod,h=[].toLocaleString,f=!!u&&o((function(){h.call(new u(1))}));l("toLocaleString",(function(){return i(h,f?s(c(this)):c(this),s(arguments))}),o((function(){return[1,2].toLocaleString()!==new u([1,2]).toLocaleString()}))||!o((function(){u.prototype.toLocaleString.call([1,2])})))},37467:function(e,t,n){"use strict";var r=n(37628),i=n(94644),a=i.aTypedArray,o=i.exportTypedArrayMethod,s=i.getTypedArrayConstructor;o("toReversed",(function(){return r(a(this),s(this))}))},44732:function(e,t,n){"use strict";var r=n(94644),i=n(79504),a=n(79306),o=n(35370),s=r.aTypedArray,u=r.getTypedArrayConstructor,c=r.exportTypedArrayMethod,l=i(r.TypedArrayPrototype.sort);c("toSorted",(function(e){void 0!==e&&a(e);var t=s(this),n=o(u(t),t);return l(n,e)}))},33684:function(e,t,n){"use strict";var r=n(94644).exportTypedArrayMethod,i=n(79039),a=n(44576),o=n(79504),s=a.Uint8Array,u=s&&s.prototype||{},c=[].toString,l=o([].join);i((function(){c.call({})}))&&(c=function(){return l(this)});var h=u.toString!==c;r("toString",c,h)},3690:function(e,t,n){"use strict";n(15823)("Uint16",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},61740:function(e,t,n){"use strict";n(15823)("Uint32",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},21489:function(e,t,n){"use strict";n(15823)("Uint8",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},79577:function(e,t,n){"use strict";var r=n(39928),i=n(94644),a=n(18727),o=n(91291),s=n(75854),u=i.aTypedArray,c=i.getTypedArrayConstructor,l=i.exportTypedArrayMethod,h=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(e){return 8===e}}();l("with",{with:function(e,t){var n=u(this),i=o(e),l=a(n)?s(t):+t;return r(n,c(n),i,l)}}.with,!h)},65746:function(e,t,n){"use strict";var r,i=n(92744),a=n(44576),o=n(79504),s=n(56279),u=n(3451),c=n(16468),l=n(91625),h=n(20034),f=n(91181).enforce,m=n(79039),p=n(58622),d=Object,v=Array.isArray,y=d.isExtensible,g=d.isFrozen,b=d.isSealed,A=d.freeze,_=d.seal,M=!a.ActiveXObject&&"ActiveXObject"in a,k=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},w=c("WeakMap",k,l),T=w.prototype,x=o(T.set);if(p)if(M){r=l.getConstructor(k,"WeakMap",!0),u.enable();var S=o(T.delete),C=o(T.has),E=o(T.get);s(T,{delete:function(e){if(h(e)&&!y(e)){var t=f(this);return t.frozen||(t.frozen=new r),S(this,e)||t.frozen.delete(e)}return S(this,e)},has:function(e){if(h(e)&&!y(e)){var t=f(this);return t.frozen||(t.frozen=new r),C(this,e)||t.frozen.has(e)}return C(this,e)},get:function(e){if(h(e)&&!y(e)){var t=f(this);return t.frozen||(t.frozen=new r),C(this,e)?E(this,e):t.frozen.get(e)}return E(this,e)},set:function(e,t){if(h(e)&&!y(e)){var n=f(this);n.frozen||(n.frozen=new r),C(this,e)?x(this,e,t):n.frozen.set(e,t)}else x(this,e,t);return this}})}else i&&m((function(){var e=A([]);return x(new w,e,1),!g(e)}))&&s(T,{set:function(e,t){var n;return v(e)&&(g(e)?n=A:b(e)&&(n=_)),x(this,e,t),n&&n(e),this}})},73772:function(e,t,n){"use strict";n(65746)},26280:function(e,t,n){"use strict";n(16573)},47801:function(e,t,n){"use strict";n(77936)},27913:function(e,t,n){"use strict";n(78100)},46058:function(e,t,n){"use strict";var r=n(46518),i=n(77957),a=n(6469);r({target:"Array",proto:!0},{group:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("group")},33811:function(e,t,n){"use strict";var r=n(46518),i=n(90679),a=n(42787),o=n(66699),s=n(39297),u=n(78227),c=n(53982),l=n(96395),h=u("toStringTag"),f=TypeError,m=function(){if(i(this,c),a(this)===c)throw new f("Abstract class AsyncIterator not directly constructable")};m.prototype=c,s(c,h)||o(c,h,"AsyncIterator"),!l&&s(c,"constructor")&&c.constructor!==Object||o(c,"constructor",m),r({global:!0,constructor:!0,forced:l},{AsyncIterator:m})},74648:function(e,t,n){"use strict";var r=n(46518),i=n(36639).every;r({target:"AsyncIterator",proto:!0,real:!0},{every:function(e){return i(this,e)}})},17333:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(79306),o=n(28551),s=n(20034),u=n(1767),c=n(92059),l=n(62529),h=n(20772),f=n(96395),m=c((function(e){var t=this,n=t.iterator,r=t.predicate;return new e((function(a,u){var c=function(e){t.done=!0,u(e)},f=function(e){h(n,c,e,c)},m=function(){try{e.resolve(o(i(t.next,n))).then((function(n){try{if(o(n).done)t.done=!0,a(l(void 0,!0));else{var i=n.value;try{var u=r(i,t.counter++),h=function(e){e?a(l(i,!1)):m()};s(u)?e.resolve(u).then(h,f):h(u)}catch(e){f(e)}}}catch(e){c(e)}}),c)}catch(e){c(e)}};m()}))}));r({target:"AsyncIterator",proto:!0,real:!0,forced:f},{filter:function(e){return o(this),a(e),new m(u(this),{predicate:e})}})},3064:function(e,t,n){"use strict";var r=n(46518),i=n(36639).find;r({target:"AsyncIterator",proto:!0,real:!0},{find:function(e){return i(this,e)}})},9920:function(e,t,n){"use strict";var r=n(46518),i=n(36639).forEach;r({target:"AsyncIterator",proto:!0,real:!0},{forEach:function(e){return i(this,e)}})},41393:function(e,t,n){"use strict";var r=n(46518),i=n(41750);r({target:"AsyncIterator",proto:!0,real:!0,forced:n(96395)},{map:i})},14905:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(79306),o=n(28551),s=n(20034),u=n(97751),c=n(1767),l=n(20772),h=u("Promise"),f=TypeError;r({target:"AsyncIterator",proto:!0,real:!0},{reduce:function(e){o(this),a(e);var t=c(this),n=t.iterator,r=t.next,u=arguments.length<2,m=u?void 0:arguments[1],p=0;return new h((function(t,a){var c=function(e){l(n,a,e,a)},d=function(){try{h.resolve(o(i(r,n))).then((function(n){try{if(o(n).done)u?a(new f("Reduce of empty iterator with no initial value")):t(m);else{var r=n.value;if(u)u=!1,m=r,d();else try{var i=e(m,r,p),l=function(e){m=e,d()};s(i)?h.resolve(i).then(l,c):l(i)}catch(e){c(e)}}p++}catch(e){a(e)}}),a)}catch(e){a(e)}};d()}))}})},8159:function(e,t,n){"use strict";var r=n(46518),i=n(36639).some;r({target:"AsyncIterator",proto:!0,real:!0},{some:function(e){return i(this,e)}})},86994:function(e,t,n){"use strict";var r=n(46518),i=n(36639).toArray;r({target:"AsyncIterator",proto:!0,real:!0},{toArray:function(){return i(this,void 0,[])}})},98992:function(e,t,n){"use strict";n(18111)},23215:function(e,t,n){"use strict";n(81148)},54520:function(e,t,n){"use strict";n(22489)},72577:function(e,t,n){"use strict";n(20116)},3949:function(e,t,n){"use strict";n(7588)},81454:function(e,t,n){"use strict";n(61701)},8872:function(e,t,n){"use strict";n(18237)},37550:function(e,t,n){"use strict";n(13579)},41795:function(e,t,n){"use strict";n(61806)},58335:function(e,t,n){"use strict";var r=n(46518),i=n(43724),a=n(44576),o=n(97751),s=n(79504),u=n(69565),c=n(94901),l=n(20034),h=n(34376),f=n(39297),m=n(655),p=n(26198),d=n(97040),v=n(79039),y=n(616),g=n(4495),b=a.JSON,A=a.Number,_=a.SyntaxError,M=b&&b.parse,k=o("Object","keys"),w=Object.getOwnPropertyDescriptor,T=s("".charAt),x=s("".slice),S=s(/./.exec),C=s([].push),E=/^\d$/,R=/^[1-9]$/,I=/^[\d-]$/,O=/^[\t\n\r ]$/,D=function(e,t,n,r){var i,a,o,s,c,m=e[t],d=r&&m===r.value,v=d&&"string"==typeof r.source?{source:r.source}:{};if(l(m)){var y=h(m),g=d?r.nodes:y?[]:{};if(y)for(i=g.length,o=p(m),s=0;s<o;s++)P(m,s,D(m,""+s,n,s<i?g[s]:void 0));else for(a=k(m),o=p(a),s=0;s<o;s++)c=a[s],P(m,c,D(m,c,n,f(g,c)?g[c]:void 0))}return u(n,e,t,m,v)},P=function(e,t,n){if(i){var r=w(e,t);if(r&&!r.configurable)return}void 0===n?delete e[t]:d(e,t,n)},B=function(e,t,n,r){this.value=e,this.end=t,this.source=n,this.nodes=r},F=function(e,t){this.source=e,this.index=t};F.prototype={fork:function(e){return new F(this.source,e)},parse:function(){var e=this.source,t=this.skip(O,this.index),n=this.fork(t),r=T(e,t);if(S(I,r))return n.number();switch(r){case"{":return n.object();case"[":return n.array();case'"':return n.string();case"t":return n.keyword(!0);case"f":return n.keyword(!1);case"n":return n.keyword(null)}throw new _('Unexpected character: "'+r+'" at: '+t)},node:function(e,t,n,r,i){return new B(t,r,e?null:x(this.source,n,r),i)},object:function(){for(var e=this.source,t=this.index+1,n=!1,r={},i={};t<e.length;){if(t=this.until(['"',"}"],t),"}"===T(e,t)&&!n){t++;break}var a=this.fork(t).string(),o=a.value;t=a.end,t=this.until([":"],t)+1,t=this.skip(O,t),a=this.fork(t).parse(),d(i,o,a),d(r,o,a.value),t=this.until([",","}"],a.end);var s=T(e,t);if(","===s)n=!0,t++;else if("}"===s){t++;break}}return this.node(1,r,this.index,t,i)},array:function(){for(var e=this.source,t=this.index+1,n=!1,r=[],i=[];t<e.length;){if(t=this.skip(O,t),"]"===T(e,t)&&!n){t++;break}var a=this.fork(t).parse();if(C(i,a),C(r,a.value),t=this.until([",","]"],a.end),","===T(e,t))n=!0,t++;else if("]"===T(e,t)){t++;break}}return this.node(1,r,this.index,t,i)},string:function(){var e=this.index,t=y(this.source,this.index+1);return this.node(0,t.value,e,t.end)},number:function(){var e=this.source,t=this.index,n=t;if("-"===T(e,n)&&n++,"0"===T(e,n))n++;else{if(!S(R,T(e,n)))throw new _("Failed to parse number at: "+n);n=this.skip(E,n+1)}if(("."===T(e,n)&&(n=this.skip(E,n+1)),"e"===T(e,n)||"E"===T(e,n))&&(n++,"+"!==T(e,n)&&"-"!==T(e,n)||n++,n===(n=this.skip(E,n))))throw new _("Failed to parse number's exponent value at: "+n);return this.node(0,A(x(e,t,n)),t,n)},keyword:function(e){var t=""+e,n=this.index,r=n+t.length;if(x(this.source,n,r)!==t)throw new _("Failed to parse value at: "+n);return this.node(0,e,n,r)},skip:function(e,t){for(var n=this.source;t<n.length&&S(e,T(n,t));t++);return t},until:function(e,t){t=this.skip(O,t);for(var n=T(this.source,t),r=0;r<e.length;r++)if(e[r]===n)return t;throw new _('Unexpected character: "'+n+'" at: '+t)}};var N=v((function(){var e,t="9007199254740993";return M(t,(function(t,n,r){e=r.source})),e!==t})),L=g&&!v((function(){return 1/M("-0 \t")!=-1/0}));r({target:"JSON",stat:!0,forced:N},{parse:function(e,t){return L&&!c(t)?M(e):function(e,t){e=m(e);var n=new F(e,0,""),r=n.parse(),i=r.value,a=n.skip(O,r.end);if(a<e.length)throw new _('Unexpected extra character: "'+T(e,a)+'" after the parsed data at: '+a);return c(t)?D({"":i},"",t,r):i}(e,t)}})},71517:function(e,t,n){"use strict";var r=n(46518),i=n(36194),a=n(72248).remove;r({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),n=!0,r=0,o=arguments.length;r<o;r++)e=a(t,arguments[r]),n=n&&e;return!!n}})},11379:function(e,t,n){"use strict";var r=n(46518),i=n(36194),a=n(72248),o=a.get,s=a.has,u=a.set;r({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var n,r,a=i(this);return s(a,e)?(n=o(a,e),"update"in t&&(n=t.update(n,e,a),u(a,e,n)),n):(r=t.insert(e,a),u(a,e,r),r)}})},93777:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(36194),o=n(26223);r({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0);return!1!==o(t,(function(e,r){if(!n(e,r,t))return!1}),!0)}})},14190:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(36194),o=n(72248),s=n(26223),u=o.Map,c=o.set;r({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=new u;return s(t,(function(e,i){n(e,i,t)&&c(r,i,e)})),r}})},86097:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(36194),o=n(26223);r({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=o(t,(function(e,r){if(n(e,r,t))return{key:r}}),!0);return r&&r.key}})},12359:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(36194),o=n(26223);r({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=o(t,(function(e,r){if(n(e,r,t))return{value:e}}),!0);return r&&r.value}})},17273:function(e,t,n){"use strict";var r=n(46518),i=n(33317),a=n(36194),o=n(26223);r({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===o(a(this),(function(t){if(i(t,e))return!0}),!0)}})},27415:function(e,t,n){"use strict";var r=n(46518),i=n(36194),a=n(26223);r({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=a(i(this),(function(t,n){if(t===e)return{key:n}}),!0);return t&&t.key}})},19929:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(36194),o=n(72248),s=n(26223),u=o.Map,c=o.set;r({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=new u;return s(t,(function(e,i){c(r,n(e,i,t),e)})),r}})},37583:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(36194),o=n(72248),s=n(26223),u=o.Map,c=o.set;r({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=new u;return s(t,(function(e,i){c(r,i,n(e,i,t))})),r}})},55122:function(e,t,n){"use strict";var r=n(46518),i=n(36194),a=n(72652),o=n(72248).set;r({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=i(this),n=arguments.length,r=0;r<n;)a(arguments[r++],(function(e,n){o(t,e,n)}),{AS_ENTRIES:!0});return t}})},20230:function(e,t,n){"use strict";var r=n(46518),i=n(79306),a=n(36194),o=n(26223),s=TypeError;r({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=a(this),n=arguments.length<2,r=n?void 0:arguments[1];if(i(e),o(t,(function(i,a){n?(n=!1,r=i):r=e(r,i,a,t)})),n)throw new s("Reduce of empty map with no initial value");return r}})},57268:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(36194),o=n(26223);r({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0);return!0===o(t,(function(e,r){if(n(e,r,t))return!0}),!0)}})},79733:function(e,t,n){"use strict";var r=n(46518),i=n(79306),a=n(36194),o=n(72248),s=TypeError,u=o.get,c=o.has,l=o.set;r({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var n=a(this),r=arguments.length;i(t);var o=c(n,e);if(!o&&r<3)throw new s("Updating absent value");var h=o?u(n,e):i(r>2?arguments[2]:void 0)(e,n);return l(n,e,t(h,e,n)),n}})},25509:function(e,t,n){"use strict";var r=n(46518),i=n(97080),a=n(94402).add;r({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var e=i(this),t=0,n=arguments.length;t<n;t++)a(e,arguments[t]);return e}})},65223:function(e,t,n){"use strict";var r=n(46518),i=n(97080),a=n(94402).remove;r({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),n=!0,r=0,o=arguments.length;r<o;r++)e=a(t,arguments[r]),n=n&&e;return!!n}})},60321:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(47650),o=n(83440);r({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){return i(o,this,a(e))}})},43375:function(e,t,n){"use strict";n(17642)},41927:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(97080),o=n(38469);r({target:"Set",proto:!0,real:!0,forced:!0},{every:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0);return!1!==o(t,(function(e){if(!n(e,e,t))return!1}),!0)}})},11632:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(97080),o=n(94402),s=n(38469),u=o.Set,c=o.add;r({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=new u;return s(t,(function(e){n(e,e,t)&&c(r,e)})),r}})},64377:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(97080),o=n(38469);r({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=o(t,(function(e){if(n(e,e,t))return{value:e}}),!0);return r&&r.value}})},66771:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(47650),o=n(68750);r({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){return i(o,this,a(e))}})},39225:function(e,t,n){"use strict";n(58004)},12516:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(47650),o=n(64449);r({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){return i(o,this,a(e))}})},13972:function(e,t,n){"use strict";n(33853)},68931:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(47650),o=n(53838);r({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){return i(o,this,a(e))}})},99209:function(e,t,n){"use strict";n(45876)},52514:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(47650),o=n(28527);r({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){return i(o,this,a(e))}})},25714:function(e,t,n){"use strict";n(32475)},35694:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(97080),o=n(38469),s=n(655),u=i([].join),c=i([].push);r({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=a(this),n=void 0===e?",":s(e),r=[];return o(t,(function(e){c(r,e)})),u(r,n)}})},52774:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(97080),o=n(94402),s=n(38469),u=o.Set,c=o.add;r({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=new u;return s(t,(function(e){c(r,n(e,e,t))})),r}})},49536:function(e,t,n){"use strict";var r=n(46518),i=n(79306),a=n(97080),o=n(38469),s=TypeError;r({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=a(this),n=arguments.length<2,r=n?void 0:arguments[1];if(i(e),o(t,(function(i){n?(n=!1,r=i):r=e(r,i,i,t)})),n)throw new s("Reduce of empty set with no initial value");return r}})},21926:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(97080),o=n(38469);r({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0);return!0===o(t,(function(e){if(n(e,e,t))return!0}),!0)}})},16864:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(47650),o=n(83650);r({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){return i(o,this,a(e))}})},17561:function(e,t,n){"use strict";n(15024)},16215:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(47650),o=n(44204);r({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){return i(o,this,a(e))}})},66197:function(e,t,n){"use strict";n(31698)},47350:function(e,t,n){"use strict";var r=n(94644),i=n(59213).filterReject,a=n(29948),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("filterReject",(function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return a(this,t)}),!0)},23241:function(e,t,n){"use strict";var r=n(94644),i=n(77957),a=r.aTypedArray,o=r.getTypedArrayConstructor;(0,r.exportTypedArrayMethod)("groupBy",(function(e){var t=arguments.length>1?arguments[1]:void 0;return i(a(this),e,t,o)}),!0)},67302:function(e,t,n){"use strict";var r=n(94644),i=n(26198),a=n(18727),o=n(35610),s=n(75854),u=n(91291),c=n(79039),l=r.aTypedArray,h=r.getTypedArrayConstructor,f=r.exportTypedArrayMethod,m=Math.max,p=Math.min;f("toSpliced",(function(e,t){var n,r,c,f,d,v,y,g=l(this),b=h(g),A=i(g),_=o(e,A),M=arguments.length,k=0;if(0===M)n=r=0;else if(1===M)n=0,r=A-_;else if(r=p(m(u(t),0),A-_),n=M-2){f=new b(n),c=a(f);for(var w=2;w<M;w++)d=arguments[w],f[w-2]=c?s(d):+d}for(y=new b(v=A+n-r);k<_;k++)y[k]=g[k];for(;k<_+n;k++)y[k]=f[k-_];for(;k<v;k++)y[k]=g[k+r-n];return y}),!!c((function(){var e=new Int8Array([1]),t=e.toSpliced(1,0,{valueOf:function(){return e[0]=2,3}});return 2!==t[0]||3!==t[1]})))},55871:function(e,t,n){"use strict";var r=n(79504),i=n(94644),a=n(35370),o=n(79565),s=i.aTypedArray,u=i.getTypedArrayConstructor,c=i.exportTypedArrayMethod,l=r(o);c("uniqueBy",(function(e){return s(this),a(u(this),l(this,e))}),!0)},67348:function(e,t,n){"use strict";var r=n(46518),i=n(76557),a=n(44995).remove;r({target:"WeakMap",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),n=!0,r=0,o=arguments.length;r<o;r++)e=a(t,arguments[r]),n=n&&e;return!!n}})},35644:function(e,t,n){"use strict";var r=n(46518),i=n(76557),a=n(44995),o=a.get,s=a.has,u=a.set;r({target:"WeakMap",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var n,r,a=i(this);return s(a,e)?(n=o(a,e),"update"in t&&(n=t.update(n,e,a),u(a,e,n)),n):(r=t.insert(e,a),u(a,e,r),r)}})},2945:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(97751),o=n(79504),s=n(69565),u=n(79039),c=n(655),l=n(22812),h=n(92804).c2i,f=/[^\d+/a-z]/i,m=/[\t\n\f\r ]+/g,p=/[=]{1,2}$/,d=a("atob"),v=String.fromCharCode,y=o("".charAt),g=o("".replace),b=o(f.exec),A=!!d&&!u((function(){return"hi"!==d("aGk=")})),_=A&&u((function(){return""!==d(" ")})),M=A&&!u((function(){d("a")})),k=A&&!u((function(){d()})),w=A&&1!==d.length;r({global:!0,bind:!0,enumerable:!0,forced:!A||_||M||k||w},{atob:function(e){if(l(arguments.length,1),A&&!_&&!M)return s(d,i,e);var t,n,r,o=g(c(e),m,""),u="",k=0,w=0;if(o.length%4==0&&(o=g(o,p,"")),(t=o.length)%4==1||b(f,o))throw new(a("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;k<t;)n=y(o,k++),r=w%4?64*r+h[n]:h[n],w++%4&&(u+=v(255&r>>(-2*w&6)));return u}})},42207:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(97751),o=n(79504),s=n(69565),u=n(79039),c=n(655),l=n(22812),h=n(92804).i2c,f=a("btoa"),m=o("".charAt),p=o("".charCodeAt),d=!!f&&!u((function(){return"aGk="!==f("hi")})),v=d&&!u((function(){f()})),y=d&&u((function(){return"bnVsbA=="!==f(null)})),g=d&&1!==f.length;r({global:!0,bind:!0,enumerable:!0,forced:!d||v||y||g},{btoa:function(e){if(l(arguments.length,1),d)return s(f,i,c(e));for(var t,n,r=c(e),o="",u=0,v=h;m(r,u)||(v="=",u%1);){if((n=p(r,u+=3/4))>255)throw new(a("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");o+=m(v,63&(t=t<<8|n)>>8-u%1*8)}return o}})},23500:function(e,t,n){"use strict";var r=n(44576),i=n(67400),a=n(79296),o=n(90235),s=n(66699),u=function(e){if(e&&e.forEach!==o)try{s(e,"forEach",o)}catch(t){e.forEach=o}};for(var c in i)i[c]&&u(r[c]&&r[c].prototype);u(a)},62953:function(e,t,n){"use strict";var r=n(44576),i=n(67400),a=n(79296),o=n(23792),s=n(66699),u=n(10687),c=n(78227)("iterator"),l=o.values,h=function(e,t){if(e){if(e[c]!==l)try{s(e,c,l)}catch(t){e[c]=l}if(u(e,t,!0),i[t])for(var n in o)if(e[n]!==o[n])try{s(e,n,o[n])}catch(t){e[n]=o[n]}}};for(var f in i)h(r[f]&&r[f].prototype,f);h(a,"DOMTokenList")},55815:function(e,t,n){"use strict";var r=n(46518),i=n(97751),a=n(89429),o=n(79039),s=n(2360),u=n(6980),c=n(24913).f,l=n(36840),h=n(62106),f=n(39297),m=n(90679),p=n(28551),d=n(77536),v=n(32603),y=n(55002),g=n(38574),b=n(91181),A=n(43724),_=n(96395),M="DOMException",k="DATA_CLONE_ERR",w=i("Error"),T=i(M)||function(){try{(new(i("MessageChannel")||a("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(e){if(e.name===k&&25===e.code)return e.constructor}}(),x=T&&T.prototype,S=w.prototype,C=b.set,E=b.getterFor(M),R="stack"in new w(M),I=function(e){return f(y,e)&&y[e].m?y[e].c:0},O=function(){m(this,D);var e=arguments.length,t=v(e<1?void 0:arguments[0]),n=v(e<2?void 0:arguments[1],"Error"),r=I(n);if(C(this,{type:M,name:n,message:t,code:r}),A||(this.name=n,this.message=t,this.code=r),R){var i=new w(t);i.name=M,c(this,"stack",u(1,g(i.stack,1)))}},D=O.prototype=s(S),P=function(e){return{enumerable:!0,configurable:!0,get:e}},B=function(e){return P((function(){return E(this)[e]}))};A&&(h(D,"code",B("code")),h(D,"message",B("message")),h(D,"name",B("name"))),c(D,"constructor",u(1,O));var F=o((function(){return!(new T instanceof w)})),N=F||o((function(){return S.toString!==d||"2: 1"!==String(new T(1,2))})),L=F||o((function(){return 25!==new T(1,"DataCloneError").code})),j=F||25!==T[k]||25!==x[k],U=_?N||L||j:F;r({global:!0,constructor:!0,forced:U},{DOMException:U?O:T});var V=i(M),z=V.prototype;for(var H in N&&(_||T===V)&&l(z,"toString",d),L&&A&&T===V&&h(z,"code",P((function(){return I(p(this).name)}))),y)if(f(y,H)){var G=y[H],q=G.s,W=u(6,G.c);f(V,q)||c(V,q,W),f(z,q)||c(z,q,W)}},64979:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(97751),o=n(6980),s=n(24913).f,u=n(39297),c=n(90679),l=n(23167),h=n(32603),f=n(55002),m=n(38574),p=n(43724),d=n(96395),v="DOMException",y=a("Error"),g=a(v),b=function(){c(this,A);var e=arguments.length,t=h(e<1?void 0:arguments[0]),n=h(e<2?void 0:arguments[1],"Error"),r=new g(t,n),i=new y(t);return i.name=v,s(r,"stack",o(1,m(i.stack,1))),l(r,this,b),r},A=b.prototype=g.prototype,_="stack"in new y(v),M="stack"in new g(1,2),k=g&&p&&Object.getOwnPropertyDescriptor(i,v),w=!(!k||k.writable&&k.configurable),T=_&&!w&&!M;r({global:!0,constructor:!0,forced:d||T},{DOMException:T?b:g});var x=a(v),S=x.prototype;if(S.constructor!==x)for(var C in d||s(S,"constructor",o(1,x)),f)if(u(f,C)){var E=f[C],R=E.s;u(x,R)||s(x,R,o(6,E.c))}},79739:function(e,t,n){"use strict";var r=n(97751),i="DOMException";n(10687)(r(i),i)},13611:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(62106),o=n(43724),s=TypeError,u=Object.defineProperty,c=i.self!==i;try{if(o){var l=Object.getOwnPropertyDescriptor(i,"self");!c&&l&&l.get&&l.enumerable||a(i,"self",{get:function(){return i},set:function(e){if(this!==i)throw new s("Illegal invocation");u(i,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else r({global:!0,simple:!0,forced:c},{self:i})}catch(e){}},71678:function(e,t,n){"use strict";var r,i=n(96395),a=n(46518),o=n(44576),s=n(97751),u=n(79504),c=n(79039),l=n(33392),h=n(94901),f=n(33517),m=n(64117),p=n(20034),d=n(10757),v=n(72652),y=n(28551),g=n(36955),b=n(39297),A=n(97040),_=n(66699),M=n(26198),k=n(22812),w=n(61034),T=n(72248),x=n(94402),S=n(38469),C=n(94483),E=n(24659),R=n(1548),I=o.Object,O=o.Array,D=o.Date,P=o.Error,B=o.TypeError,F=o.PerformanceMark,N=s("DOMException"),L=T.Map,j=T.has,U=T.get,V=T.set,z=x.Set,H=x.add,G=x.has,q=s("Object","keys"),W=u([].push),K=u((!0).valueOf),X=u(1..valueOf),Y=u("".valueOf),$=u(D.prototype.getTime),Z=l("structuredClone"),Q="DataCloneError",J="Transferring",ee=function(e){return!c((function(){var t=new o.Set([7]),n=e(t),r=e(I(7));return n===t||!n.has(7)||!p(r)||7!=+r}))&&e},te=function(e,t){return!c((function(){var n=new t,r=e({a:n,b:n});return!(r&&r.a===r.b&&r.a instanceof t&&r.a.stack===n.stack)}))},ne=o.structuredClone,re=i||!te(ne,P)||!te(ne,N)||(r=ne,!!c((function(){var e=r(new o.AggregateError([1],Z,{cause:3}));return"AggregateError"!==e.name||1!==e.errors[0]||e.message!==Z||3!==e.cause}))),ie=!ne&&ee((function(e){return new F(Z,{detail:e}).detail})),ae=ee(ne)||ie,oe=function(e){throw new N("Uncloneable type: "+e,Q)},se=function(e,t){throw new N((t||"Cloning")+" of "+e+" cannot be properly polyfilled in this engine",Q)},ue=function(e,t){return ae||se(t),ae(e)},ce=function(e,t,n){if(j(t,e))return U(t,e);var r,i,a,s,u,c;if("SharedArrayBuffer"===(n||g(e)))r=ae?ae(e):e;else{var l=o.DataView;l||h(e.slice)||se("ArrayBuffer");try{if(h(e.slice)&&!e.resizable)r=e.slice(0);else{i=e.byteLength,a="maxByteLength"in e?{maxByteLength:e.maxByteLength}:void 0,r=new ArrayBuffer(i,a),s=new l(e),u=new l(r);for(c=0;c<i;c++)u.setUint8(c,s.getUint8(c))}}catch(e){throw new N("ArrayBuffer is detached",Q)}}return V(t,e,r),r},le=function(e,t){if(d(e)&&oe("Symbol"),!p(e))return e;if(t){if(j(t,e))return U(t,e)}else t=new L;var n,r,i,a,u,c,l,f,m=g(e);switch(m){case"Array":i=O(M(e));break;case"Object":i={};break;case"Map":i=new L;break;case"Set":i=new z;break;case"RegExp":i=new RegExp(e.source,w(e));break;case"Error":switch(r=e.name){case"AggregateError":i=new(s(r))([]);break;case"EvalError":case"RangeError":case"ReferenceError":case"SuppressedError":case"SyntaxError":case"TypeError":case"URIError":i=new(s(r));break;case"CompileError":case"LinkError":case"RuntimeError":i=new(s("WebAssembly",r));break;default:i=new P}break;case"DOMException":i=new N(e.message,e.name);break;case"ArrayBuffer":case"SharedArrayBuffer":i=ce(e,t,m);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":c="DataView"===m?e.byteLength:e.length,i=function(e,t,n,r,i){var a=o[t];return p(a)||se(t),new a(ce(e.buffer,i),n,r)}(e,m,e.byteOffset,c,t);break;case"DOMQuad":try{i=new DOMQuad(le(e.p1,t),le(e.p2,t),le(e.p3,t),le(e.p4,t))}catch(t){i=ue(e,m)}break;case"File":if(ae)try{i=ae(e),g(i)!==m&&(i=void 0)}catch(e){}if(!i)try{i=new File([e],e.name,e)}catch(e){}i||se(m);break;case"FileList":if(a=function(){var e;try{e=new o.DataTransfer}catch(t){try{e=new o.ClipboardEvent("").clipboardData}catch(e){}}return e&&e.items&&e.files?e:null}()){for(u=0,c=M(e);u<c;u++)a.items.add(le(e[u],t));i=a.files}else i=ue(e,m);break;case"ImageData":try{i=new ImageData(le(e.data,t),e.width,e.height,{colorSpace:e.colorSpace})}catch(t){i=ue(e,m)}break;default:if(ae)i=ae(e);else switch(m){case"BigInt":i=I(e.valueOf());break;case"Boolean":i=I(K(e));break;case"Number":i=I(X(e));break;case"String":i=I(Y(e));break;case"Date":i=new D($(e));break;case"Blob":try{i=e.slice(0,e.size,e.type)}catch(e){se(m)}break;case"DOMPoint":case"DOMPointReadOnly":n=o[m];try{i=n.fromPoint?n.fromPoint(e):new n(e.x,e.y,e.z,e.w)}catch(e){se(m)}break;case"DOMRect":case"DOMRectReadOnly":n=o[m];try{i=n.fromRect?n.fromRect(e):new n(e.x,e.y,e.width,e.height)}catch(e){se(m)}break;case"DOMMatrix":case"DOMMatrixReadOnly":n=o[m];try{i=n.fromMatrix?n.fromMatrix(e):new n(e)}catch(e){se(m)}break;case"AudioData":case"VideoFrame":h(e.clone)||se(m);try{i=e.clone()}catch(e){oe(m)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":se(m);default:oe(m)}}switch(V(t,e,i),m){case"Array":case"Object":for(l=q(e),u=0,c=M(l);u<c;u++)f=l[u],A(i,f,le(e[f],t));break;case"Map":e.forEach((function(e,n){V(i,le(n,t),le(e,t))}));break;case"Set":e.forEach((function(e){H(i,le(e,t))}));break;case"Error":_(i,"message",le(e.message,t)),b(e,"cause")&&_(i,"cause",le(e.cause,t)),"AggregateError"===r?i.errors=le(e.errors,t):"SuppressedError"===r&&(i.error=le(e.error,t),i.suppressed=le(e.suppressed,t));case"DOMException":E&&_(i,"stack",le(e.stack,t))}return i};a({global:!0,enumerable:!0,sham:!R,forced:re},{structuredClone:function(e){var t,n,r=k(arguments.length,1)>1&&!m(arguments[1])?y(arguments[1]):void 0,i=r?r.transfer:void 0;void 0!==i&&(n=function(e,t){if(!p(e))throw new B("Transfer option cannot be converted to a sequence");var n=[];v(e,(function(e){W(n,y(e))}));for(var r,i,a,s,u,c=0,l=M(n),m=new z;c<l;){if(r=n[c++],"ArrayBuffer"===(i=g(r))?G(m,r):j(t,r))throw new N("Duplicate transferable",Q);if("ArrayBuffer"!==i){if(R)s=ne(r,{transfer:[r]});else switch(i){case"ImageBitmap":a=o.OffscreenCanvas,f(a)||se(i,J);try{(u=new a(r.width,r.height)).getContext("bitmaprenderer").transferFromImageBitmap(r),s=u.transferToImageBitmap()}catch(e){}break;case"AudioData":case"VideoFrame":h(r.clone)&&h(r.close)||se(i,J);try{s=r.clone(),r.close()}catch(e){}break;case"MediaSourceHandle":case"MessagePort":case"MIDIAccess":case"OffscreenCanvas":case"ReadableStream":case"RTCDataChannel":case"TransformStream":case"WebTransportReceiveStream":case"WebTransportSendStream":case"WritableStream":se(i,J)}if(void 0===s)throw new N("This object cannot be transferred: "+i,Q);V(t,r,s)}else H(m,r)}return m}(i,t=new L));var a=le(e,t);return n&&function(e){S(e,(function(e){R?ae(e,{transfer:[e]}):h(e.transfer)?e.transfer():C?C(e):se("ArrayBuffer",J)}))}(n),a}})},98406:function(e,t,n){"use strict";n(23792),n(27337);var r=n(46518),i=n(44576),a=n(93389),o=n(97751),s=n(69565),u=n(79504),c=n(43724),l=n(67416),h=n(36840),f=n(62106),m=n(56279),p=n(10687),d=n(33994),v=n(91181),y=n(90679),g=n(94901),b=n(39297),A=n(76080),_=n(36955),M=n(28551),k=n(20034),w=n(655),T=n(2360),x=n(6980),S=n(70081),C=n(50851),E=n(62529),R=n(22812),I=n(78227),O=n(74488),D=I("iterator"),P="URLSearchParams",B=P+"Iterator",F=v.set,N=v.getterFor(P),L=v.getterFor(B),j=a("fetch"),U=a("Request"),V=a("Headers"),z=U&&U.prototype,H=V&&V.prototype,G=i.TypeError,q=i.encodeURIComponent,W=String.fromCharCode,K=o("String","fromCodePoint"),X=parseInt,Y=u("".charAt),$=u([].join),Z=u([].push),Q=u("".replace),J=u([].shift),ee=u([].splice),te=u("".split),ne=u("".slice),re=u(/./.exec),ie=/\+/g,ae=/^[0-9a-f]+$/i,oe=function(e,t){var n=ne(e,t,t+2);return re(ae,n)?X(n,16):NaN},se=function(e){for(var t=0,n=128;n>0&&e&n;n>>=1)t++;return t},ue=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},ce=function(e){for(var t=(e=Q(e,ie," ")).length,n="",r=0;r<t;){var i=Y(e,r);if("%"===i){if("%"===Y(e,r+1)||r+3>t){n+="%",r++;continue}var a=oe(e,r+1);if(a!=a){n+=i,r++;continue}r+=2;var o=se(a);if(0===o)i=W(a);else{if(1===o||o>4){n+="�",r++;continue}for(var s=[a],u=1;u<o&&!(++r+3>t||"%"!==Y(e,r));){var c=oe(e,r+1);if(c!=c){r+=3;break}if(c>191||c<128)break;Z(s,c),r+=2,u++}if(s.length!==o){n+="�";continue}var l=ue(s);null===l?n+="�":i=K(l)}}n+=i,r++}return n},le=/[!'()~]|%20/g,he={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},fe=function(e){return he[e]},me=function(e){return Q(q(e),le,fe)},pe=d((function(e,t){F(this,{type:B,target:N(e).entries,index:0,kind:t})}),P,(function(){var e=L(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,E(void 0,!0);var r=t[n];switch(e.kind){case"keys":return E(r.key,!1);case"values":return E(r.value,!1)}return E([r.key,r.value],!1)}),!0),de=function(e){this.entries=[],this.url=null,void 0!==e&&(k(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Y(e,0)?ne(e,1):e:w(e)))};de.prototype={type:P,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,r,i,a,o,u,c=this.entries,l=C(e);if(l)for(n=(t=S(e,l)).next;!(r=s(n,t)).done;){if(a=(i=S(M(r.value))).next,(o=s(a,i)).done||(u=s(a,i)).done||!s(a,i).done)throw new G("Expected sequence with length 2");Z(c,{key:w(o.value),value:w(u.value)})}else for(var h in e)b(e,h)&&Z(c,{key:h,value:w(e[h])})},parseQuery:function(e){if(e)for(var t,n,r=this.entries,i=te(e,"&"),a=0;a<i.length;)(t=i[a++]).length&&(n=te(t,"="),Z(r,{key:ce(J(n)),value:ce($(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],r=0;r<t.length;)e=t[r++],Z(n,me(e.key)+"="+me(e.value));return $(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ve=function(){y(this,ye);var e=F(this,new de(arguments.length>0?arguments[0]:void 0));c||(this.size=e.entries.length)},ye=ve.prototype;if(m(ye,{append:function(e,t){var n=N(this);R(arguments.length,2),Z(n.entries,{key:w(e),value:w(t)}),c||this.length++,n.updateURL()},delete:function(e){for(var t=N(this),n=R(arguments.length,1),r=t.entries,i=w(e),a=n<2?void 0:arguments[1],o=void 0===a?a:w(a),s=0;s<r.length;){var u=r[s];if(u.key!==i||void 0!==o&&u.value!==o)s++;else if(ee(r,s,1),void 0!==o)break}c||(this.size=r.length),t.updateURL()},get:function(e){var t=N(this).entries;R(arguments.length,1);for(var n=w(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){var t=N(this).entries;R(arguments.length,1);for(var n=w(e),r=[],i=0;i<t.length;i++)t[i].key===n&&Z(r,t[i].value);return r},has:function(e){for(var t=N(this).entries,n=R(arguments.length,1),r=w(e),i=n<2?void 0:arguments[1],a=void 0===i?i:w(i),o=0;o<t.length;){var s=t[o++];if(s.key===r&&(void 0===a||s.value===a))return!0}return!1},set:function(e,t){var n=N(this);R(arguments.length,1);for(var r,i=n.entries,a=!1,o=w(e),s=w(t),u=0;u<i.length;u++)(r=i[u]).key===o&&(a?ee(i,u--,1):(a=!0,r.value=s));a||Z(i,{key:o,value:s}),c||(this.size=i.length),n.updateURL()},sort:function(){var e=N(this);O(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=N(this).entries,r=A(e,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new pe(this,"keys")},values:function(){return new pe(this,"values")},entries:function(){return new pe(this,"entries")}},{enumerable:!0}),h(ye,D,ye.entries,{name:"entries"}),h(ye,"toString",(function(){return N(this).serialize()}),{enumerable:!0}),c&&f(ye,"size",{get:function(){return N(this).entries.length},configurable:!0,enumerable:!0}),p(ve,P),r({global:!0,constructor:!0,forced:!l},{URLSearchParams:ve}),!l&&g(V)){var ge=u(H.has),be=u(H.set),Ae=function(e){if(k(e)){var t,n=e.body;if(_(n)===P)return t=e.headers?new V(e.headers):new V,ge(t,"content-type")||be(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),T(e,{body:x(0,w(n)),headers:x(0,t)})}return e};if(g(j)&&r({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return j(e,arguments.length>1?Ae(arguments[1]):{})}}),g(U)){var _e=function(e){return y(this,z),new U(e,arguments.length>1?Ae(arguments[1]):{})};z.constructor=_e,_e.prototype=z,r({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:_e})}}e.exports={URLSearchParams:ve,getState:N}},48408:function(e,t,n){"use strict";n(98406)},98721:function(e,t,n){"use strict";var r=n(43724),i=n(79504),a=n(62106),o=URLSearchParams.prototype,s=i(o.forEach);r&&!("size"in o)&&a(o,"size",{get:function(){var e=0;return s(this,(function(){e++})),e},configurable:!0,enumerable:!0})},45806:function(e,t,n){"use strict";n(47764);var r,i=n(46518),a=n(43724),o=n(67416),s=n(44576),u=n(76080),c=n(79504),l=n(36840),h=n(62106),f=n(90679),m=n(39297),p=n(44213),d=n(97916),v=n(67680),y=n(68183).codeAt,g=n(3717),b=n(655),A=n(10687),_=n(22812),M=n(98406),k=n(91181),w=k.set,T=k.getterFor("URL"),x=M.URLSearchParams,S=M.getState,C=s.URL,E=s.TypeError,R=s.parseInt,I=Math.floor,O=Math.pow,D=c("".charAt),P=c(/./.exec),B=c([].join),F=c(1..toString),N=c([].pop),L=c([].push),j=c("".replace),U=c([].shift),V=c("".split),z=c("".slice),H=c("".toLowerCase),G=c([].unshift),q="Invalid scheme",W="Invalid host",K="Invalid port",X=/[a-z]/i,Y=/[\d+-.a-z]/i,$=/\d/,Z=/^0x/i,Q=/^[0-7]+$/,J=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ne=/[\0\t\n\r #/:<>?@[\\\]^|]/,re=/^[\u0000-\u0020]+/,ie=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ae=/[\t\n\r]/g,oe=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)G(t,e%256),e=I(e/256);return B(t,".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,a=0;a<8;a++)0!==e[a]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=a),++i);return i>n?r:t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=F(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},se={},ue=p({},se,{" ":1,'"':1,"<":1,">":1,"`":1}),ce=p({},ue,{"#":1,"?":1,"{":1,"}":1}),le=p({},ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),he=function(e,t){var n=y(e,0);return n>32&&n<127&&!m(t,e)?e:encodeURIComponent(e)},fe={ftp:21,file:null,http:80,https:443,ws:80,wss:443},me=function(e,t){var n;return 2===e.length&&P(X,D(e,0))&&(":"===(n=D(e,1))||!t&&"|"===n)},pe=function(e){var t;return e.length>1&&me(z(e,0,2))&&(2===e.length||"/"===(t=D(e,2))||"\\"===t||"?"===t||"#"===t)},de=function(e){return"."===e||"%2e"===H(e)},ve={},ye={},ge={},be={},Ae={},_e={},Me={},ke={},we={},Te={},xe={},Se={},Ce={},Ee={},Re={},Ie={},Oe={},De={},Pe={},Be={},Fe={},Ne=function(e,t,n){var r,i,a,o=b(e);if(t){if(i=this.parse(o))throw new E(i);this.searchParams=null}else{if(void 0!==n&&(r=new Ne(n,!0)),i=this.parse(o,null,r))throw new E(i);(a=S(new x)).bindURL(this),this.searchParams=a}};Ne.prototype={type:"URL",parse:function(e,t,n){var i,a,o,s,u,c=this,l=t||ve,h=0,f="",p=!1,y=!1,g=!1;for(e=b(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=j(e,re,""),e=j(e,ie,"$1")),e=j(e,ae,""),i=d(e);h<=i.length;){switch(a=i[h],l){case ve:if(!a||!P(X,a)){if(t)return q;l=ge;continue}f+=H(a),l=ye;break;case ye:if(a&&(P(Y,a)||"+"===a||"-"===a||"."===a))f+=H(a);else{if(":"!==a){if(t)return q;f="",l=ge,h=0;continue}if(t&&(c.isSpecial()!==m(fe,f)||"file"===f&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=f,t)return void(c.isSpecial()&&fe[c.scheme]===c.port&&(c.port=null));f="","file"===c.scheme?l=Ee:c.isSpecial()&&n&&n.scheme===c.scheme?l=be:c.isSpecial()?l=ke:"/"===i[h+1]?(l=Ae,h++):(c.cannotBeABaseURL=!0,L(c.path,""),l=Pe)}break;case ge:if(!n||n.cannotBeABaseURL&&"#"!==a)return q;if(n.cannotBeABaseURL&&"#"===a){c.scheme=n.scheme,c.path=v(n.path),c.query=n.query,c.fragment="",c.cannotBeABaseURL=!0,l=Fe;break}l="file"===n.scheme?Ee:_e;continue;case be:if("/"!==a||"/"!==i[h+1]){l=_e;continue}l=we,h++;break;case Ae:if("/"===a){l=Te;break}l=De;continue;case _e:if(c.scheme=n.scheme,a===r)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=v(n.path),c.query=n.query;else if("/"===a||"\\"===a&&c.isSpecial())l=Me;else if("?"===a)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=v(n.path),c.query="",l=Be;else{if("#"!==a){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=v(n.path),c.path.length--,l=De;continue}c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=v(n.path),c.query=n.query,c.fragment="",l=Fe}break;case Me:if(!c.isSpecial()||"/"!==a&&"\\"!==a){if("/"!==a){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,l=De;continue}l=Te}else l=we;break;case ke:if(l=we,"/"!==a||"/"!==D(f,h+1))continue;h++;break;case we:if("/"!==a&&"\\"!==a){l=Te;continue}break;case Te:if("@"===a){p&&(f="%40"+f),p=!0,o=d(f);for(var A=0;A<o.length;A++){var _=o[A];if(":"!==_||g){var M=he(_,le);g?c.password+=M:c.username+=M}else g=!0}f=""}else if(a===r||"/"===a||"?"===a||"#"===a||"\\"===a&&c.isSpecial()){if(p&&""===f)return"Invalid authority";h-=d(f).length+1,f="",l=xe}else f+=a;break;case xe:case Se:if(t&&"file"===c.scheme){l=Ie;continue}if(":"!==a||y){if(a===r||"/"===a||"?"===a||"#"===a||"\\"===a&&c.isSpecial()){if(c.isSpecial()&&""===f)return W;if(t&&""===f&&(c.includesCredentials()||null!==c.port))return;if(s=c.parseHost(f))return s;if(f="",l=Oe,t)return;continue}"["===a?y=!0:"]"===a&&(y=!1),f+=a}else{if(""===f)return W;if(s=c.parseHost(f))return s;if(f="",l=Ce,t===Se)return}break;case Ce:if(!P($,a)){if(a===r||"/"===a||"?"===a||"#"===a||"\\"===a&&c.isSpecial()||t){if(""!==f){var k=R(f,10);if(k>65535)return K;c.port=c.isSpecial()&&k===fe[c.scheme]?null:k,f=""}if(t)return;l=Oe;continue}return K}f+=a;break;case Ee:if(c.scheme="file","/"===a||"\\"===a)l=Re;else{if(!n||"file"!==n.scheme){l=De;continue}switch(a){case r:c.host=n.host,c.path=v(n.path),c.query=n.query;break;case"?":c.host=n.host,c.path=v(n.path),c.query="",l=Be;break;case"#":c.host=n.host,c.path=v(n.path),c.query=n.query,c.fragment="",l=Fe;break;default:pe(B(v(i,h),""))||(c.host=n.host,c.path=v(n.path),c.shortenPath()),l=De;continue}}break;case Re:if("/"===a||"\\"===a){l=Ie;break}n&&"file"===n.scheme&&!pe(B(v(i,h),""))&&(me(n.path[0],!0)?L(c.path,n.path[0]):c.host=n.host),l=De;continue;case Ie:if(a===r||"/"===a||"\\"===a||"?"===a||"#"===a){if(!t&&me(f))l=De;else if(""===f){if(c.host="",t)return;l=Oe}else{if(s=c.parseHost(f))return s;if("localhost"===c.host&&(c.host=""),t)return;f="",l=Oe}continue}f+=a;break;case Oe:if(c.isSpecial()){if(l=De,"/"!==a&&"\\"!==a)continue}else if(t||"?"!==a)if(t||"#"!==a){if(a!==r&&(l=De,"/"!==a))continue}else c.fragment="",l=Fe;else c.query="",l=Be;break;case De:if(a===r||"/"===a||"\\"===a&&c.isSpecial()||!t&&("?"===a||"#"===a)){if(".."===(u=H(u=f))||"%2e."===u||".%2e"===u||"%2e%2e"===u?(c.shortenPath(),"/"===a||"\\"===a&&c.isSpecial()||L(c.path,"")):de(f)?"/"===a||"\\"===a&&c.isSpecial()||L(c.path,""):("file"===c.scheme&&!c.path.length&&me(f)&&(c.host&&(c.host=""),f=D(f,0)+":"),L(c.path,f)),f="","file"===c.scheme&&(a===r||"?"===a||"#"===a))for(;c.path.length>1&&""===c.path[0];)U(c.path);"?"===a?(c.query="",l=Be):"#"===a&&(c.fragment="",l=Fe)}else f+=he(a,ce);break;case Pe:"?"===a?(c.query="",l=Be):"#"===a?(c.fragment="",l=Fe):a!==r&&(c.path[0]+=he(a,se));break;case Be:t||"#"!==a?a!==r&&("'"===a&&c.isSpecial()?c.query+="%27":c.query+="#"===a?"%23":he(a,se)):(c.fragment="",l=Fe);break;case Fe:a!==r&&(c.fragment+=he(a,ue))}h++}},parseHost:function(e){var t,n,r;if("["===D(e,0)){if("]"!==D(e,e.length-1))return W;if(t=function(e){var t,n,r,i,a,o,s,u=[0,0,0,0,0,0,0,0],c=0,l=null,h=0,f=function(){return D(e,h)};if(":"===f()){if(":"!==D(e,1))return;h+=2,l=++c}for(;f();){if(8===c)return;if(":"!==f()){for(t=n=0;n<4&&P(ee,f());)t=16*t+R(f(),16),h++,n++;if("."===f()){if(0===n)return;if(h-=n,c>6)return;for(r=0;f();){if(i=null,r>0){if(!("."===f()&&r<4))return;h++}if(!P($,f()))return;for(;P($,f());){if(a=R(f(),10),null===i)i=a;else{if(0===i)return;i=10*i+a}if(i>255)return;h++}u[c]=256*u[c]+i,2!=++r&&4!==r||c++}if(4!==r)return;break}if(":"===f()){if(h++,!f())return}else if(f())return;u[c++]=t}else{if(null!==l)return;h++,l=++c}}if(null!==l)for(o=c-l,c=7;0!==c&&o>0;)s=u[c],u[c--]=u[l+o-1],u[l+--o]=s;else if(8!==c)return;return u}(z(e,1,-1)),!t)return W;this.host=t}else if(this.isSpecial()){if(e=g(e),P(te,e))return W;if(t=function(e){var t,n,r,i,a,o,s,u=V(e,".");if(u.length&&""===u[u.length-1]&&u.length--,(t=u.length)>4)return e;for(n=[],r=0;r<t;r++){if(""===(i=u[r]))return e;if(a=10,i.length>1&&"0"===D(i,0)&&(a=P(Z,i)?16:8,i=z(i,8===a?1:2)),""===i)o=0;else{if(!P(10===a?J:8===a?Q:ee,i))return e;o=R(i,a)}L(n,o)}for(r=0;r<t;r++)if(o=n[r],r===t-1){if(o>=O(256,5-t))return null}else if(o>255)return null;for(s=N(n),r=0;r<n.length;r++)s+=n[r]*O(256,3-r);return s}(e),null===t)return W;this.host=t}else{if(P(ne,e))return W;for(t="",n=d(e),r=0;r<n.length;r++)t+=he(n[r],se);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return m(fe,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"===this.scheme&&1===t&&me(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,r=e.password,i=e.host,a=e.port,o=e.path,s=e.query,u=e.fragment,c=t+":";return null!==i?(c+="//",e.includesCredentials()&&(c+=n+(r?":"+r:"")+"@"),c+=oe(i),null!==a&&(c+=":"+a)):"file"===t&&(c+="//"),c+=e.cannotBeABaseURL?o[0]:o.length?"/"+B(o,"/"):"",null!==s&&(c+="?"+s),null!==u&&(c+="#"+u),c},setHref:function(e){var t=this.parse(e);if(t)throw new E(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"===e)try{return new Le(e.path[0]).origin}catch(e){return"null"}return"file"!==e&&this.isSpecial()?e+"://"+oe(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(b(e)+":",ve)},getUsername:function(){return this.username},setUsername:function(e){var t=d(b(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=he(t[n],le)}},getPassword:function(){return this.password},setPassword:function(e){var t=d(b(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=he(t[n],le)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?oe(e):oe(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,xe)},getHostname:function(){var e=this.host;return null===e?"":oe(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Se)},getPort:function(){var e=this.port;return null===e?"":b(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""===(e=b(e))?this.port=null:this.parse(e,Ce))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+B(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Oe))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""===(e=b(e))?this.query=null:("?"===D(e,0)&&(e=z(e,1)),this.query="",this.parse(e,Be)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!==(e=b(e))?("#"===D(e,0)&&(e=z(e,1)),this.fragment="",this.parse(e,Fe)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Le=function(e){var t=f(this,je),n=_(arguments.length,1)>1?arguments[1]:void 0,r=w(t,new Ne(e,!1,n));a||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())},je=Le.prototype,Ue=function(e,t){return{get:function(){return T(this)[e]()},set:t&&function(e){return T(this)[t](e)},configurable:!0,enumerable:!0}};if(a&&(h(je,"href",Ue("serialize","setHref")),h(je,"origin",Ue("getOrigin")),h(je,"protocol",Ue("getProtocol","setProtocol")),h(je,"username",Ue("getUsername","setUsername")),h(je,"password",Ue("getPassword","setPassword")),h(je,"host",Ue("getHost","setHost")),h(je,"hostname",Ue("getHostname","setHostname")),h(je,"port",Ue("getPort","setPort")),h(je,"pathname",Ue("getPathname","setPathname")),h(je,"search",Ue("getSearch","setSearch")),h(je,"searchParams",Ue("getSearchParams")),h(je,"hash",Ue("getHash","setHash"))),l(je,"toJSON",(function(){return T(this).serialize()}),{enumerable:!0}),l(je,"toString",(function(){return T(this).serialize()}),{enumerable:!0}),C){var Ve=C.createObjectURL,ze=C.revokeObjectURL;Ve&&l(Le,"createObjectURL",u(Ve,C)),ze&&l(Le,"revokeObjectURL",u(ze,C))}A(Le,"URL"),i({global:!0,constructor:!0,forced:!o,sham:!a},{URL:Le})},3296:function(e,t,n){"use strict";n(45806)},27208:function(e,t,n){"use strict";var r=n(46518),i=n(69565);r({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(URL.prototype.toString,this)}})},43145:function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{A:function(){return r}})},10467:function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}n.d(t,{A:function(){return i}})},23029:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{A:function(){return r}})},92901:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(20816);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(0,r.A)(i.key),i)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},64467:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(20816);function i(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},90991:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(53954);function i(){return i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=(0,r.A)(e)););return e}(e,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},i.apply(null,arguments)}},53954:function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{A:function(){return r}})},85501:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(63662);function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,r.A)(e,t)}},50388:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(82284);function i(e,t){if(t&&("object"==(0,r.A)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}},63662:function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{A:function(){return r}})},80296:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(27800);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||(0,r.A)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},45458:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(43145);var i=n(27800);function a(e){return function(e){if(Array.isArray(e))return(0,r.A)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,i.A)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},20816:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(82284);function i(e){var t=function(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=(0,r.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==(0,r.A)(t)?t:t+""}},82284:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:function(){return r}})},27800:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(43145);function i(e,t){if(e){if("string"==typeof e)return(0,r.A)(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.A)(e,t):void 0}}},31635:function(e,t,n){"use strict";n.d(t,{AQ:function(){return h},C6:function(){return i},Ju:function(){return s},N3:function(){return l},YH:function(){return o},fX:function(){return c},sH:function(){return a},xN:function(){return f},zs:function(){return u}});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}Object.create;function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function c(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function l(e){return this instanceof l?(this.v=e,this):new l(e)}function h(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",(function(e){return function(t){return Promise.resolve(t).then(e,c)}})),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))},t&&(r[e]=t(r[e])))}function s(e,t){try{(n=i[e](t)).value instanceof l?Promise.resolve(n.value.v).then(u,c):h(a[0][2],n)}catch(e){h(a[0][3],e)}var n}function u(e){s("next",e)}function c(e){s("throw",e)}function h(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=s(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}Object.create;"function"==typeof SuppressedError&&SuppressedError}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var r={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&t&&e;"object"==typeof i&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((function(t){r[t]=function(){return e[t]}}));return r.default=function(){return e},__webpack_require__.d(n,r),n},__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.f={},__webpack_require__.e=function(e){return Promise.all(Object.keys(__webpack_require__.f).reduce((function(t,n){return __webpack_require__.f[n](e,t),t}),[]))},__webpack_require__.u=function(e){return{131:"vendor.babylonjs-gui",317:"vendor.babylonjs",392:"vendor.babylonjs-materials",547:"vendor.cannon-es",836:"vendor.swiperjs"}[e]+".js"},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},inProgress={},dataWebpackPrefix="@expivi/interface:",__webpack_require__.l=function(e,t,n,r){if(inProgress[e])inProgress[e].push(t);else{var i,a;if(void 0!==n)for(var o=document.getElementsByTagName("script"),s=0;s<o.length;s++){var u=o[s];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==dataWebpackPrefix+n){i=u;break}}i||(a=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,__webpack_require__.nc&&i.setAttribute("nonce",__webpack_require__.nc),i.setAttribute("data-webpack",dataWebpackPrefix+n),i.src=e),inProgress[e]=[t];var c=function(t,n){i.onerror=i.onload=null,clearTimeout(l);var r=inProgress[e];if(delete inProgress[e],i.parentNode&&i.parentNode.removeChild(i),r&&r.forEach((function(e){return e(n)})),t)return t(n)},l=setTimeout(c.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=c.bind(null,i.onerror),i.onload=c.bind(null,i.onload),a&&document.head.appendChild(i)}},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e}(),function(){var e={57:0};__webpack_require__.f.j=function(t,n){var r=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise((function(n,i){r=e[t]=[n,i]}));n.push(r[2]=i);var a=__webpack_require__.p+__webpack_require__.u(t),o=new Error;__webpack_require__.l(a,(function(n){if(__webpack_require__.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;o.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",o.name="ChunkLoadError",o.type=i,o.request=a,r[1](o)}}),"chunk-"+t,t)}};var t=function(t,n){var r,i,a=n[0],o=n[1],s=n[2],u=0;if(a.some((function(t){return 0!==e[t]}))){for(r in o)__webpack_require__.o(o,r)&&(__webpack_require__.m[r]=o[r]);if(s)s(__webpack_require__)}for(t&&t(n);u<a.length;u++)i=a[u],__webpack_require__.o(e,i)&&e[i]&&e[i][0](),e[i]=0},n=self.webpackChunk_expivi_interface=self.webpackChunk_expivi_interface||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var __webpack_exports__={};!function(){"use strict";var e,t,n=__webpack_require__(10467),r=__webpack_require__(54756),i=__webpack_require__.n(r),a=(__webpack_require__(69085),__webpack_require__(26099),__webpack_require__(3362),__webpack_require__(27495),__webpack_require__(90906),__webpack_require__(45458)),o=__webpack_require__(80296),s=__webpack_require__(23029),u=__webpack_require__(92901),c=__webpack_require__(64467),l=(__webpack_require__(16280),__webpack_require__(28706),__webpack_require__(2008),__webpack_require__(50113),__webpack_require__(48980),__webpack_require__(52675),__webpack_require__(23792),__webpack_require__(62062),__webpack_require__(44114),__webpack_require__(34782),__webpack_require__(54554),__webpack_require__(33110),__webpack_require__(36033),__webpack_require__(2892),__webpack_require__(79432),__webpack_require__(83851),__webpack_require__(81278),__webpack_require__(47764),__webpack_require__(33811),__webpack_require__(74648),__webpack_require__(17333),__webpack_require__(3064),__webpack_require__(9920),__webpack_require__(41393),__webpack_require__(14905),__webpack_require__(86994),__webpack_require__(98992),__webpack_require__(23215),__webpack_require__(54520),__webpack_require__(72577),__webpack_require__(3949),__webpack_require__(81454),__webpack_require__(8872),__webpack_require__(41795),__webpack_require__(58335),__webpack_require__(71517),__webpack_require__(11379),__webpack_require__(93777),__webpack_require__(14190),__webpack_require__(12359),__webpack_require__(86097),__webpack_require__(17273),__webpack_require__(27415),__webpack_require__(19929),__webpack_require__(37583),__webpack_require__(55122),__webpack_require__(20230),__webpack_require__(57268),__webpack_require__(79733),__webpack_require__(23500),__webpack_require__(62953),__webpack_require__(32221)),h=__webpack_require__(74461),f=__webpack_require__(49571),m=__webpack_require__(18910),p=(__webpack_require__(25440),function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),null,[{key:"selectDom",value:function(e){return"string"==typeof e?(e=e.replace(/^\s*/,"").replace(/\s*$/,""),document.querySelector(e)):e&&e.nodeName?e:e&&e.length>0?e[0]:e}},{key:"createElement",value:function(e){return document.createElement(e)}},{key:"setStyle",value:function(e,t,n){if(e)return"string"==typeof t&&void 0!==n?e.style[t]=n:Object.keys(t).forEach((function(n){e.style[n]=t[n]})),e}},{key:"getStyle",value:function(e,t){return e.style[t]}},{key:"setAttribute",value:function(e,t,n){return e.setAttribute(t,n),e}},{key:"setHtml",value:function(e,t){return e.innerHTML=t||"",e}},{key:"emptyHtml",value:function(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}},{key:"append",value:function(e,t){return e.appendChild(t),t}},{key:"on",value:function(e,t,n){var r=function(e){return n.apply(this,[e].concat(e.detail||[]))};e.addEventListener(t,r),e._e=e._e||{},e._e[t]=e._e[t]||[],e._e[t].push(r)}},{key:"off",value:function(e,t){e._e=e._e||{},(e._e[t]?e._e[t]:[]).forEach((function(n){e.removeEventListener(t,n)})),e._e[t]=[]}}])}()),d=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"save",value:(t=(0,n.A)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){t("Version 1.0 is obsolete.")})));case 3:case"end":return e.stop()}}),e)}))),function(e,n){return t.apply(this,arguments)})},{key:"load",value:(e=(0,n.A)(i().mark((function e(t,n,r){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){if(!n)return t("undefined configurations");t("Version 1.0 is obsolete")})));case 1:case"end":return e.stop()}}),e)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"sanitizeConfiguration",value:function(e){}}]);var e,t}(),v=(__webpack_require__(40150),__webpack_require__(31415),__webpack_require__(55815),__webpack_require__(64979),__webpack_require__(79739),__webpack_require__(71678),__webpack_require__(63805)),y=__webpack_require__(72985);(t=e||(e={})).REPLICA="REPLICA",t.ORIGINAL="ORIGINAL";var g=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"save",value:(r=(0,n.A)(i().mark((function e(t,n){var r,a,o,s,u,c,l,h,f=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=f.length>2&&void 0!==f[2]?f[2]:null,a=f.length>3?f[3]:void 0,o=t.getComponent("materialGroupManager"),e.next=5,(0,y._)(o.resolveMaterialGroups());case 5:return s=e.sent,u={},s.getGroups().forEach((function(e){var t=s.getActiveRefId(e.id);Number.isNaN(t)||(u[e.id]=t)})),c=t.getComponent("attributeManager"),e.next=11,(0,y._)(c.resolveAttributeManager());case 11:return l=e.sent,h=!!a&&a.include_keys,e.abrupt("return",{version:"2.0",catalogue_id:t.productId,catalogue_sku:t.productSku,configuration:{attributes:l.serialize({discard_hidden:!1,include_keys:h,calculate_approximations:!0}),materials:u},attributes:l.serialize({discard_hidden:!0,include_keys:h,calculate_approximations:!1}),thumbnail:r,articles:n});case 14:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})},{key:"load",value:(t=(0,n.A)(i().mark((function e(t,n,r){var a,o,s,u,c=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("undefined configurations");case 2:return v.UX.print("Previous configuration:",n),a=t.getComponent("attributeManager"),e.next=6,(0,y._)(a.resolveAttributeManager());case 6:return o=e.sent,s=n.configuration.attributes,u=(u=s.length)<=0?1:u,e.abrupt("return",new Promise((function(e){c._setActiveOptions(o,s,(function(){e(!0)}),(function(e){if("function"==typeof r){var t=s.length/u;r(e*t)}}))})));case 11:case"end":return e.stop()}}),e)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"sanitizeConfiguration",value:function(e){e.configured_products=e.configured_products.filter((function(e){return!!e.version})),e.bundle_uuid||(e.bundle_uuid=f.V.guid(),e.configured_products.forEach((function(t){t.bundle_uuid=e.bundle_uuid}))),e.configured_products.forEach((function(e){e.uuid||(e.uuid=f.V.uuidV4())})),e.configured_products=this.convertReplicaToOriginalConfiguration(e.configured_products)}},{key:"convertReplicaToOriginalConfiguration",value:function(t){return t.filter((function(n){var r,i,a,o;if(n.replication_type!==e.REPLICA)return!0;var s=t.find((function(t){return t.replication_type===e.ORIGINAL&&t.catalogue_id===n.catalogue_id&&n.original_uuid===t.uuid}));return!!s&&(n.attributes=structuredClone(null!==(r=s.attributes)&&void 0!==r?r:[]),n.articles=structuredClone(null!==(i=s.articles)&&void 0!==i?i:[]),n.price=structuredClone(null!==(a=s.price)&&void 0!==a?a:{base:0}),n.configuration=structuredClone(null!==(o=s.configuration)&&void 0!==o?o:{attributes:[],materials:{}}),Array.isArray(n.configuration.attributes)||(n.configuration.attributes=[]),n.configuration.materials||(n.configuration.materials={}),n.replication_type=e.ORIGINAL,!0)}))}},{key:"_setActiveOptions",value:function(e,t,n,r){var i=this,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;arguments.length>5&&void 0!==arguments[5]||Date.now();if(a>=t.length)return n();try{var o=t[a],s=e.getAttributeController(o.attribute_id);s&&!o.excluded_autoload&&s.parse(o.attribute_value,{emitEvent:!0,rebuild:a===t.length-1})}catch(e){v.UX.warn(e)}"function"==typeof r&&r((a+1)/t.length);var u=Date.now();window.setTimeout((function(){i._setActiveOptions(e,t,n,r,a+1,u)}),0)}}]);var t,r}();function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var A=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mOptions",void 0),this.mOptions=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({include_keys:!1},t)}),[{key:"save",value:(t=(0,n.A)(i().mark((function e(t,n,r,a){var o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=a,e.next="1.0"===e.t0?3:"2.0"===e.t0?5:7;break;case 3:return o=new d,e.abrupt("break",10);case 5:return o=new g,e.abrupt("break",10);case 7:return v.UX.print("Saving configuration with unknown version ".concat(a,".")),o=new g,e.abrupt("break",10);case 10:return e.abrupt("return",o.save(t,n,r,this.mOptions));case 11:case"end":return e.stop()}}),e,this)}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"load",value:(e=(0,n.A)(i().mark((function e(t,n,r){var a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return",new Promise((function(e,t){return t("undefined configurations")})));case 2:e.t0=n.version,e.next="1.0"===e.t0?5:"2.0"===e.t0?7:9;break;case 5:return a=new d,e.abrupt("break",11);case 7:return a=new g,e.abrupt("break",11);case 9:v.UX.warn("Loading configuration with unknown version: ".concat(n.version)),a=new g;case 11:return e.abrupt("return",a.load(t,n,r));case 12:case"end":return e.stop()}}),e)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"sanitizeConfiguration",value:function(e){var t,n=e.configured_products[0].version;switch(n){case"1.0":t=new d;break;case"2.0":t=new g;break;default:v.UX.warn("Loading configuration with unknown version: ".concat(n)),t=new g}return t.sanitizeConfiguration(e)}}]);var e,t}(),_=__webpack_require__(69780),M=__webpack_require__(27291),k=__webpack_require__(59099),w=__webpack_require__(16126),T=__webpack_require__(47903),x=__webpack_require__(92908),S=__webpack_require__(64878);function C(e,t){return void 0===t&&(t=T.E),(0,x.N)((function(n,r){var i=null,a=null,o=null,s=function(){if(i){i.unsubscribe(),i=null;var e=a;a=null,r.next(e)}};function u(){var n=o+e,a=t.now();if(a<n)return i=this.schedule(void 0,n-a),void r.add(i);s()}n.subscribe((0,S._)(r,(function(n){a=n,o=t.now(),i||(i=t.schedule(u,e),r.add(i))}),(function(){s(),r.complete()}),void 0,(function(){a=i=null})))}))}var E=__webpack_require__(38975),R=__webpack_require__(41840),I=(__webpack_require__(48598),__webpack_require__(73097)),O=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mGlobalStateCollection",new I.m),(0,c.A)(this,"mSceneStateCollection",new I.m),(0,c.A)(this,"mDrawables",[]),(0,c.A)(this,"mCameras",[]),(0,c.A)(this,"mLights",[])}),[{key:"checksum",get:function(){var e=this.mDrawables.map((function(e){return e.getObjectUUID()})).join(),t=this.mCameras.map((function(e){return e.getObjectUUID()})).join(),n=this.mLights.map((function(e){return e.getObjectUUID()})).join();return f.V.checksum(e+t+n)}},{key:"pushGlobalState",value:function(e){this.mGlobalStateCollection.push(e)}},{key:"popGlobalState",value:function(e){return this.mGlobalStateCollection.pop(e)}},{key:"getCurrentGlobalStates",value:function(){return this.mGlobalStateCollection.currentStates()}},{key:"_getGlobalStateCollection",value:function(){return this.mGlobalStateCollection}},{key:"pushSceneState",value:function(e){this.mSceneStateCollection.push(e)}},{key:"popSceneState",value:function(e){return this.mSceneStateCollection.pop(e)}},{key:"getCurrentSceneStates",value:function(){return this.mSceneStateCollection.currentStates()}},{key:"_getSceneStateCollection",value:function(){return this.mSceneStateCollection}},{key:"addLight",value:function(e){this.mLights.push(e)}},{key:"removeLight",value:function(e){this.removeObjectFromCollection(e,this.mLights)}},{key:"addCamera",value:function(e){this.mCameras.push(e)}},{key:"removeCamera",value:function(e){this.removeObjectFromCollection(e,this.mCameras)}},{key:"getCameras",value:function(){return this.mCameras}},{key:"getLights",value:function(){return this.mLights}},{key:"addDrawable",value:function(e){this.mDrawables.push(e)}},{key:"removeDrawable",value:function(e){this.removeObjectFromCollection(e,this.mDrawables)}},{key:"getDrawables",value:function(){return this.mDrawables}},{key:"drawablesNeedRenderUpdate",value:function(){return this.entitiesNeedRenderUpdate(this.getDrawables())}},{key:"lightsNeedRenderUpdate",value:function(){return this.entitiesNeedRenderUpdate(this.getLights())}},{key:"entitiesNeedRenderUpdate",value:function(e){return!e.every((function(e){return!e.needsRenderUpdate()}))}},{key:"removeObjectFromCollection",value:function(e,t){var n=t.findIndex((function(t){return t.getObjectUUID()===e.getObjectUUID()}));n<0||t.splice(n,1)}}])}(),D=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mRenderEngine",void 0),this.mRenderEngine=t}),[{key:"registerRenderTechnique",value:function(e,t){this.mRenderEngine.registerRenderTechnique(e,t)}},{key:"render",value:function(e){var t=new O;R.K.sceneManager()._draw(t,e),this.mRenderEngine.render(t,e),R.K.sceneManager()._afterDraw(t,e)}},{key:"getRenderEngine",value:function(){return this.mRenderEngine}},{key:"dispose",value:function(){this.mRenderEngine.dispose()}}])}(),P=__webpack_require__(40537),B=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mUndos",void 0),(0,c.A)(this,"mRedos",void 0),(0,c.A)(this,"mLastCommandTime",void 0),(0,c.A)(this,"mStackDisabled",!1),(0,c.A)(this,"mCommandIdCount",0),(0,c.A)(this,"onHistoryChanged",new M.B),this.mUndos=new Array,this.mRedos=new Array,this.mLastCommandTime=new Date}),[{key:"disableStack",value:function(){this.mStackDisabled=!0}},{key:"enableStack",value:function(){this.mStackDisabled=!1}},{key:"isEnabled",value:function(){return!1===this.mStackDisabled}},{key:"undoSize",value:function(){return this.mUndos.length}},{key:"redoSize",value:function(){return this.mRedos.length}},{key:"execute",value:function(e,t){var n=e,r=this.mUndos.length>0?this.mUndos[this.mUndos.length-1]:null,i=(new Date).getTime()-this.mLastCommandTime.getTime();r&&r.isUpdatable()&&r.overridesCommand(n)&&i<500?(r.update(n),n=r):(this.mUndos.push(n),n._setCommandId(++this.mCommandIdCount)),n.setCommandName((0,P.isNullOrUndefined)(t)?n.getCommandName():t),n.execute(),this.mLastCommandTime=new Date,this.mRedos.splice(0,this.mRedos.length),this.onHistoryChanged.next(n)}},{key:"undo",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.mStackDisabled){var t=this.mUndos.pop();return(0,P.isUndefined)(t)||(t.undo(),this.mRedos.push(t),e&&this.onHistoryChanged.next(t)),t}v.UX.print("exec stack disabled")}},{key:"redo",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.mStackDisabled){var t=this.mRedos.pop();return(0,P.isUndefined)(t)||(t.execute(),this.mUndos.push(t),e&&this.onHistoryChanged.next(t)),t}v.UX.print("exec stack disabled")}},{key:"clear",value:function(){this.mUndos.splice(0,this.mUndos.length),this.mRedos.splice(0,this.mRedos.length),this.mCommandIdCount=0,this.onHistoryChanged.unsubscribe()}},{key:"goToState",value:function(e){if(this.mStackDisabled)v.UX.print("exec stack disabled");else{var t=this.mUndos.length>0?this.mUndos[this.mUndos.length-1]:null;if(!t||e>t.getCommandId())for(t=this.redo(!1);t&&e>t.getCommandId();)t=this.redo(!1);else for(;t=this.mUndos[this.mUndos.length-1],!(0,P.isUndefined)(t)&&e!==t.getCommandId();)t=this.undo(!1);this.onHistoryChanged.next(t)}}}])}(),F=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mExecStack",void 0),this.mExecStack=new B}),[{key:"execute",value:function(e,t){this.mExecStack.execute(e,t)}},{key:"undo",value:function(){return this.mExecStack.undo()}},{key:"redo",value:function(){return this.mExecStack.redo()}},{key:"dispose",value:function(){this.mExecStack.clear()}},{key:"getExecStack",value:function(){return this.mExecStack}}])}(),N=__webpack_require__(28919),L=__webpack_require__(39741),j=__webpack_require__(99335),U=function(){function e(){(0,s.A)(this,e),(0,c.A)(this,"mMetaSerializer",{}),(0,c.A)(this,"mSettings",{})}return(0,u.A)(e,[{key:"resolveCatalogueSettings",value:function(e,t){var n=this;return this.mSettings[e]||(this.mSettings[e]=new L.m(1),this.mMetaSerializer[e]=new N.hj(Number(e),t),this.mMetaSerializer[e].loadAndObserve().subscribe({next:function(t){n.mSettings[e].next(new N.nQ(t)),n.mSettings[e].complete()},error:function(t){n.mSettings[e].next(new N.nQ),n.mSettings[e].error(t)}})),this.mSettings[e].pipe((0,j.$)())}},{key:"disposeCatalogue",value:function(e){e&&(this.mMetaSerializer[e]&&(this.mMetaSerializer[e].dispose(),delete this.mMetaSerializer[e]),this.mSettings[e]&&(this.mSettings[e].unsubscribe(),delete this.mSettings[e]))}},{key:"dispose",value:function(){var e=this;Object.keys(this.mMetaSerializer).forEach((function(t){e.disposeCatalogue(t)})),this.mMetaSerializer={},this.mSettings={}}}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}])}();(0,c.A)(U,"sInstance",void 0);var V,z,H=__webpack_require__(58794);(z=V||(V={})).Threejs="threejs",z.Babylonjs="babylonjs";var G,q,W=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mSettings",new N.nQ)}),[{key:"init",value:(e=(0,n.A)(i().mark((function e(t,n){var r=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){if("number"!=typeof t&&!(0,h.kf)(t))return r.mSettings.withSceneSettings(t),e(!0);U.getInstance().resolveCatalogueSettings(Number(t),n).subscribe({next:function(t){r.mSettings.withCatalogueSettings(t),e(!0)},error:function(){i("Could not download settings from catalogue id: ".concat(t))}})})));case 1:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)})},{key:"dispose",value:function(){this.mSettings.dispose()}},{key:"getSettings",value:function(){return this.mSettings}},{key:"getDeviceSceneSettings",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,H.Fr)();return this.mSettings.getSceneDeviceSettings(e?N.RB.Mobile:N.RB.Desktop)}},{key:"getSceneSettingsRendererType",value:function(){return this.mSettings.getSceneSettings().renderer_type||V.Threejs}}]);var e}(),K=__webpack_require__(94273),X=__webpack_require__(39136);(q=G||(G={})).ACTIVE_CAMERA="ACTIVE_CAMERA",q.FIRST_POSITION="FIRST_POSITION",q.FIT_OBJECT_FRONT="FIT_OBJECT_FRONT",q.FIT_OBJECT_BACK="FIT_OBJECT_BACK",q.FIT_OBJECT_LEFT="FIT_OBJECT_LEFT",q.FIT_OBJECT_RIGHT="FIT_OBJECT_RIGHT",q.FIT_OBJECT_TOP="FIT_OBJECT_TOP",q.FIT_OBJECT_BOTTOM="FIT_OBJECT_BOTTOM",q.CUSTOM_CAMERA_POSITION="CUSTOM_CAMERA_POSITION";var Y,Z,Q=__webpack_require__(33153),J=__webpack_require__(67138);(Z=Y||(Y={})).REFERENCE_PRODUCT="reference",Z.ROOT_PRODUCT="root",Z.SUB_PRODUCT="sub";var ee=__webpack_require__(68263),te=__webpack_require__(47928),ne=__webpack_require__(37842),re=__webpack_require__(209),ie=__webpack_require__(94695),ae=(__webpack_require__(89463),__webpack_require__(2259),__webpack_require__(23418),__webpack_require__(62010),__webpack_require__(60825),__webpack_require__(38781),__webpack_require__(50388)),oe=__webpack_require__(53954),se=__webpack_require__(90991),ue=__webpack_require__(85501),ce=__webpack_require__(14393),le=__webpack_require__(44889),he=__webpack_require__(43423);function fe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fe=function(){return!!e})()}var me,pe,de=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,fe()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mNeedsRenderUpdate",!1),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"isAttachable",value:function(e){return e.isDerivedOfTypeName("CameraEntity")}},{key:"setValue",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.proxySetValue(e,t,n);return r&&this.markNeedsRenderUpdate(),r}},{key:"getValue",value:function(e){return this.proxyGetValue(e)}},{key:"proxySetValue",value:function(e,t){return"object_uuid"===e&&(this._setObjectUUID(t),!0)}},{key:"proxyGetValue",value:function(e){switch(e){case"camera-controls-name":return this.getComponentName();case"object_cid":return this.getObjectId();case"object_uuid":return this.getObjectUUID();default:return null}}},{key:"needsRenderUpdate",value:function(){return this.mNeedsRenderUpdate}},{key:"setNeedsRenderUpdate",value:function(e){this.mNeedsRenderUpdate=e,e||this.resetRenderFlags();var t=this.getParentObject();t&&e&&t.markNeedsRenderUpdate()}},{key:"markNeedsRenderUpdate",value:function(){this.setNeedsRenderUpdate(!0)}}])}(he.$);(0,c.A)(de,"TypeRTTI",new le.O("CameraControlsComponent",he.$.TypeRTTI)),(pe=me||(me={})).NONE="none",pe.FRONT="front",pe.LEFT="left",pe.RIGHT="right",pe.TOP="top",pe.BOTTOM="bottom",pe.BACK="back";var ve,ye,ge,be,Ae=__webpack_require__(31167);function _e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_e=function(){return!!e})()}(ye=ve||(ve={}))[ye.Unchanged=0]="Unchanged",ye[ye.Started=1]="Started",ye[ye.Changed=2]="Changed",ye[ye.Ended=3]="Ended",(be=ge||(ge={}))[be.Pan=0]="Pan",be[be.Rotate=1]="Rotate";var Me=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[t.mType],a=(0,oe.A)(a),r=(0,ae.A)(i,_e()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mEventType",void 0),(0,c.A)(r,"mState",ve.Unchanged),r.mEventType=e,r.mState=n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"type",get:function(){return this.mEventType}},{key:"state",get:function(){return this.mState}}],[{key:"getTopicName",value:function(){return t.mType}}])}(Ae.J);function ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ke=function(){return!!e})()}(0,c.A)(Me,"mType","CameraControlsChangedEvent");var we,Te,xe,Se,Ce=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[t.mType],i=(0,oe.A)(i),n=(0,ae.A)(r,ke()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mState",ve.Unchanged),n.mState=e,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"state",get:function(){return this.mState}}],[{key:"getTopicName",value:function(){return t.mType}}])}(Ae.J);function Ee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ee=function(){return!!e})()}function Re(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Ce,"mType","CameraControlsZoomEvent"),(Te=we||(we={}))[Te.OrbitControls=0]="OrbitControls",Te[Te.FPSControls=1]="FPSControls",Te[Te.TurnTableControls=2]="TurnTableControls",(Se=xe||(xe={})).OrbitControls="orbit_controls",Se.FPSControls="fps_controls",Se.TurntableControls="turntable_controls";var Ie=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["orbit-camera-controls"],r=(0,oe.A)(r),e=(0,ae.A)(n,Ee()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"mBrokerSubscriptions",[]),(0,c.A)(e,"mCamAnimate",void 0),(0,c.A)(e,"mTransformControlChanged",void 0),(0,c.A)(e,"mControlChange",void 0),(0,c.A)(e,"mEnabled",!0),(0,c.A)(e,"mTarget",void 0),(0,c.A)(e,"mInitialTarget",void 0),(0,c.A)(e,"mPanEnabled",!0),(0,c.A)(e,"mPanSpeed",1),(0,c.A)(e,"mRotateEnabled",!0),(0,c.A)(e,"mRotationSpeed",1),(0,c.A)(e,"mZoomEnabled",!0),(0,c.A)(e,"mMaxZoom",1/0),(0,c.A)(e,"mMinZoom",0),(0,c.A)(e,"mZoomSpeed",1),(0,c.A)(e,"mLockUpHemisphere",!1),(0,c.A)(e,"mDampingEnabled",!0),(0,c.A)(e,"mDampFactor",.1),(0,c.A)(e,"mAutoRotateEnabled",!1),(0,c.A)(e,"mAutoRotateSpeed",2),(0,c.A)(e,"mMinAzimuthAngle",-1/0),(0,c.A)(e,"mMaxAzimuthAngle",1/0),(0,c.A)(e,"mMinPolarAngle",0),(0,c.A)(e,"mMaxPolarAngle",Math.PI),(0,c.A)(e,"mKeysEnabled",!0),(0,c.A)(e,"needsSaveState",!1),(0,c.A)(e,"needsResetState",!1),(0,c.A)(e,"needsMouseResetState",!1),e.mCamAnimate=new M.B,e.mTransformControlChanged=new M.B,e.mControlChange=new M.B,e.mTarget=new te.P,e.mInitialTarget=new te.P,e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getControlsType",value:function(){return xe.OrbitControls}},{key:"OnAttached",value:function(){var e=this;this.registerMessageHandler(m.xt.TypeRTTI,(function(t){t.reset&&e.resetState(),t.save&&e.saveState()})),this.registerMessageHandler(m.qX.TypeRTTI,(function(t){t.isTransformLocked||t.isTransformChanged?(e.mEnabled=!1,e.resetMouseState()):e.mEnabled=!0,t.isTransformLocked&&e.mControlChange.next(),e.mEnabled||e.mTransformControlChanged.next(),e.markNeedsRenderUpdate()})),this.mBrokerSubscriptions.push(R.K.eventBus().subscribe(Me.getTopicName(),(function(){e.dispatchMessage(new m.TF)})),R.K.eventBus().subscribe(Ce.getTopicName(),(function(){e.dispatchMessage(new m.G_)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.TransformControlChanged),(function(){e.mTransformControlChanged.next()})),R.K.messenger().listen(m.EI.TypeRTTI,(function(){e.mCamAnimate.next()}))),this.mSubscriptions.push(this.mCamAnimate.pipe((0,k.M)((function(){e.mEnabled=!1,e.markNeedsRenderUpdate()})),C(100)).subscribe((function(){e.mEnabled=!0,e.resetState()})),this.mTransformControlChanged.pipe((0,k.M)((function(){e.mEnabled=!1,e.resetMouseState(),e.mControlChange.next()})),C(100)).subscribe((function(){e.mEnabled=!0,e.markNeedsRenderUpdate()})),this.mControlChange.pipe((0,k.M)((function(){R.K.renderer().getRenderEngine().getUiRenderer().disableEvents()})),C(300)).subscribe((function(){R.K.renderer().getRenderEngine().getUiRenderer().enableEvents()})))}},{key:"OnDetached",value:function(){this.unregisterFromAllMessages(),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"isControllerSupported",value:function(e){return e===we.OrbitControls}},{key:"proxyGetValue",value:function(e){if((0,h.QE)(e)&&(0,h.XD)(e)===this.getControlsType()){switch((0,h.HP)(e)){case"enabled":return this.mEnabled;case"target":return this.mTarget;case"initial_target":return this.mInitialTarget;case"pan_enabled":return this.mPanEnabled;case"pan_speed":return this.mPanSpeed;case"rotate_enabled":return this.mRotateEnabled;case"rotation_speed":return this.mRotationSpeed;case"zoom_enabled":return this.mZoomEnabled;case"min_zoom":return this.mMinZoom;case"max_zoom":return this.mMaxZoom;case"zoom_speed":return this.mZoomSpeed;case"lock_up_hemisphere":return this.mLockUpHemisphere;case"min_azimuth_angle":return this.mMinAzimuthAngle;case"max_azimuth_angle":return this.mMaxAzimuthAngle;case"min_polar_angle":return this.mMinPolarAngle;case"max_polar_angle":return this.mMaxPolarAngle;case"damping_enabled":return this.mDampingEnabled;case"damp_factor":return this.mDampFactor;case"auto_rotate":case"auto_rotate_enabled":return this.mAutoRotateEnabled;case"auto_rotate_speed":return this.mAutoRotateSpeed;case"keys_enabled":return this.mKeysEnabled;case"save_state":return this.needsSaveState;case"reset_state":return this.needsResetState;case"reset_state_mouse":return this.needsMouseResetState}return Re(t,"proxyGetValue",this,3)([e])}switch(e){case"enabled":return this.mEnabled;case"target":return this.mTarget;case"initial_target":return this.mInitialTarget;case"pan_disabled":return!this.mPanEnabled;case"min_zoom":return this.mMinZoom;case"max_zoom":return this.mMaxZoom;case"zoom_speed":return this.mZoomSpeed;case"lockup_hemisphere":return this.mLockUpHemisphere;case"min_azimuth_angle":return this.mMinAzimuthAngle;case"max_azimuth_angle":return this.mMaxAzimuthAngle;case"min_polar_angle":return this.mMinPolarAngle;case"max_polar_angle":return this.mMaxPolarAngle;case"save_state":return this.needsSaveState;case"reset_state":return this.needsResetState;case"reset_state_mouse":return this.needsMouseResetState}return Re(t,"proxyGetValue",this,3)([e])}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((0,h.QE)(e)&&(0,h.XD)(e)===this.getControlsType()){switch((0,h.HP)(e)){case"enabled":return this.mEnabled=!!n,!0;case"target":return Array.isArray(n)&&n.length>2?this.mTarget.fromArray(n):(n&&n instanceof te.P||n&&n.isVector3)&&this.mTarget.copy(n),r&&this.mInitialTarget.copy(this.mTarget),!0;case"target_x":return(0,h.kf)(n)&&(this.mTarget.x=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"target_y":return(0,h.kf)(n)&&(this.mTarget.y=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"target_z":return(0,h.kf)(n)&&(this.mTarget.z=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"pan_enabled":return this.mPanEnabled=!!n,!0;case"pan_speed":return(0,h.kf)(n)&&(this.mPanSpeed=parseFloat(n)),!0;case"rotate_enabled":case"rotation_enabled":return this.mRotateEnabled=!!n,!0;case"rotate_speed":case"rotation_speed":return(0,h.kf)(n)&&(this.mRotationSpeed=parseFloat(n)),!0;case"zoom_enabled":return this.mZoomEnabled=!!n,!0;case"min_zoom":return(0,h.kf)(n)&&(this.mMinZoom=Math.max(parseFloat(n),0)),!0;case"max_zoom":return null===n?this.mMaxZoom=1/0:(0,h.kf)(n)&&(this.mMaxZoom=parseFloat(n)),!0;case"zoom_speed":return(0,h.kf)(n)&&(this.mZoomSpeed=parseFloat(n)),!0;case"lock_up_hemisphere":return this.mLockUpHemisphere=!!n,!0;case"min_azimuth_angle":return null===n?this.mMinAzimuthAngle=-1/0:(0,h.kf)(n)&&(this.mMinAzimuthAngle=parseFloat(n)),!0;case"max_azimuth_angle":return null===n?this.mMaxAzimuthAngle=1/0:(0,h.kf)(n)&&(this.mMaxAzimuthAngle=parseFloat(n)),!0;case"min_polar_angle":return(0,h.kf)(n)&&(this.mMinPolarAngle=(0,_.qE)(parseFloat(n),0,Math.PI)),!0;case"max_polar_angle":return(0,h.kf)(n)&&(this.mMaxPolarAngle=(0,_.qE)(parseFloat(n),0,Math.PI)),!0;case"damping_enabled":return this.mDampingEnabled=!!n,!0;case"damp_factor":return(0,h.kf)(n)&&(this.mDampFactor=parseFloat(n)),!0;case"auto_rotate":case"auto_rotate_enabled":return this.mAutoRotateEnabled=!!n,!0;case"auto_rotate_speed":return(0,h.kf)(n)&&(this.mAutoRotateSpeed=parseFloat(n)),!0;case"keys_enabled":return this.mKeysEnabled=!!n,!0}return Re(t,"proxyGetValue",this,3)([e])}switch(e){case"enabled":return this.mEnabled=!!n,!0;case"target":return Array.isArray(n)&&n.length>2?this.mTarget.fromArray(n):(n&&n instanceof te.P||n&&n.isVector3)&&this.mTarget.copy(n),r&&this.mInitialTarget.copy(this.mTarget),!0;case"cam_target_x":case"target_x":return(0,h.kf)(n)&&(this.mTarget.x=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"cam_target_y":case"target_y":return(0,h.kf)(n)&&(this.mTarget.y=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"cam_target_z":case"target_z":return(0,h.kf)(n)&&(this.mTarget.z=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"pan_disabled":return this.mPanEnabled=!n,!0;case"min_zoom":return(0,h.kf)(n)&&(this.mMinZoom=Math.max(parseFloat(n),0)),!0;case"max_zoom":return null===n?this.mMaxZoom=1/0:(0,h.kf)(n)&&(this.mMaxZoom=parseFloat(n)),!0;case"zoom_speed":return(0,h.kf)(n)&&(this.mZoomSpeed=parseFloat(n)),!0;case"lockup_hemisphere":return this.mLockUpHemisphere=!!n,!0;case"min_azimuth_angle":return null===n?this.mMinAzimuthAngle=-1/0:(0,h.kf)(n)&&(this.mMinAzimuthAngle=parseFloat(n)),!0;case"max_azimuth_angle":return null===n?this.mMaxAzimuthAngle=1/0:(0,h.kf)(n)&&(this.mMaxAzimuthAngle=parseFloat(n)),!0;case"min_polar_angle":return(0,h.kf)(n)&&(this.mMinPolarAngle=(0,_.qE)(parseFloat(n),0,Math.PI)),!0;case"max_polar_angle":return(0,h.kf)(n)&&(this.mMaxPolarAngle=(0,_.qE)(parseFloat(n),0,Math.PI)),!0}return Re(t,"proxySetValue",this,3)([e,n,r])}},{key:"parse",value:function(e,t,n){var r=this;e&&this.getControlsType()in e&&Object.keys(e[this.getControlsType()]).forEach((function(t){r.setValue("".concat(r.getControlsType(),".").concat(t),e[r.getControlsType()][t],!0)}))}},{key:"serialize",value:function(e,t){return{enabled:this.mEnabled,pan_enabled:this.mPanEnabled,pan_speed:this.mPanSpeed,rotate_enabled:this.mRotateEnabled,rotation_speed:this.mRotationSpeed,zoom_enabled:this.mZoomEnabled,zoom_speed:this.mZoomSpeed,min_zoom:this.mMinZoom,max_zoom:isFinite(this.mMaxZoom)&&null!==this.mMaxZoom?this.mMaxZoom:null,lock_up_hemisphere:this.mLockUpHemisphere,damping_enabled:this.mDampingEnabled,damp_factor:this.mDampFactor,auto_rotate_enabled:this.mAutoRotateEnabled,auto_rotate_speed:this.mAutoRotateSpeed,min_azimuth_angle:isFinite(this.mMinAzimuthAngle)&&null!==this.mMinAzimuthAngle?this.mMinAzimuthAngle:null,max_azimuth_angle:isFinite(this.mMaxAzimuthAngle)&&null!==this.mMaxAzimuthAngle?this.mMaxAzimuthAngle:null,min_polar_angle:this.mMinPolarAngle,max_polar_angle:this.mMaxPolarAngle,keys_enabled:this.mKeysEnabled,target:this.mTarget.toArray()}}},{key:"saveState",value:function(){this.needsSaveState=!0,this.markNeedsRenderUpdate()}},{key:"resetState",value:function(){this.needsResetState=!0,this.markNeedsRenderUpdate()}},{key:"resetMouseState",value:function(){this.needsMouseResetState=!0,this.markNeedsRenderUpdate()}},{key:"resetRenderFlags",value:function(){this.needsSaveState=!1,this.needsResetState=!1,this.needsMouseResetState=!1}},{key:"enabled",get:function(){return this.mEnabled},set:function(e){this.mEnabled=e,this.markNeedsRenderUpdate()}},{key:"panEnabled",get:function(){return this.mPanEnabled},set:function(e){this.mPanEnabled=e,this.markNeedsRenderUpdate()}},{key:"panSpeed",get:function(){return this.mPanSpeed},set:function(e){this.mPanSpeed=e,this.markNeedsRenderUpdate()}},{key:"rotateEnabled",get:function(){return this.mRotateEnabled},set:function(e){this.mRotateEnabled=e,this.markNeedsRenderUpdate()}},{key:"rotateSpeed",get:function(){return this.mRotationSpeed},set:function(e){this.mRotationSpeed=e,this.markNeedsRenderUpdate()}},{key:"zoomEnabled",get:function(){return this.mZoomEnabled},set:function(e){this.mZoomEnabled=e,this.markNeedsRenderUpdate()}},{key:"zoomSpeed",get:function(){return this.mZoomSpeed},set:function(e){this.mZoomSpeed=e,this.markNeedsRenderUpdate()}},{key:"zoomMin",get:function(){return this.mMinZoom},set:function(e){this.mMinZoom=e,this.markNeedsRenderUpdate()}},{key:"zoomMax",get:function(){return this.mMaxZoom},set:function(e){this.mMaxZoom=e,this.markNeedsRenderUpdate()}},{key:"isUpHemisphereLocked",get:function(){return this.mLockUpHemisphere}},{key:"lockUpHemisphere",set:function(e){this.mLockUpHemisphere=e,this.markNeedsRenderUpdate()}},{key:"azimuthAngleMin",get:function(){return this.mMinAzimuthAngle},set:function(e){this.mMinAzimuthAngle=e,this.markNeedsRenderUpdate()}},{key:"azimuthAngleMax",get:function(){return this.mMaxAzimuthAngle},set:function(e){this.mMaxAzimuthAngle=e,this.markNeedsRenderUpdate()}},{key:"polarAngleMin",get:function(){return this.mMinPolarAngle},set:function(e){this.mMinPolarAngle=e,this.markNeedsRenderUpdate()}},{key:"polarAngleMax",get:function(){return this.mMaxPolarAngle},set:function(e){this.mMaxPolarAngle=e,this.markNeedsRenderUpdate()}},{key:"dampingEnabled",get:function(){return this.mDampingEnabled},set:function(e){this.mDampingEnabled=e,this.markNeedsRenderUpdate()}},{key:"dampingFactor",get:function(){return this.mDampFactor},set:function(e){this.mDampFactor=e,this.markNeedsRenderUpdate()}},{key:"autoRotateEnabled",get:function(){return this.mAutoRotateEnabled},set:function(e){this.mAutoRotateEnabled=e,this.markNeedsRenderUpdate()}},{key:"autoRotateSpeed",get:function(){return this.mAutoRotateSpeed},set:function(e){this.mAutoRotateSpeed=e,this.markNeedsRenderUpdate()}},{key:"keyboardEnabled",get:function(){return this.mKeysEnabled},set:function(e){this.mKeysEnabled=e,this.markNeedsRenderUpdate()}}])}(de);function Oe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Oe=function(){return!!e})()}function De(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Ie,"TypeRTTI",new le.O("OrbitControlsComponent",de.TypeRTTI));var Pe,Be,Fe=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["fps-camera-controls"],r=(0,oe.A)(r),e=(0,ae.A)(n,Oe()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"mCamAnimate",void 0),(0,c.A)(e,"mTransformControlChanged",void 0),(0,c.A)(e,"mEnabled",!0),(0,c.A)(e,"mTarget",void 0),(0,c.A)(e,"mInitialTarget",void 0),(0,c.A)(e,"mMovementSpeed",5),(0,c.A)(e,"mConstrainVertical",!1),(0,c.A)(e,"mKeysEnabled",!0),(0,c.A)(e,"mLookSpeed",.75),(0,c.A)(e,"needsResizeUpdate",!1),(0,c.A)(e,"needsResetState",!1),e.mCamAnimate=new M.B,e.mTransformControlChanged=new M.B,e.mTarget=new te.P,e.mInitialTarget=new te.P,e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getControlsType",value:function(){return xe.FPSControls}},{key:"OnAttached",value:function(){var e=this;this.registerMessageHandler(m.EI.TypeRTTI,(function(){e.mCamAnimate.next()})),this.registerMessageHandler(m.jb.TypeRTTI,(function(){e.needsResizeUpdate=!0,e.markNeedsRenderUpdate()})),this.registerMessageHandler(m.LH.TypeRTTI,(function(){e.needsResizeUpdate=!0,e.markNeedsRenderUpdate()})),this.registerMessageHandler(m.xt.TypeRTTI,(function(t){t.reset&&e.resetState()})),this.registerMessageHandler(m.qX.TypeRTTI,(function(t){e.mEnabled=!(t.isTransformLocked||t.isTransformChanged),e.mEnabled||e.mTransformControlChanged.next(),e.markNeedsRenderUpdate()})),R.K.eventBus().subscribe(Me.getTopicName(),(function(){e.dispatchMessage(new m.TF)})),R.K.eventBus().subscribe(Ce.getTopicName(),(function(){e.dispatchMessage(new m.G_)})),this.mSubscriptions.push(this.mCamAnimate.pipe((0,k.M)((function(){e.mEnabled=!1,e.markNeedsRenderUpdate()})),C(100)).subscribe((function(){e.mEnabled=!0,e.resetState()})),this.mTransformControlChanged.pipe((0,k.M)((function(){e.mEnabled=!1})),C(100)).subscribe((function(){e.mEnabled=!0,e.markNeedsRenderUpdate()})))}},{key:"OnDetached",value:function(){this.unregisterFromAllMessages(),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"isControllerSupported",value:function(e){return e===we.FPSControls}},{key:"proxyGetValue",value:function(e){if((0,h.QE)(e)&&(0,h.XD)(e)===this.getControlsType()){switch((0,h.HP)(e)){case"enabled":return this.mEnabled;case"target":return this.mTarget;case"initial_target":return this.mInitialTarget;case"movement_speed":return this.mMovementSpeed;case"look_speed":return this.mLookSpeed;case"constrain_vertical":return this.mConstrainVertical;case"keys_enabled":return this.mKeysEnabled;case"resize_update":return this.needsResizeUpdate;case"reset_state":return this.needsResetState}return De(t,"proxyGetValue",this,3)([e])}switch(e){case"enabled":return this.mEnabled;case"target":return this.mTarget;case"initial_target":return this.mInitialTarget;case"resize_update":return this.needsResizeUpdate;case"reset_state":return this.needsResetState}return De(t,"proxyGetValue",this,3)([e])}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((0,h.QE)(e)&&(0,h.XD)(e)===this.getControlsType()){switch((0,h.HP)(e)){case"enabled":return this.mEnabled=!!n,!0;case"target":return Array.isArray(n)&&n.length>2?this.mTarget.fromArray(n):(n&&n instanceof te.P||n&&n.isVector3)&&this.mTarget.copy(n),r&&this.mInitialTarget.copy(this.mTarget),!0;case"target_x":return(0,h.kf)(n)&&(this.mTarget.x=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"target_y":return(0,h.kf)(n)&&(this.mTarget.y=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"target_z":return(0,h.kf)(n)&&(this.mTarget.z=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"movement_speed":return this.mMovementSpeed=parseFloat(n),!0;case"look_speed":return this.mLookSpeed=parseFloat(n),!0;case"constrain_vertical":return this.mConstrainVertical=!!n,!0;case"keys_enabled":return this.mKeysEnabled=n,!0}return De(t,"proxySetValue",this,3)([e,n,r])}switch(e){case"enabled":return this.mEnabled=!!n,!0;case"target":return Array.isArray(n)&&n.length>2?this.mTarget.fromArray(n):(n&&n instanceof te.P||n&&n.isVector3)&&this.mTarget.copy(n),r&&this.mInitialTarget.copy(this.mTarget),!0;case"cam_target_x":case"target_x":return(0,h.kf)(n)&&(this.mTarget.x=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"cam_target_y":case"target_y":return(0,h.kf)(n)&&(this.mTarget.y=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"cam_target_z":case"target_z":return(0,h.kf)(n)&&(this.mTarget.z=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0}return De(t,"proxySetValue",this,3)([e,n,r])}},{key:"parse",value:function(e,t,n){var r=this;e&&this.getControlsType()in e&&Object.keys(e[this.getControlsType()]).forEach((function(t){r.setValue("".concat(r.getControlsType(),".").concat(t),e[r.getControlsType()][t],!0)}))}},{key:"serialize",value:function(e,t){return{enabled:this.mEnabled,movement_speed:this.mMovementSpeed,constrain_vertical:this.mConstrainVertical,keys_enabled:this.mKeysEnabled,look_speed:this.mLookSpeed,target:this.mTarget.toArray()}}},{key:"resetState",value:function(){this.needsResetState=!0,this.markNeedsRenderUpdate()}},{key:"resetRenderFlags",value:function(){this.needsResetState=!1,this.needsResizeUpdate=!1}},{key:"enabled",get:function(){return this.mEnabled},set:function(e){this.mEnabled=e,this.markNeedsRenderUpdate()}},{key:"movementSpeed",get:function(){return this.mMovementSpeed},set:function(e){this.mMovementSpeed=e,this.markNeedsRenderUpdate()}},{key:"constrainVertical",get:function(){return this.mConstrainVertical},set:function(e){this.mConstrainVertical=e,this.markNeedsRenderUpdate()}},{key:"lookSpeed",get:function(){return this.mLookSpeed},set:function(e){this.mLookSpeed=e,this.markNeedsRenderUpdate()}},{key:"keyboardEnabled",get:function(){return this.mKeysEnabled},set:function(e){this.mKeysEnabled=e,this.markNeedsRenderUpdate()}}])}(de);function Ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ne=function(){return!!e})()}function Le(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Fe,"TypeRTTI",new le.O("FPSControlsComponent",de.TypeRTTI)),(Be=Pe||(Pe={}))[Be.Phi=0]="Phi",Be[Be.Theta=1]="Theta";var je=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["turntable-camera-controls"],r=(0,oe.A)(r),e=(0,ae.A)(n,Ne()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"mCamAnimate",void 0),(0,c.A)(e,"mTransformControlChanged",void 0),(0,c.A)(e,"mEnabled",!1),(0,c.A)(e,"mTarget",void 0),(0,c.A)(e,"mInitialTarget",void 0),(0,c.A)(e,"mZoomEnabled",!1),(0,c.A)(e,"mMaxZoom",1/0),(0,c.A)(e,"mMinZoom",0),(0,c.A)(e,"mDirection",Pe.Theta),(0,c.A)(e,"mMinPolarAngle",-1/0),(0,c.A)(e,"mMaxPolarAngle",1/0),(0,c.A)(e,"mMinAzimuthAngle",-1/0),(0,c.A)(e,"mMaxAzimuthAngle",1/0),(0,c.A)(e,"mDampingEnabled",!1),(0,c.A)(e,"mDampFactor",.05),(0,c.A)(e,"mRotationSpeed",.1),(0,c.A)(e,"mActiveObject",void 0),(0,c.A)(e,"needsSaveState",!1),(0,c.A)(e,"needsResetState",!1),(0,c.A)(e,"needsActiveObjectUpdate",!1),e.mTarget=new te.P(0,0,0),e.mInitialTarget=new te.P,e.mCamAnimate=new M.B,e.mTransformControlChanged=new M.B,e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getControlsType",value:function(){return xe.TurntableControls}},{key:"OnAttached",value:function(){var e=this;if(this.registerMessageHandler(m.EI.TypeRTTI,(function(){e.mCamAnimate.next()})),this.registerMessageHandler(m.xt.TypeRTTI,(function(t){t.reset&&e.resetState(),t.save&&e.saveState()})),this.registerMessageHandler(m.qX.TypeRTTI,(function(t){e.mEnabled=!(t.isTransformLocked||t.isTransformChanged),e.mEnabled||e.mTransformControlChanged.next(),e.markNeedsRenderUpdate()})),R.K.eventBus().subscribe(Me.getTopicName(),(function(){e.dispatchMessage(new m.TF)})),R.K.eventBus().subscribe(Ce.getTopicName(),(function(){e.dispatchMessage(new m.G_)})),this.mSubscriptions.push(this.mCamAnimate.pipe((0,k.M)((function(){e.mEnabled=!1,e.markNeedsRenderUpdate()})),C(100)).subscribe((function(){e.mEnabled=!0,e.resetState()}))),!this.mActiveObject){var t=R.K.sceneManager().getRootProductNode();t&&(this.mActiveObject=t,this.attachControls())}}},{key:"OnDetached",value:function(){this.unregisterFromAllMessages(),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"isControllerSupported",value:function(e){return e===we.TurnTableControls}},{key:"proxyGetValue",value:function(e){if((0,h.QE)(e)&&(0,h.XD)(e)===this.getControlsType()){switch((0,h.HP)(e)){case"enabled":return this.mEnabled;case"target":return this.mTarget;case"initial_target":return this.mInitialTarget;case"zoom_enabled":return this.mZoomEnabled;case"min_zoom":return this.mMinZoom;case"max_zoom":return this.mMaxZoom;case"direction":return this.mDirection;case"min_polar_angle":return this.mMinPolarAngle;case"max_polar_angle":return this.mMaxPolarAngle;case"min_azimuth_angle":return this.mMinAzimuthAngle;case"max_azimuth_angle":return this.mMaxAzimuthAngle;case"damping_enabled":return this.mDampingEnabled;case"damp_factor":return this.mDampFactor;case"rotation_speed":return this.mRotationSpeed;case"active_object":return this.mActiveObject;case"save_state":return this.needsSaveState;case"reset_state":return this.needsResetState;case"active_object_update":return this.needsActiveObjectUpdate}return Le(t,"proxyGetValue",this,3)([e])}switch(e){case"enabled":return this.mEnabled;case"target":return this.mTarget;case"initial_target":return this.mInitialTarget;case"min_zoom":return this.mMinZoom;case"max_zoom":return this.mMaxZoom;case"direction":return this.mDirection;case"min_polar_angle":return this.mMinPolarAngle;case"max_polar_angle":return this.mMaxPolarAngle;case"min_azimuth_angle":return this.mMinAzimuthAngle;case"max_azimuth_angle":return this.mMaxAzimuthAngle;case"damp_enabled":return this.mDampingEnabled;case"damp_factor":return this.mDampFactor;case"rotation_speed":return this.mRotationSpeed;case"active_object":return this.mActiveObject;case"save_state":return this.needsSaveState;case"reset_state":return this.needsResetState;case"active_object_update":return this.needsActiveObjectUpdate}return Le(t,"proxyGetValue",this,3)([e])}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((0,h.QE)(e)&&(0,h.XD)(e)===this.getControlsType()){switch((0,h.HP)(e)){case"enabled":return this.mEnabled=!!n,!0;case"target":return Array.isArray(n)&&n.length>2?this.mTarget.fromArray(n):(n&&n instanceof te.P||n&&n.isVector3)&&this.mTarget.copy(n),r&&this.mInitialTarget.copy(this.mTarget),!0;case"target_x":return(0,h.kf)(n)&&(this.mTarget.x=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"target_y":return(0,h.kf)(n)&&(this.mTarget.y=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"target_z":return(0,h.kf)(n)&&(this.mTarget.z=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"zoom_enabled":return this.mZoomEnabled=!!n,!0;case"min_zoom":return(0,h.kf)(n)&&(this.mMinZoom=parseFloat(n)),!0;case"max_zoom":return null===n?this.mMaxZoom=1/0:(0,h.kf)(n)&&(this.mMaxZoom=parseFloat(n)),!0;case"direction":return(0,h.kf)(n)?this.mDirection=parseInt(n,10):"string"==typeof n&&("phi"===n?this.mDirection=Pe.Phi:"theta"===n&&(this.mDirection=Pe.Theta)),!0;case"min_polar_angle":return null===n?this.mMinPolarAngle=-1/0:(0,h.kf)(n)&&(this.mMinPolarAngle=parseFloat(n)),!0;case"max_polar_angle":return null===n?this.mMaxPolarAngle=1/0:(0,h.kf)(n)&&(this.mMaxPolarAngle=parseFloat(n)),!0;case"min_azimuth_angle":return null===n?this.mMinAzimuthAngle=-1/0:(0,h.kf)(n)&&(this.mMinAzimuthAngle=parseFloat(n)),!0;case"max_azimuth_angle":return null===n?this.mMaxAzimuthAngle=1/0:(0,h.kf)(n)&&(this.mMaxAzimuthAngle=parseFloat(n)),!0;case"damping_enabled":return this.mDampingEnabled=!!n,!0;case"damp_factor":return(0,h.kf)(n)&&(this.mDampFactor=parseFloat(n)),!0;case"rotation_speed":return(0,h.kf)(n)&&(this.mRotationSpeed=parseFloat(n)),!0;case"active_object":return this.mActiveObject=n,!0}return Le(t,"proxySetValue",this,3)([e,n,r])}switch(e){case"enabled":return this.mEnabled=!!n,!0;case"target":return Array.isArray(n)&&n.length>2?this.mTarget.fromArray(n):(n&&n instanceof te.P||n&&n.isVector3)&&this.mTarget.copy(n),r&&this.mInitialTarget.copy(this.mTarget),!0;case"cam_target_x":case"target_x":return(0,h.kf)(n)&&(this.mTarget.x=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"cam_target_y":case"target_y":return(0,h.kf)(n)&&(this.mTarget.y=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"cam_target_z":case"target_z":return(0,h.kf)(n)&&(this.mTarget.z=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"min_zoom":return(0,h.kf)(n)&&(this.mMinZoom=parseFloat(n)),!0;case"max_zoom":return null===n?this.mMaxZoom=1/0:(0,h.kf)(n)&&(this.mMaxZoom=parseFloat(n)),!0;case"direction":return(0,h.kf)(n)?this.mDirection=parseInt(n,10):"string"==typeof n&&("phi"===n?this.mDirection=Pe.Phi:"theta"===n&&(this.mDirection=Pe.Theta)),!0;case"min_polar_angle":return null===n?this.mMinPolarAngle=-1/0:(0,h.kf)(n)&&(this.mMinPolarAngle=parseFloat(n)),!0;case"max_polar_angle":return null===n?this.mMaxPolarAngle=1/0:(0,h.kf)(n)&&(this.mMaxPolarAngle=parseFloat(n)),!0;case"min_azimuth_angle":return null===n?this.mMinAzimuthAngle=-1/0:(0,h.kf)(n)&&(this.mMinAzimuthAngle=parseFloat(n)),!0;case"max_azimuth_angle":return null===n?this.mMaxAzimuthAngle=1/0:(0,h.kf)(n)&&(this.mMaxAzimuthAngle=parseFloat(n)),!0;case"damp_enabled":return this.mDampingEnabled=!!n,!0;case"damp_factor":return(0,h.kf)(n)&&(this.mDampFactor=parseFloat(n)),!0;case"rotation_speed":return(0,h.kf)(n)&&(this.mRotationSpeed=parseFloat(n)),!0;case"active_object":return this.mActiveObject=n,!0}return Le(t,"proxySetValue",this,3)([e,n,r])}},{key:"parse",value:function(e,t,n){var r=this;e&&this.getControlsType()in e&&Object.keys(e[this.getControlsType()]).forEach((function(t){r.setValue("".concat(r.getControlsType(),".").concat(t),e[r.getControlsType()][t],!0)}))}},{key:"serialize",value:function(e,t){return{enabled:this.mEnabled,zoom_enabled:this.mZoomEnabled,min_zoom:this.mMinZoom,max_zoom:isFinite(this.mMaxZoom)&&null!==this.mMaxZoom?this.mMaxZoom:null,direction:this.mDirection===Pe.Phi?"phi":"theta",min_azimuth_angle:isFinite(this.mMinAzimuthAngle)&&null!==this.mMinAzimuthAngle?this.mMinAzimuthAngle:null,max_azimuth_angle:isFinite(this.mMaxAzimuthAngle)&&null!==this.mMaxAzimuthAngle?this.mMaxAzimuthAngle:null,min_polar_angle:isFinite(this.mMinPolarAngle)&&null!==this.mMinPolarAngle?this.mMinPolarAngle:null,max_polar_angle:isFinite(this.mMaxPolarAngle)&&null!==this.mMaxPolarAngle?this.mMaxPolarAngle:null,damping_enabled:this.mDampingEnabled,damp_factor:this.mDampFactor,rotation_speed:this.mRotationSpeed,target:this.mTarget.toArray()}}},{key:"attachControls",value:function(){this.needsActiveObjectUpdate=!0,this.mEnabled=!0,this.markNeedsRenderUpdate()}},{key:"detachControls",value:function(){this.mActiveObject=null,this.needsActiveObjectUpdate=!0,this.mEnabled=!1,this.markNeedsRenderUpdate()}},{key:"saveState",value:function(){this.needsSaveState=!0,this.markNeedsRenderUpdate()}},{key:"resetState",value:function(){this.needsResetState=!0,this.markNeedsRenderUpdate()}},{key:"resetRenderFlags",value:function(){this.needsSaveState=!1,this.needsResetState=!1}},{key:"enabled",get:function(){return this.mEnabled},set:function(e){this.mEnabled=e,this.markNeedsRenderUpdate()}},{key:"zoomEnabled",get:function(){return this.mZoomEnabled},set:function(e){this.mZoomEnabled=e,this.markNeedsRenderUpdate()}},{key:"zoomMin",get:function(){return this.mMinZoom},set:function(e){this.mMinZoom=e,this.markNeedsRenderUpdate()}},{key:"zoomMax",get:function(){return this.mMaxZoom},set:function(e){this.mMaxZoom=e,this.markNeedsRenderUpdate()}},{key:"direction",get:function(){return this.mDirection},set:function(e){this.mDirection=e,this.markNeedsRenderUpdate()}},{key:"azimuthAngleMin",get:function(){return this.mMinAzimuthAngle},set:function(e){this.mMinAzimuthAngle=e,this.markNeedsRenderUpdate()}},{key:"azimuthAngleMax",get:function(){return this.mMaxAzimuthAngle},set:function(e){this.mMaxAzimuthAngle=e,this.markNeedsRenderUpdate()}},{key:"polarAngleMin",get:function(){return this.mMinPolarAngle},set:function(e){this.mMinPolarAngle=e,this.markNeedsRenderUpdate()}},{key:"polarAngleMax",get:function(){return this.mMaxPolarAngle},set:function(e){this.mMaxPolarAngle=e,this.markNeedsRenderUpdate()}},{key:"dampingEnabled",get:function(){return this.mDampingEnabled},set:function(e){this.mDampingEnabled=e,this.markNeedsRenderUpdate()}},{key:"dampingFactor",get:function(){return this.mDampFactor},set:function(e){this.mDampFactor=e,this.markNeedsRenderUpdate()}},{key:"rotationSpeed",get:function(){return this.mRotationSpeed},set:function(e){this.mRotationSpeed=e,this.markNeedsRenderUpdate()}}])}(de);function Ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ue(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ze(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return He(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?He(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function He(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ge=function(){return!!e})()}function qe(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(je,"TypeRTTI",new le.O("TurntableControlsComponent",de.TypeRTTI));var We=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,Ge()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mNear",.1),(0,c.A)(n,"mFar",1e3),(0,c.A)(n,"mAspectRatio",1),(0,c.A)(n,"mZoom",1),(0,c.A)(n,"mController",we.OrbitControls),(0,c.A)(n,"mActive",!1),(0,c.A)(n,"mIsPartOfScene",!0),(0,c.A)(n,"mNeedsUpdateProjectionMatrix",!1),(0,c.A)(n,"mTarget",new te.P),(0,c.A)(n,"mInitialTarget",new te.P),(0,c.A)(n,"mSubscriptions",[]),(0,c.A)(n,"mAutoFocus",me.NONE),(0,c.A)(n,"mAutoFocusNeedsUpdate",!0),(0,c.A)(n,"mIsAnimating",!1),n.mName="CameraEntity",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getCameraTechnique",value:function(){return this.mTechnique}},{key:"onDraw",value:function(e,n){qe(t,"onDraw",this,3)([e,n]),this.mActive&&e.addCamera(this)}},{key:"destroy",value:function(e,n){qe(t,"destroy",this,3)([e,n]),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"proxyGetValue",value:function(e){var n,r=ze(this.getComponents(de.TypeRTTI));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.isControllerSupported(this.mController)){var a=i.getValue(e);if(null!==a)return a}}}catch(e){r.e(e)}finally{r.f()}switch(e){case"is_animating":return this.mIsAnimating;case"cam_controller":return this.mController;case"camera_active":case"active":return this.mActive;case"near":return this.mNear;case"far":return this.mFar;case"aspect_ratio":return this.mAspectRatio;case"zoom":return this.mZoom;case"target":return this.mTarget;case"initial_target":return this.mInitialTarget;case"auto_focus":return this.mAutoFocus}return qe(t,"proxyGetValue",this,3)([e])}},{key:"proxySetValue",value:function(e,n,r){var i=this,a=this.getComponents(de.TypeRTTI),o=!1;if(a.forEach((function(t){t.isControllerSupported(i.mController)&&t.setValue(e,n,r)&&(o=!0)})),o)return o;switch(e){case"is_animating":return this.mIsAnimating=!!n,!0;case"cam_controller":return(0,h.kf)(n)&&(this.mController=parseInt(n,10),this.changeCameraControls()),!0;case"camera_active":case"active":return this.mActive=!!n,!0;case"near":return(0,h.kf)(n)&&(this.mNear=parseFloat(n),this.mNeedsUpdateProjectionMatrix=!0),!0;case"far":return(0,h.kf)(n)&&(this.mFar=parseFloat(n),this.mNeedsUpdateProjectionMatrix=!0),!0;case"aspect_ratio":return(0,h.kf)(n)&&(this.mAspectRatio=parseFloat(n),this.mNeedsUpdateProjectionMatrix=!0),!0;case"zoom":return(0,h.kf)(n)&&(this.mZoom=parseFloat(n),this.mNeedsUpdateProjectionMatrix=!0),!0;case"auto_focus":return this.autoFocus=n,!0;case"target":return Array.isArray(n)&&n.length>2?this.mTarget.fromArray(n):(n&&n instanceof te.P||n&&n.isVector3)&&this.mTarget.copy(n),r||this.mInitialTarget.copy(this.mTarget),!0;case"rotation_x":var s=(new re.O).copy(this.transform.rotation);return s.x=parseFloat(n),this.transform.rotation.copy(s,!1),this.initialTransform.rotation.copy(this.transform.rotation,!1),!0;case"rotation_y":var u=(new re.O).copy(this.transform.rotation);return u.y=parseFloat(n),this.transform.rotation.copy(u,!1),this.initialTransform.rotation.copy(this.transform.rotation,!1),!0;case"rotation_z":var c=(new re.O).copy(this.transform.rotation);return c.z=parseFloat(n),this.transform.rotation.copy(c,!1),this.initialTransform.rotation.copy(this.transform.rotation,!1),!0;case"quaternion_x":var l=(new ne.P).copy(this.transform.quaternion);return l.x=parseFloat(n),this.transform.quaternion.copy(l,!1),this.initialTransform.quaternion.copy(this.transform.quaternion,!1),!0;case"quaternion_y":var f=(new ne.P).copy(this.transform.quaternion);return f.y=parseFloat(n),this.transform.quaternion.copy(f,!1),this.initialTransform.quaternion.copy(this.transform.quaternion,!1),!0;case"quaternion_z":var m=(new ne.P).copy(this.transform.quaternion);return m.z=parseFloat(n),this.transform.quaternion.copy(m,!1),this.initialTransform.quaternion.copy(this.transform.quaternion,!1),!0;case"quaternion_w":var p=(new ne.P).copy(this.transform.quaternion);return p.w=parseFloat(n),this.transform.quaternion.copy(p,!1),this.initialTransform.quaternion.copy(this.transform.quaternion,!1),!0;case"rotation":return n&&n instanceof re.O?(this.transform.rotation.copy(n,!1),this.initialTransform.rotation.copy(this.transform.rotation)):Array.isArray(n)&&n.length>2?(this.transform.rotation.fromArray(n,re.O.DefaultOrder,!1),this.initialTransform.rotation.copy(this.transform.rotation)):n&&!0===n.isEuler&&(this.transform.rotation.copy(n,!1),this.initialTransform.rotation.copy(this.transform.rotation)),!0;case"quaternion":return n&&n instanceof ne.P?(this.transform.quaternion.copy(n,!1),this.initialTransform.quaternion.copy(this.transform.quaternion)):Array.isArray(n)&&n.length>3?(this.transform.quaternion.fromArray(n,0,!1),this.initialTransform.quaternion.copy(this.transform.quaternion)):n&&!0===n.isQuaternion&&(this.transform.quaternion.copy(n,!1),this.initialTransform.quaternion.copy(this.transform.quaternion)),!0;case"properties":return!0}return qe(t,"proxySetValue",this,3)([e,n,r])}},{key:"updateProjectionMatrix",value:function(){this.mNeedsUpdateProjectionMatrix=!0}},{key:"serialize",value:function(e,n){var r=Object.assign(qe(t,"serialize",this,3)([e]),{type:"camera"}),i={};return this.getComponents(de.TypeRTTI).forEach((function(t){i=Ve(Ve({},i),{},(0,c.A)({},t.getControlsType(),t.serialize(e,n)))})),r.properties=Object.assign(r.properties,Ve({cam_controller:this.mController,near:this.mNear,far:this.mFar,auto_focus:this.mAutoFocus},i)),r}},{key:"parse",value:function(e,n,r){var i=this;if(!e.properties)return qe(t,"parse",this,3)([e,n,r]);if(this.onBeforeParse(e,n)){try{var a={};a="string"==typeof e.properties?JSON.parse(e.properties):e.properties,this.mController=parseInt(a.cam_controller||0,10),this.changeCameraControls();var o=this.getComponents(de.TypeRTTI);o.forEach((function(e){e.getControlsType()in a&&e.parse(a,n,r)})),Object.keys(a).forEach((function(e){"properties"!==e?"cam_controller"!==e&&(o.forEach((function(t){t.setValue(e,a[e],!0)})),i.setValue(e,a[e],!0)):v.UX.warn("Properties field can not contain key name properties")}))}catch(e){v.UX.warn("Could not parse properties:",e)}delete e.properties,qe(t,"parse",this,3)([e,n,r])}}},{key:"changeCameraControls",value:function(){switch(this.removeComponents(de.TypeRTTI),this.mController){case we.FPSControls:this.addComponent(new Fe);break;case we.TurnTableControls:this.addComponent(new je);break;case we.OrbitControls:default:this.addComponent(new Ie)}this.markNeedsRenderUpdate()}},{key:"controller",get:function(){return this.mController},set:function(e){this.mController=e,this.changeCameraControls()}},{key:"isCameraActive",value:function(){return this.mActive}},{key:"setCameraActive",value:function(e){this.mActive=e}},{key:"setCameraPartOfScene",value:function(e){this.mIsPartOfScene=e}},{key:"isCameraPartOfScene",value:function(){return this.mIsPartOfScene}},{key:"near",get:function(){return this.mNear},set:function(e){this.mNear=e}},{key:"far",get:function(){return this.mFar},set:function(e){this.mFar=e}},{key:"aspectRatio",get:function(){return this.mAspectRatio},set:function(e){this.mAspectRatio=e}},{key:"zoom",get:function(){return this.mZoom},set:function(e){this.mZoom=e}},{key:"autoFocus",get:function(){return this.mAutoFocus},set:function(e){e!==this.mAutoFocus&&(this.mAutoFocus=e,this.mAutoFocusNeedsUpdate=!0,this.updatePositionByAutoFocus(this.mAutoFocus))}},{key:"autoFocusNeedsUpdate",get:function(){return this.mAutoFocusNeedsUpdate}},{key:"updateAutoFocus",value:function(){return!this.mAutoFocusNeedsUpdate||this.updatePositionByAutoFocus(this.autoFocus)}},{key:"target",get:function(){return this.getValue("target")},set:function(e){this.setValue("target",e)}},{key:"initialTarget",get:function(){return this.getValue("initial_target")}},{key:"isAnimating",get:function(){return this.mIsAnimating}},{key:"needsProjectionMatrixUpdate",value:function(){return this.mNeedsUpdateProjectionMatrix}},{key:"setProjectionMatrixUpdate",value:function(e){this.mNeedsUpdateProjectionMatrix=e}},{key:"markProjectionMatrixUpdate",value:function(){this.setProjectionMatrixUpdate(!0)}}])}(ce.S);function Ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ke=function(){return!!e})()}(0,c.A)(We,"TypeRTTI",new le.O("CameraEntity",ce.S.TypeRTTI));var Xe=__webpack_require__(63662);function Ye(e,t,n){if(Ke())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&(0,Xe.A)(i,n.prototype),i}function $e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($e=function(){return!!e})()}var Ze=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,$e()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mSettings",void 0),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"OnAttached",value:function(){this.mSettings=R.K.settingsManager().getSettings()}},{key:"getType",value:function(){return t.TypeRTTI}}])}(he.$);(0,c.A)(Ze,"TypeRTTI",new le.O("ToolbarComponent",he.$.TypeRTTI));__webpack_require__(42207),__webpack_require__(3296),__webpack_require__(27208),__webpack_require__(48408),__webpack_require__(98721);var Qe,Je,et=__webpack_require__(11454),tt=__webpack_require__(38685),nt=__webpack_require__(28001);function rt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rt=function(){return!!e})()}(Je=Qe||(Qe={})).BOTTOM_RIGHT="BOTTOM_RIGHT",Je.BOTTOM_LEFT="BOTTOM_LEFT",Je.TOP_LEFT="TOP_LEFT",Je.TOP_RIGHT="TOP_RIGHT";var it=function(e){function t(){var e,n,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,s.A)(this,t),n=this,r=t,r=(0,oe.A)(r),e=(0,ae.A)(n,rt()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"onError",new M.B),(0,c.A)(e,"onStateChange",new M.B),(0,c.A)(e,"mValue",void 0),(0,c.A)(e,"mSettings",void 0),(0,c.A)(e,"parent",null),(0,c.A)(e,"children",[]),(0,c.A)(e,"mModuleSettings",null),e.mSettings=R.K.settingsManager().getSettings(),e.mValue=Object.assign({name:null,enabled:!0,position:Qe.BOTTOM_RIGHT,color:"transparent",hover:"rgba(0, 0, 0, 0.1)",image_source:"",padding:0,busy:!1,sharing:!1,arqr:!1,protect_mutation:!1,inverted:!1},a),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"setValue",value:function(e,t){var n=this;switch(e){case"enabled":return this.mValue.enabled=t,this.onStateChange.next({item:this,name:"enabled",value:t}),!0;case"image_source":return this.mValue.image_source=t,!0;case"icon":return this.mValue.icon=t,!0;case"icon_inverted":return this.mValue.icon_inverted=t,!0;case"busy":return this.mValue.busy=t,this.onStateChange.next({item:this,name:"busy",value:t,message:"Loading AR...",icon:'\n                        <svg viewBox="0 0 48 48" width="48" height="48">\n                            <style>\n                                @keyframes XPVWebArLoading { to { stroke-dashoffset: 90; } }\n                            </style>\n                            <path d="M24.5 21.5L11.5 14.5L24.5 8.5L37.5 15.5L24.5 21.5L37.5 15.5V30.5L24.5 37.5V21.5V37.5L11.5 30.5V14.5L24.5 21.5Z" style="stroke:currentcolor;fill:none;stroke-width:2;stroke-dasharray:60 30;animation:XPVWebArLoading 2s linear infinite;stroke-linejoin:round;stroke-linecap:round;"/>\n                        </svg>\n                    '}),!0;case"arqr":return this.mValue.arqr=!(0,P.isNullOrUndefined)(t),tt.A.loadScript("https://cdnjs.cloudflare.com/ajax/libs/qrious/4.0.2/qrious.min.js").then((function(){var e=function(e){return encodeURI(btoa(e))},r=new window.URL(et.w.backendURL+"/product-ar");r.searchParams.append("android",e(t[0])),r.searchParams.append("ios",e(t[1]));var i=document.createElement("canvas");new QRious({element:i,size:240,value:r.toString()}),n.onStateChange.next({item:n,name:"arqr",value:!(0,P.isNullOrUndefined)(t),icon:i})})).catch((function(e){return v.UX.error(e)})),!0;case"position":return this.mValue.position=t,!0;case"sharing":return this.mValue.sharing=t,this.onStateChange.next({item:this,name:"sharing",value:t}),!0;case"inverted":return this.mValue.inverted=t,this.onStateChange.next({item:this,name:"inverted",value:t}),!0}return!1}},{key:"getValue",value:function(e){switch(e){case"name":case"enabled":case"image_source":case"icon":case"icon_inverted":case"busy":case"position":case"sharing":case"protect_mutation":case"inverted":return this.mValue[e]}return null}},{key:"getSetting",value:function(e){return this.mModuleSettings?this.mModuleSettings[e]?this.mModuleSettings[e]:this.mModuleSettings.settings&&this.mModuleSettings.settings[e]?this.mModuleSettings.settings[e]:null:null}},{key:"getParent",value:function(){return this.parent}},{key:"getChildren",value:function(){return this.children}}])}(nt.b);function at(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(at=function(){return!!e})()}(0,c.A)(it,"TypeRTTI",new le.O("ToolbarItemController",nt.b.TypeRTTI));var ot=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[{name:"fullscreen",enabled:!0,icon:'\n                <svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 48 48" style="stroke: currentColor; stroke-width: 0.5;">\n                    <path d="M10 38v-9.65h3V35h6.65v3Zm0-18.35V10h9.65v3H13v6.65ZM28.35 38v-3H35v-6.65h3V38ZM35 19.65V13h-6.65v-3H38v9.65Z"/>\n                </svg>\n            ',icon_inverted:'\n                <svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 48 48" style="stroke: currentColor; stroke-width: 0.5;">\n                    <path d="M16.65 38v-6.65H10v-3h9.65V38Zm11.7 0v-9.65H38v3h-6.65V38ZM10 19.65v-3h6.65V10h3v9.65Zm18.35 0V10h3v6.65H38v3Z"/>\n                </svg>\n            '}],i=(0,oe.A)(i),n=(0,ae.A)(r,at()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mViewRenderCanvas",void 0),n.mViewRenderCanvas=e,n.setValue("enabled",!(0,H.un)()),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getViewRenderCanvas",value:function(){return this.mViewRenderCanvas}}])}(it);function st(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(st=function(){return!!e})()}(0,c.A)(ot,"TypeRTTI",new le.O("FullscreenToolbarItemController",it.TypeRTTI));var ut,ct,lt=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["toolbar-fullscreen-component"],r=(0,oe.A)(r),e=(0,ae.A)(n,st()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mController",void 0),(0,c.A)(e,"mIsFullscreen",!1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"OnAttached",value:function(){var e,n,r,i,a,o=this;(e=t,n="OnAttached",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.mController=this.getParentObject(),this.registerMessageHandler(m.q0.TypeRTTI,(function(){o.action().then((function(){}),(function(e){v.UX.error(e)}))})),this.mIsFullscreen=!1,document.addEventListener("fullscreenchange",this.onFullScreen.bind(this),!1),document.addEventListener("webkitfullscreenchange",this.onFullScreen.bind(this),!1),document.addEventListener("mozfullscreenchange",this.onFullScreen.bind(this),!1),document.addEventListener("MSFullscreenChange",this.onFullScreen.bind(this),!1)}},{key:"OnDetached",value:function(){document.removeEventListener("fullscreenchange",this.onFullScreen.bind(this)),document.removeEventListener("webkitfullscreenchange",this.onFullScreen.bind(this)),document.removeEventListener("mozfullscreenchange",this.onFullScreen.bind(this)),document.removeEventListener("MSFullscreenChange",this.onFullScreen.bind(this)),this.unregisterMessageHandler(m.q0.TypeRTTI)}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(ot.TypeRTTI)}},{key:"action",value:(o=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){return t.mIsFullscreen?t.closeFullscreen():t.openFullscreen(t.mController.getViewRenderCanvas()),e()})));case 1:case"end":return e.stop()}}),e)}))),function(){return o.apply(this,arguments)})},{key:"openFullscreen",value:function(e){var t=this;this.requestFullscreen(e).then((function(){t.mIsFullscreen=!0,R.K.eventBus().dispatch(new K.r(Q.E.WindowResized)),t.mController.setValue("inverted",!0)}),(function(e){v.UX.error(e)}))}},{key:"closeFullscreen",value:function(){var e=this;this.exitFullscreen().then((function(){e.mIsFullscreen=!1,R.K.eventBus().dispatch(new K.r(Q.E.WindowResized)),e.mController.setValue("inverted",!1)}),(function(e){v.UX.error(e)}))}},{key:"onFullScreen",value:function(){this.mIsFullscreen=null!==document.fullscreenElement,R.K.eventBus().dispatch(new K.r(Q.E.WindowResized))}},{key:"isFullscreenEnabled",value:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled}},{key:"requestFullscreen",value:(a=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){if(!n.isFullscreenEnabled())return r("Fullscreen api not available.");var i=null;t.requestFullscreen?i=t.requestFullscreen():"mozRequestFullScreen"in t?i=t.mozRequestFullScreen():"webkitRequestFullScreen"in t?i=t.webkitRequestFullScreen():"msRequestFullscreen"in t?i=t.msRequestFullscreen():"webkitEnterFullscreen"in t&&(i=t.webkitEnterFullscreen()),!(0,P.isNullOrUndefined)(i)&&i instanceof Promise?i.then((function(){e()}),(function(e){r(e)})):e()})));case 1:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"exitFullscreen",value:(r=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){if(!t.isFullscreenEnabled())return n("Fullscreen api not available.");var r=null;document.exitFullscreen?r=document.exitFullscreen():"webkitExitFullscreen"in document?r=document.webkitExitFullscreen():"mozCancelFullScreen"in document?r=document.mozCancelFullScreen():"msExitFullscreen"in document&&(r=document.msExitFullscreen()),!(0,P.isNullOrUndefined)(r)&&r instanceof Promise?r.then((function(){e()}),(function(e){n(e)})):e()})));case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"getType",value:function(){return t.TypeRTTI}}]);var r,a,o}(Ze);function ht(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ht=function(){return!!e})()}(0,c.A)(lt,"TypeRTTI",new le.O("FullscreenComponent",Ze.TypeRTTI)),(ct=ut||(ut={})).TOP_RIGHT="TOP_RIGHT",ct.TOP_LEFT="TOP_LEFT",ct.BOTTOM_LEFT="BOTTOM_LEFT",ct.BOTTOM_RIGHT="BOTTOM_RIGHT";var ft=function(e){function t(e){var n,r,i,a;(0,s.A)(this,t),r=this,i=t,a=[{name:"social",enabled:!0,icon:'\n                <svg viewBox="0 0 36 36" width="36" height="36">\n                    <path d="M19 12A1 1 0 0 0 23 8A1 1 0 0 0 19 12ZM12 15A1 1 0 0 0 8 19A1 1 0 0 0 12 15ZM23 22A1 1 0 0 0 19 26A1 1 0 0 0 23 22ZM18 12L13 15M13 19L18 22" style="fill:none;stroke-linecap:square;stroke-width:2;stroke:currentcolor;"/>\n                </svg>\n            '}],i=(0,oe.A)(i),n=(0,ae.A)(r,ht()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mViewRenderCanvas",void 0),n.mViewRenderCanvas=e,n.mModuleSettings=n.mSettings.getSubModuleSettings("social","GENERAL");var o=n.mSettings.isModuleEnabled("social")&&n.mModuleSettings.status;n.setValue("enabled",o);var u=n.mModuleSettings.settings&&n.mModuleSettings.settings.position||ut.BOTTOM_RIGHT,l=Qe[u];return n.setValue("position",l),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getViewRenderCanvas",value:function(){return this.mViewRenderCanvas}}])}(it);function mt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mt=function(){return!!e})()}(0,c.A)(ft,"TypeRTTI",new le.O("SocialSharingToolbarItemController",it.TypeRTTI));var pt=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["toolbar-social-sharing-component"],r=(0,oe.A)(r),e=(0,ae.A)(n,mt()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mController",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"OnAttached",value:function(){var e,n,r,i,a,o=this;(e=t,n="OnAttached",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.mController=this.getParentObject(),this.registerMessageHandler(m.q0.TypeRTTI,(function(){o.action().then((function(){}),(function(e){v.UX.error(e)}))}))}},{key:"OnDetached",value:function(){}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(ft.TypeRTTI)}},{key:"action",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){return e()})));case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"getType",value:function(){return t.TypeRTTI}}]);var r}(Ze);function dt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dt=function(){return!!e})()}(0,c.A)(pt,"TypeRTTI",new le.O("SocialSharingComponent",Ze.TypeRTTI));var vt=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[{enabled:!0,icon:'\n                <svg viewBox="-30 -30 215 215" width="36" height="36">\n                    <path d="M89.584,155.139V84.378h23.742l3.562-27.585H89.584V39.184c0-7.984,2.208-13.425,13.67-13.425l14.595-0.006V1.08C115.325,0.752,106.661,0,96.577,0C75.52,0,61.104,12.853,61.104,36.452v20.341H37.29v27.585h23.814v70.761H89.584z" style="fill:currentcolor;"/>\n                </svg>\n            '}],i=(0,oe.A)(i),n=(0,ae.A)(r,dt()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mViewRenderCanvas",void 0),n.mViewRenderCanvas=e,n.mModuleSettings=n.mSettings.getSubModuleSettings("social","facebook"),n.setValue("enabled",!0===n.mModuleSettings.status),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getViewRenderCanvas",value:function(){return this.mViewRenderCanvas}}])}(it);function yt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yt=function(){return!!e})()}(0,c.A)(vt,"TypeRTTI",new le.O("FacebookSocialSharingToolbarItemController",it.TypeRTTI));var gt=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["toolbar-facebook-social-sharing-component"],r=(0,oe.A)(r),e=(0,ae.A)(n,yt()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mController",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"OnAttached",value:function(){var e,n,r,i,a,o=this;(e=t,n="OnAttached",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.mController=this.getParentObject(),this.registerMessageHandler(m.q0.TypeRTTI,(function(){o.mController.getValue("sharing")||o.action().then((function(){window.setTimeout((function(){o.mController.setValue("sharing",!1)}),2e3)}),(function(e){v.UX.error(e)}))}))}},{key:"OnDetached",value:function(){}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(vt.TypeRTTI)}},{key:"action",value:(r=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){return t.mController.setValue("sharing",t.mController.mModuleSettings),e()})));case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"getType",value:function(){return t.TypeRTTI}}]);var r}(Ze);function bt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bt=function(){return!!e})()}(0,c.A)(gt,"TypeRTTI",new le.O("FacebookSocialSharingComponent",Ze.TypeRTTI));var At=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[{enabled:!0,icon:'\n                <svg viewBox="-103 -101 842 842" width="36" height="36">\n                    <path d="m544.386719 93.007812c-59.875-59.945312-139.503907-92.9726558-224.335938-93.007812-174.804687 0-317.070312 142.261719-317.140625 317.113281-.023437 55.894531 14.578125 110.457031 42.332032 158.550781l-44.992188 164.335938 168.121094-44.101562c46.324218 25.269531 98.476562 38.585937 151.550781 38.601562h.132813c174.785156 0 317.066406-142.273438 317.132812-317.132812.035156-84.742188-32.921875-164.417969-92.800781-224.359376zm-224.335938 487.933594h-.109375c-47.296875-.019531-93.683594-12.730468-134.160156-36.742187l-9.621094-5.714844-99.765625 26.171875 26.628907-97.269531-6.269532-9.972657c-26.386718-41.96875-40.320312-90.476562-40.296875-140.28125.054688-145.332031 118.304688-263.570312 263.699219-263.570312 70.40625.023438 136.589844 27.476562 186.355469 77.300781s77.15625 116.050781 77.132812 186.484375c-.0625 145.34375-118.304687 263.59375-263.59375 263.59375zm144.585938-197.417968c-7.921875-3.96875-46.882813-23.132813-54.148438-25.78125-7.257812-2.644532-12.546875-3.960938-17.824219 3.96875-5.285156 7.929687-20.46875 25.78125-25.09375 31.066406-4.625 5.289062-9.242187 5.953125-17.167968 1.984375-7.925782-3.964844-33.457032-12.335938-63.726563-39.332031-23.554687-21.011719-39.457031-46.960938-44.082031-54.890626-4.617188-7.9375-.039062-11.8125 3.476562-16.171874 8.578126-10.652344 17.167969-21.820313 19.808594-27.105469 2.644532-5.289063 1.320313-9.917969-.664062-13.882813-1.976563-3.964844-17.824219-42.96875-24.425782-58.839844-6.4375-15.445312-12.964843-13.359374-17.832031-13.601562-4.617187-.230469-9.902343-.277344-15.1875-.277344-5.28125 0-13.867187 1.980469-21.132812 9.917969-7.261719 7.933594-27.730469 27.101563-27.730469 66.105469s28.394531 76.683594 32.355469 81.972656c3.960937 5.289062 55.878906 85.328125 135.367187 119.648438 18.90625 8.171874 33.664063 13.042968 45.175782 16.695312 18.984374 6.03125 36.253906 5.179688 49.910156 3.140625 15.226562-2.277344 46.878906-19.171875 53.488281-37.679687 6.601563-18.511719 6.601563-34.375 4.617187-37.683594-1.976562-3.304688-7.261718-5.285156-15.183593-9.253906zm0 0" style="fill-rule:evenodd;fill:currentcolor;"/>\n                </svg>\n            '}],i=(0,oe.A)(i),n=(0,ae.A)(r,bt()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mViewRenderCanvas",void 0),n.mViewRenderCanvas=e,n.mModuleSettings=n.mSettings.getSubModuleSettings("social","whatsapp"),n.setValue("enabled",!0===n.mModuleSettings.status),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getViewRenderCanvas",value:function(){return this.mViewRenderCanvas}}])}(it);function _t(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_t=function(){return!!e})()}(0,c.A)(At,"TypeRTTI",new le.O("WhatsappSocialSharingToolbarItemController",it.TypeRTTI));var Mt=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["toolbar-whatsapp-social-sharing-component"],r=(0,oe.A)(r),e=(0,ae.A)(n,_t()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mController",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"OnAttached",value:function(){var e,n,r,i,a,o=this;(e=t,n="OnAttached",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.mController=this.getParentObject(),this.registerMessageHandler(m.q0.TypeRTTI,(function(){o.mController.getValue("sharing")||o.action().then((function(){window.setTimeout((function(){o.mController.setValue("sharing",!1)}),2e3)}),(function(e){v.UX.error(e)}))}))}},{key:"OnDetached",value:function(){}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(At.TypeRTTI)}},{key:"action",value:(r=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){return t.mController.setValue("sharing",t.mController.mModuleSettings),e()})));case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"getType",value:function(){return t.TypeRTTI}}]);var r}(Ze);(0,c.A)(Mt,"TypeRTTI",new le.O("WhatsappSocialSharingComponent",Ze.TypeRTTI));var kt=__webpack_require__(48283),wt=__webpack_require__(59452);function Tt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Tt=function(){return!!e})()}var xt=function(e){function t(){var e,n,r,i;(0,s.A)(this,t),n=this,r=t,i=[{name:"web-ar",enabled:!0,icon:'\n                <svg viewBox="0 0 72 36" width="72" height="36">\n                    <path d="M21 17L10 11L21 5L32 11L21 17L32 11V24L21 31V17V31L10 24V11L21 17Z" style="stroke:currentcolor;fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round;"/>\n                    <path d="M40 24L44 13Q45 11 46 13L50 24M42 20H48M53 24V12H58A1 1 0 0 1 58 18H53H55Q58 18 60 21L62 24" style="stroke:currentcolor;stroke-width:2;stroke-linejoin:round;stroke-linecap:round;fill:none;"/>\n                </svg>\n            '}],r=(0,oe.A)(r);var a=!1;if((e=(0,ae.A)(n,Tt()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i))).mSettings.isModuleEnabled("webar"))if((0,H.m0)())a=!0;else if((0,H.un)()){a=document.createElement("a").relList.supports("ar")||(0,H.O)()[0]>=16}else(0,H.xl)()&&(a=!0);return e.setValue("enabled",a),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(it);(0,c.A)(xt,"TypeRTTI",new le.O("WebArToolbarItemController",it.TypeRTTI));var St,Ct,Et=__webpack_require__(95216),Rt=(__webpack_require__(74423),__webpack_require__(25428),__webpack_require__(69479),__webpack_require__(99449),__webpack_require__(21699),__webpack_require__(8159),__webpack_require__(37550),__webpack_require__(3216)),It=__webpack_require__(12164);(Ct=St||(St={}))[Ct.NoToneMapping=0]="NoToneMapping",Ct[Ct.LinearToneMapping=1]="LinearToneMapping",Ct[Ct.ReinhardToneMapping=2]="ReinhardToneMapping",Ct[Ct.Uncharted2ToneMapping=3]="Uncharted2ToneMapping",Ct[Ct.CineonToneMapping=4]="CineonToneMapping";var Ot=__webpack_require__(3834);function Dt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dt=function(){return!!e})()}function Pt(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Bt=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,Dt()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mTechnique",Ot.nX.perspective),(0,c.A)(n,"mFov",45),(0,c.A)(n,"mPipeline",void 0),(0,c.A)(n,"mToneMappingType",St[St.Uncharted2ToneMapping]),(0,c.A)(n,"mToneMappingExposure",1),(0,c.A)(n,"mToneMappingWhitePoint",1),n.mName="Camera Perspective",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"fov":return(0,h.kf)(n)&&(this.mFov=parseFloat(n),this.mNeedsUpdateProjectionMatrix=!0),!0;case"pipeline":return this.mPipeline=String(n),!0;case"tonemapping_type":this.mToneMappingType=String(n);break;case"tonemapping_exposure":(0,h.kf)(n)&&(this.mToneMappingExposure=parseFloat(n));break;case"tonemapping_whitepoint":(0,h.kf)(n)&&(this.mToneMappingWhitePoint=parseFloat(n));break;default:return Pt(t,"proxySetValue",this,3)([e,n,r])}}},{key:"proxyGetValue",value:function(e){switch(e){case"fov":return this.mFov;case"pipeline":return this.mPipeline;case"tonemapping_type":return this.mToneMappingType;case"tonemapping_exposure":return this.mToneMappingExposure;case"tonemapping_whitepoint":return this.mToneMappingWhitePoint;case"needs_update_projection_matrix":return this.mNeedsUpdateProjectionMatrix;default:return Pt(t,"proxyGetValue",this,3)([e])}}},{key:"getGarbageHash",value:function(){return this.getType().getTypeName()}},{key:"serialize",value:function(e){var n=Object.assign(Pt(t,"serialize",this,3)([e]),{type:"camera_perspective"});return n.properties=Object.assign(n.properties,{fov:this.mFov,pipeline:this.mPipeline,tonemapping_type:this.mToneMappingType,tonemapping_exposure:this.mToneMappingExposure,tonemapping_whitepoint:this.mToneMappingWhitePoint}),n}},{key:"getProjectionMatrix",value:function(){var e=R.K.renderer().getRenderEngine().getCanvas(),t=this.mNear,n=e.width/e.height,r=t*Math.tan(.5*_.up*this.mFov)/1,i=2*r,a=n*i,o=-.5*a;return(new ie.k).makePerspective(o,o+a,r,r-i,t,this.mFar)}},{key:"fov",get:function(){return this.mFov},set:function(e){this.mFov=e}},{key:"updatePositionByAutoFocus",value:function(e){if(e===me.NONE)return!0;var t=R.K.renderer().getRenderEngine().getSceneBoundingBox();if(t.isEmpty())return!1;var n=new te.P,r=new te.P;t.getCenter(n),t.getSize(r);var i=r.x>r.z?r.x:r.z,a=r.z>r.y?r.z:r.y,o=r.x>r.y?r.x:r.y,s=a/2/Math.tan(Math.PI*this.fov/360),u=i/2/Math.tan(Math.PI*this.fov/360),c=o/2/Math.tan(Math.PI*this.fov/360),l=n.clone();switch(e){case me.BACK:l.add(new te.P(0,.5*r.y,-1.5*c));break;case me.LEFT:l.add(new te.P(-1.5*s,.5*r.y,0));break;case me.RIGHT:l.add(new te.P(1.5*s,.5*r.y,0));break;case me.TOP:l.add(new te.P(0,1.5*u,0));break;case me.BOTTOM:l.add(new te.P(0,-1.5*u,0));break;case me.FRONT:default:l.add(new te.P(0,.5*r.y,1.5*c))}return this.transform.position.copy(l),this.target.copy(n),this.updateMatrixLocal(),this.updateMatrixWorld(),this.mAutoFocusNeedsUpdate=!1,!0}}])}(We);(0,c.A)(Bt,"TypeRTTI",new le.O("CameraEntityPerspective",We.TypeRTTI));var Ft=__webpack_require__(22098);function Nt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Nt=function(){return!!e})()}function Lt(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var jt=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,Nt()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mColor",Ft.v.White()),(0,c.A)(n,"mIntensity",1),(0,c.A)(n,"mShadowBias",0),(0,c.A)(n,"mShadowCameraNear",.1),(0,c.A)(n,"mShadowCameraFar",500),n.mName="LightEntity",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getLightTechnique",value:function(){return this.lightTechnique}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"color":case"light_color":return this.mColor.set(n),!0;case"intensity":case"light_intensity":return this.mIntensity=n,!0;case"shadow_bias":return this.mShadowBias=n,!0;case"shadow_camera_near":return this.mShadowCameraNear=n,!0;case"shadow_camera_far":return this.mShadowCameraFar=n,!0}return Lt(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Lt(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"color":case"light_color":return this.mColor;case"intensity":case"light_intensity":return this.mIntensity;case"shadow_bias":return this.mShadowBias;case"shadow_camera_near":return this.mShadowCameraNear;case"shadow_camera_far":return this.mShadowCameraFar}return null}},{key:"onDraw",value:function(e,n){Lt(t,"onDraw",this,3)([e,n]),e.addLight(this)}},{key:"serialize",value:function(e){var n=Lt(t,"serialize",this,3)([e]);return n.properties=Object.assign(n.properties,{light_color:this.mColor.getHexString(),light_intensity:this.mIntensity,shadow_bias:this.mShadowBias,shadow_camera_near:this.mShadowCameraNear,shadow_camera_far:this.mShadowCameraFar}),n}},{key:"color",get:function(){return this.mColor},set:function(e){this.mColor.copy(e)}},{key:"intensity",get:function(){return this.mIntensity},set:function(e){this.mIntensity=e}},{key:"shadowBias",get:function(){return this.mShadowBias},set:function(e){this.mShadowBias=e}},{key:"shadowCameraNear",get:function(){return this.mShadowCameraNear},set:function(e){this.mShadowCameraNear=e}},{key:"shadowCameraFar",get:function(){return this.mShadowCameraFar},set:function(e){this.mShadowCameraFar=e}}])}(ce.S);function Ut(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ut=function(){return!!e})()}(0,c.A)(jt,"TypeRTTI",new le.O("LightEntity",ce.S.TypeRTTI));var Vt=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,Ut()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"lightTechnique",Ot.UP.ambient),n.mName="LightEntityAmbient",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,se.A)((0,oe.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"ambientLight"});var n,r,i,a,o}}])}(jt);function zt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zt=function(){return!!e})()}function Ht(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Vt,"TypeRTTI",new le.O("LightEntityAmbient",jt.TypeRTTI));var Gt=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,zt()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"lightTechnique",Ot.UP.directional),(0,c.A)(n,"mTarget",te.P.Zero()),(0,c.A)(n,"mSubscriptions",[]),n.mName="LightEntityDirectional",n.mSubscriptions.push(n.mTarget.onChange.subscribe((function(){n.markNeedsRenderUpdate()}))),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"target":return this.mTarget.copy(n),!0;case"target_x":return this.mTarget.x=parseFloat(n),!0;case"target_y":return this.mTarget.y=parseFloat(n),!0;case"target_z":return this.mTarget.z=parseFloat(n),!0}return Ht(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Ht(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"target":return this.mTarget;case"target_x":return this.mTarget.x;case"target_y":return this.mTarget.y;case"target_z":return this.mTarget.z}return null}},{key:"serialize",value:function(e){var n=Object.assign(Ht(t,"serialize",this,3)([e]),{type:"directionalLight"});return n.properties=Object.assign(n.properties,{target_x:this.mTarget.x,target_y:this.mTarget.y,target_z:this.mTarget.z}),n}},{key:"getGarbageHash",value:function(){return"".concat(this.getType().getTypeName(),"/").concat(this.mCastShadow)}},{key:"getGarbageTime",value:function(){return 500}},{key:"destroy",value:function(e,n){Ht(t,"destroy",this,3)([e,n]),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"target",get:function(){return this.mTarget},set:function(e){this.mTarget.copy(e),this.markNeedsRenderUpdate()}}])}(jt);function qt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qt=function(){return!!e})()}function Wt(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Gt,"TypeRTTI",new le.O("LightEntityDirectional",jt.TypeRTTI));var Kt=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,qt()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"lightTechnique",Ot.UP.hemisphere),(0,c.A)(n,"mGroundColor",Ft.v.White()),n.mName="LightEntityHemisphere",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){return"light_groundColor"===e?(this.mGroundColor.set(n),!0):Wt(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Wt(t,"proxyGetValue",this,3)([e]);return null!==n?n:"light_groundColor"===e?this.mGroundColor:null}},{key:"serialize",value:function(e){var n=Object.assign(Wt(t,"serialize",this,3)([e]),{type:"hemisphereLight"});return n.properties=Object.assign(n.properties,{light_groundColor:this.mGroundColor.getHexString()}),n}},{key:"groundColor",get:function(){return this.mGroundColor},set:function(e){this.mGroundColor.copy(e)}}])}(jt);function Xt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xt=function(){return!!e})()}function Yt(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Kt,"TypeRTTI",new le.O("LightEntityHemisphere",jt.TypeRTTI));var $t=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,Xt()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"lightTechnique",Ot.UP.point),(0,c.A)(n,"mDistance",0),(0,c.A)(n,"mDecay",1),n.mName="LightEntityPoint",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"light_distance":return this.mDistance=parseFloat(n),!0;case"light_decay":return this.mDecay=parseFloat(n),!0}return Yt(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Yt(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"light_distance":case"radius":return this.mDistance;case"light_decay":return this.mDecay}return null}},{key:"serialize",value:function(e){var n=Object.assign(Yt(t,"serialize",this,3)([e]),{type:"pointLight"});return n.properties=Object.assign(n.properties,{light_distance:this.mDistance,light_decay:this.mDecay}),n}},{key:"getGarbageHash",value:function(){return"".concat(this.getType().getTypeName(),"/").concat(this.mCastShadow)}},{key:"getGarbageTime",value:function(){return 500}},{key:"distance",get:function(){return this.mDistance},set:function(e){this.mDistance=e}},{key:"decay",get:function(){return this.mDecay},set:function(e){this.mDecay=e}}])}(jt);function Zt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zt=function(){return!!e})()}function Qt(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)($t,"TypeRTTI",new le.O("LightEntityPoint",jt.TypeRTTI));var Jt=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,Zt()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"lightTechnique",Ot.UP.spot),(0,c.A)(n,"mDistance",0),(0,c.A)(n,"mAngle",.1*Math.PI),(0,c.A)(n,"mPenumbra",0),(0,c.A)(n,"mDecay",1),(0,c.A)(n,"mTarget",te.P.Zero()),n.mName="LightEntitySpot",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"light_distance":return this.mDistance=parseFloat(n),!0;case"light_angle":return this.mAngle=parseFloat(n),!0;case"light_penumbra":return this.mPenumbra=parseFloat(n),!0;case"light_decay":return this.mDecay=parseFloat(n),!0;case"target":return this.mTarget.copy(n),!0;case"target_x":return this.mTarget.x=parseFloat(n),!0;case"target_y":return this.mTarget.y=parseFloat(n),!0;case"target_z":return this.mTarget.z=parseFloat(n),!0}return Qt(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Qt(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"light_distance":case"distance":return this.mDistance;case"light_angle":return this.mAngle;case"radius":return.5*((Number.isFinite(this.mDistance)&&this.mDistance>0?this.mDistance:1e3)*Math.tan(this.mAngle));case"light_penumbra":return this.mPenumbra;case"light_decay":return this.mDecay;case"target":return this.mTarget;case"target_x":return this.mTarget.x;case"target_y":return this.mTarget.y;case"target_z":return this.mTarget.z}return null}},{key:"serialize",value:function(e){var n=Object.assign(Qt(t,"serialize",this,3)([e]),{type:"spotLight"});return n.properties=Object.assign(n.properties,{light_distance:this.mDistance,light_angle:this.mAngle,light_penumbra:this.mPenumbra,light_decay:this.mDecay,target_x:this.mTarget.x,target_y:this.mTarget.y,target_z:this.mTarget.z}),n}},{key:"getGarbageHash",value:function(){return"".concat(this.getType().getTypeName(),"/").concat(this.mCastShadow)}},{key:"getGarbageTime",value:function(){return 500}},{key:"distance",get:function(){return this.mDistance},set:function(e){this.mDistance=e}},{key:"angle",get:function(){return this.mAngle},set:function(e){this.mAngle=e}},{key:"decay",get:function(){return this.mDecay},set:function(e){this.mDecay=e}},{key:"penumbra",get:function(){return this.mPenumbra},set:function(e){this.mPenumbra=Math.min(1,Math.max(0,e))}},{key:"target",get:function(){return this.mTarget},set:function(e){this.mTarget.copy(e)}}])}(jt);(0,c.A)(Jt,"TypeRTTI",new le.O("LightEntitySpot",jt.TypeRTTI));var en=__webpack_require__(47185),tn=__webpack_require__(62112),nn=__webpack_require__(94051),rn=__webpack_require__(81226);function an(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var on=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),null,[{key:"convertToPbr",value:function(e){var t,n=this.getDefaultPBRMaterial();if(n.id=e.id,n.uuid=e.uuid,n.name=e.name,n.alpha_test=e.alpha_test,n.blending=e.blending,n.transparency_mode=e.transparency_mode,n.depth_test=e.depth_test,n.depth_write=e.depth_write,n.depth_pre_pass=e.depth_pre_pass,n.separate_culling_pass=e.separate_culling_pass,n.fog=e.fog,n.lights=e.lights,n.opacity=e.opacity,n.premultiplied_alpha=e.premultiplied_alpha,n.shading=e.shading,n.side=e.side,n.transparent=e.transparent,n.ssrl=e.ssrl,n.render_order=Math.min(Ot.L_.MAX_RENDERINGGROUPS,e.render_order),n.render_layer=null!==(t=e.render_layer)&&void 0!==t?t:(new rn.z).enableAll().mask,n.camera_layer=e.camera_layer,n.resource_folder_id=e.resource_folder_id,n.properties_id=e.properties_id,n.force_shared=e.force_shared,"MeshBasicMaterial"===e.type||"MeshLambertMaterial"===e.type||"MeshPhongMaterial"===e.type||"MeshPhongMaterialExt"===e.type||"MeshToonMaterial"===e.type){var r=e;n.alpha_map=r.alpha_map,n.ao_map=r.ao_map,n.ao_map_intensity=r.ao_map_intensity,n.diffuse_color=r.color,n.environment_brdf_map=r.env_map,n.light_map=r.light_map,n.light_map_intensity=r.light_map_intensity,n.diffuse_map=r.map,n.sub_surface_configuration.index_of_refraction=r.refraction_ratio,n.specular_map=r.specular_map,n.use_specular_glossiness_workflow=!0}if("MeshLambertMaterial"===e.type){var i=e;n.emissive_color=i.emissive,n.emissive_map=i.emissive_map,n.emissive_intensity=i.emissive_map_intensity}if(e.type,"MeshStandardMaterial"===e.type||"MeshPhysicalMaterial"===e.type||"MeshPhysicalMaterialExt"===e.type){var a=e;n.alpha_map=a.alpha_map,n.ao_map=a.ao_map,n.ao_map_intensity=a.ao_map_intensity,n.diffuse_color=a.color,n.environment_brdf_map=a.env_map,n.environment_intensity=a.env_map_intensity,n.light_map=a.light_map,n.light_map_intensity=a.light_map_intensity,n.diffuse_map=a.map,n.sub_surface_configuration.index_of_refraction=a.refraction_ratio,n.emissive_color=a.emissive,n.emissive_map=a.emissive_map,n.emissive_intensity=a.emissive_map_intensity,void 0!==a.normal_map||null!==a.normal_map?(n.normal_map=a.normal_map,n.normal_map_scale=a.normal_scale):void 0===a.bump_map&&null===a.bump_map||(n.normal_map=a.bump_map,n.normal_map_scale=a.bump_scale),n.metalness=a.metalness,n.metalness_map=a.metalness_map,n.roughness=a.roughness,!a.metalness_map&&a.roughness_map&&(n.metalness_map=a.roughness_map),n.use_specular_glossiness_workflow=!1}if("MeshPhongMaterial"===e.type||"MeshPhongMaterialExt"===e.type){var o=e;n.emissive_color=o.emissive,n.emissive_map=o.emissive_map,n.emissive_intensity=o.emissive_map_intensity,void 0!==o.normal_map||null!==o.normal_map?(n.normal_map=o.normal_map,n.normal_map_scale=o.normal_scale):void 0===o.bump_map&&null===o.bump_map||(n.normal_map=o.bump_map,n.normal_map_scale=o.bump_scale),n.specular_color=o.specular}if("MeshPhongMaterialExt"===e.type){var s=e;n.environment_brdf_map_scale=s.env_map_scale}if("MeshPhysicalMaterial"===e.type||"MeshPhysicalMaterialExt"===e.type){var u=e;n.clear_coat_configuration.is_enabled=!0,n.clear_coat_configuration.intensity=u.clear_coat,n.clear_coat_configuration.roughness=u.clear_coat_roughness}if("MeshPhysicalMaterialExt"===e.type){var c=e;n.use_specular_glossiness_workflow=c.enable_specular_glossiness,n.specular_color=c.specular,n.specular_map=c.specular_map,n.micro_surface=c.glossiness,n.micro_surface_map=c.glossiness_map}return n}},{key:"getDefaultPBRMaterial",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?an(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):an(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({id:-1,uuid:"",name:"",type:"PbrMaterial",alpha_test:.4,blending:"NormalBlending",transparency_mode:"Opaque",depth_test:!0,depth_write:!0,depth_pre_pass:!1,separate_culling_pass:!1,fog:!1,lights:!0,opacity:1,premultiplied_alpha:!1,shading:"SmoothShading",side:"FrontSide",transparent:!1,ssrl:0},this.getDefaultPBRMaterialProperties())}},{key:"getDefaultPBRMaterialProperties",value:function(){return{diffuse_color:Ft.v.White().getHex(),diffuse_map:null,use_alpha_from_diffuse_map:!1,alpha_map:null,normal_map:null,normal_map_scale:1,ambient_color:Ft.v.Black().getHex(),ao_map:null,ao_map_intensity:1,ao_map_impact_on_analytical_lights:0,direct_light_intensity:1,emissive_color:Ft.v.Black().getHex(),emissive_intensity:1,emissive_map:null,environment_intensity:1,environment_brdf_map:null,environment_brdf_map_scale:1,light_map:null,light_map_intensity:1,parallax_scale_bias:.05,reflection_color:Ft.v.White().getHex(),reflection_map:null,specular_color:Ft.v.White().getHex(),specular_map:null,specular_intensity:1,two_sided_lighting:!1,unlit:!1,reflectance_map:null,micro_surface:1,micro_surface_map:null,roughness:1,metalness:0,metalness_f0_factor:1,metalness_map:null,metallic_reflectance_color:Ft.v.White().getHex(),metallic_reflectance_map:null,use_specular_glossiness_workflow:!1,brdf_configuration:this.getDefaultPBRMaterialBRDFConfiguration(),detail_map_configuration:this.getDefaultPBRMaterialDetailMapConfiguration(),clear_coat_configuration:this.getDefaultPBRMaterialClearCoatConfiguration(),sheen_configuration:this.getDefaultPBRMaterialSheenConfiguration(),anisotropic_configuration:this.getDefaultPBRMaterialAnisotropicConfiguration(),sub_surface_configuration:this.getDefaultPBRMaterialSubSurfaceConfiguration(),iridescence_configuration:this.getDefaultPBRMaterialIridescenceConfiguration(),flags:this.getDefaultPBRMaterialFlagsConfiguration()}}},{key:"getDefaultPBRMaterialBRDFConfiguration",value:function(){return{use_energy_conservation:!0,specular_glossiness_input_energy_conservation:!0}}},{key:"getDefaultPBRMaterialDetailMapConfiguration",value:function(){return{is_enabled:!1,map:null,diffuse_blend_level:1,roughness_blend_level:1,bump_level:1,normal_blend_method:0}}},{key:"getDefaultPBRMaterialClearCoatConfiguration",value:function(){return{is_enabled:!1,intensity:1,roughness:0,index_of_refraction:1.5,map:null,use_roughness_from_main_map:!0,roughness_map:null,remap_f0_on_interface_change:!0,bump_map:null,is_tint_enabled:!1,tint_color:Ft.v.White().getHex(),tint_color_at_distance:1,tint_thickness:1,tint_map:null}}},{key:"getDefaultPBRMaterialSheenConfiguration",value:function(){return{is_enabled:!1,link_sheen_with_diffuse:!1,intensity:1,color:Ft.v.White().getHex(),map:null,use_roughness_from_main_map:!0,roughness:null,roughness_map:null,diffuse_scaling:!1}}},{key:"getDefaultPBRMaterialAnisotropicConfiguration",value:function(){return{is_enabled:!1,intensity:1,direction_x:1,direction_y:0,map:null}}},{key:"getDefaultPBRMaterialSubSurfaceConfiguration",value:function(){return{is_refraction_enabled:!1,is_translucency_enabled:!1,is_scattering_enabled:!1,scattering_diffusion_profile:null,refraction_intensity:1,translucency_intensity:1,use_diffuse_to_tint_refraction:!1,use_diffuse_to_tint_translucency:!1,thickness_map:null,index_of_refraction:1.5,volume_index_of_refraction:-1,link_refraction_with_transparency:!1,minimum_thickness:0,maximum_thickness:1,use_thickness_as_depth:!1,tint_color:Ft.v.White().getHex(),tint_color_at_distance:1,diffusion_distance:Ft.v.White().getHex(),use_mask_from_thickness_map:!1,translucency_intensity_map:null}}},{key:"getDefaultPBRMaterialIridescenceConfiguration",value:function(){return{is_enabled:!1,intensity:1,minimum_thickness:100,maximum_thickness:400,index_of_refraction:1.3,map:null,thickness_map:null}}},{key:"getDefaultPBRMaterialFlagsConfiguration",value:function(){return{use_alpha_fresnel:!1,use_alpha_from_diffuse_map:!1,use_ambient_in_gray_scale:!1,use_ambient_occlusion_from_metallic_map_red:!1,use_auto_micro_surface_from_reflectivity_map:!1,use_lightmap_as_shadowmap:!1,use_linear_alpha_fresnel:!1,use_metalness_from_metallic_map_blue:!1,use_micro_surface_from_reflectivity_map_alpha:!1,use_parallax:!1,use_parallax_occlusion:!1,use_horizon_occlusion:!0,use_radiance_occlusion:!0,use_radiance_over_alpha:!0,use_roughness_from_metallic_map_alpha:!0,use_roughness_from_metallic_map_green:!1,use_specular_anti_aliasing:!0,use_specular_over_alpha:!0,invert_normal_map_x:!1,invert_normal_map_y:!1,use_only_metallic_from_metallic_reflectance_map:!1,use_physical_light_falloff:!0}}}])}(),sn=(__webpack_require__(26910),__webpack_require__(5506),__webpack_require__(42762),__webpack_require__(45650)),un=__webpack_require__(13288),cn=__webpack_require__(81160),ln=__webpack_require__(15964),hn=__webpack_require__(56315);var fn=__webpack_require__(61209);function mn(e,t,n){return void 0===n&&(n=1/0),(0,fn.T)(t)?mn((function(n,r){return(0,cn.T)((function(e,i){return t(n,e,r,i)}))((0,ln.Tg)(e(n,r)))}),n):("number"==typeof t&&(n=t),(0,x.N)((function(t,r){return function(e,t,n,r,i,a,o,s){var u=[],c=0,l=0,h=!1,f=function(){!h||u.length||c||t.complete()},m=function(e){return c<r?p(e):u.push(e)},p=function(e){a&&t.next(e),c++;var s=!1;(0,ln.Tg)(n(e,l++)).subscribe((0,S._)(t,(function(e){null==i||i(e),a?m(e):t.next(e)}),(function(){s=!0}),void 0,(function(){if(s)try{c--;for(var e=function(){var e=u.shift();o?(0,hn.N)(t,o,(function(){return p(e)})):p(e)};u.length&&c<r;)e();f()}catch(e){t.error(e)}})))};return e.subscribe((0,S._)(t,m,(function(){h=!0,f()}))),function(){null==s||s()}}(t,r,e,n)})))}var pn=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mProductAttributeManager",void 0),this.mProductAttributeManager=t}),[{key:"onAttributeChanged",get:function(){return this.mProductAttributeManager.onAttributeChanged}},{key:"onAttributeUpdated",get:function(){return this.mProductAttributeManager.onAttributeUpdated}},{key:"getProduct",value:function(){return this.mProductAttributeManager._getProduct()}},{key:"onAttributeModerated",get:function(){return this.mProductAttributeManager.onAttributeModerated}},{key:"getMaterialGroupManager",value:function(){return this.mProductAttributeManager._getMaterialGroupManager()}},{key:"hasAttribute",value:function(e){this.mProductAttributeManager._hasAttribute(e)}},{key:"getRawAttributes",value:function(){return this.mProductAttributeManager._getRawAttributes()}},{key:"getAttributes",value:function(){return this.mProductAttributeManager._getAttributes()}},{key:"cloneAttributes",value:function(){return this.mProductAttributeManager._cloneAttributes()}},{key:"getAttribute",value:function(e){return this.mProductAttributeManager._getAttribute(e)}},{key:"getAttributeByName",value:function(e){return this.mProductAttributeManager._getAttributeByName(e)}},{key:"getAttributeControllers",value:function(){return this.mProductAttributeManager._getAttributeControllers()}},{key:"getAttributeController",value:function(e){return this.mProductAttributeManager._getAttributeController(e)}},{key:"getAttributeControllerByName",value:function(e){return this.mProductAttributeManager._getAttributeControllerByName(e)}},{key:"setValue",value:(t=(0,n.A)(i().mark((function e(t,n,r){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mProductAttributeManager._setValue(t,n,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"getValue",value:function(e){return this.mProductAttributeManager._getValue(e)}},{key:"getValueName",value:function(e){return this.mProductAttributeManager._getValueName(e)}},{key:"resetValue",value:function(e,t){this.mProductAttributeManager._resetValue(e,t)}},{key:"setValueByName",value:(e=(0,n.A)(i().mark((function e(t,n,r){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mProductAttributeManager._setValueByName(t,n,r);case 2:case"end":return e.stop()}}),e,this)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"getValueByName",value:function(e){return this.mProductAttributeManager._getValueByName(e)}},{key:"setValueByKey",value:function(e,t,n){this.mProductAttributeManager._setValueByKey(e,t,n)}},{key:"getValueByKey",value:function(e){return this.mProductAttributeManager._getValueByKey(e)}},{key:"getValueNameByName",value:function(e){return this.mProductAttributeManager._getValueNameByName(e)}},{key:"resetValueByName",value:function(e,t){this.mProductAttributeManager._resetValueByName(e,t)}},{key:"resetAllValues",value:function(e){return this.mProductAttributeManager._resetAllValues(e)}},{key:"setVisibility",value:function(e,t,n){this.mProductAttributeManager._setVisibility(e,t,n)}},{key:"setVisibilityByName",value:function(e,t,n){this.mProductAttributeManager._setVisibilityByName(e,t,n)}},{key:"isVisible",value:function(e,t){return this.mProductAttributeManager._isVisible(e,t)}},{key:"buildQueryParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.mProductAttributeManager._buildQueryParams(e,t)}},{key:"serialize",value:function(e){return this.mProductAttributeManager._serialize(e)}},{key:"parse",value:function(e,t){this.mProductAttributeManager._parse(e,t)}},{key:"hashConfiguration",value:function(){return this.mProductAttributeManager._hashConfiguration()}}]);var e,t}(),dn=(__webpack_require__(59149),__webpack_require__(97869));function vn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vn=function(){return!!e})()}var yn=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,vn()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mAttributeData",void 0),(0,c.A)(r,"mAttributeManagerComp",void 0),(0,c.A)(r,"middleware",null),r.mAttributeData=e,r.mAttributeManagerComp=n,Array.isArray(r.mAttributeData.attribute_values)||(r.mAttributeData.attribute_values=[]),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"destroy",value:function(){}},{key:"getAttributeType",value:function(){return this.mAttributeData.type}},{key:"resolveProductNode",value:function(){return this.mAttributeManagerComp.getParentObject()}},{key:"broadcastValueChange",value:function(e,t,n,r){var i,a,o=this.mAttributeManagerComp,s=this.resolveProductNode(),u=s.getValue("product_id"),c=s.getSceneObjectId(),l=s.getValue("object_uuid"),h=this.getAttribute();o.onAttributeChanged.next({attribute_type:this.getAttributeType(),attribute_id:h.id,attribute_name:h.name,attribute_key:null!==(i=h.key)&&void 0!==i?i:null,attribute_value_id:e,attribute_value:t,attribute_value_name:this.getValueName(),attribute_value_key:null!==(a=this.getValueKey())&&void 0!==a?a:null,attribute_slug:h.slug,rebuild:n,product_id:u,product_scene_id:c,product_uuid:l,user_data:r})}},{key:"broadcastAttributeUpdated",value:function(){this.mAttributeManagerComp.onAttributeUpdated.next({attribute:this.getAttribute(),attribute_id:this.mAttributeData.id,attribute_type:this.getAttributeType()})}},{key:"broadcastAttributeModerated",value:function(e){var t=this.mAttributeManagerComp,n=this.resolveProductNode(),r=n.getValue("product_id"),i=n.getSceneObjectId(),a=n.getValue("object_uuid");t.onAttributeModerated.next({attribute:this.getAttribute(),attribute_id:this.mAttributeData.id,attribute_type:this.getAttributeType(),product_id:r,product_scene_id:i,product_uuid:a,moderate_data:e})}},{key:"_getDefaultSetOptions",value:function(e){return Object.assign({emitEvent:!0,rebuild:!0},e||{})}},{key:"visibleOnFrame",get:function(){return!1!==this.mAttributeData.visible_on_frame}},{key:"setVisibility",value:function(e,t){this.mAttributeData.visible=!!this.visibleOnFrame&&e}},{key:"isVisible",value:function(e){return!!this.visibleOnFrame&&("boolean"==typeof this.mAttributeData.visible?this.mAttributeData.visible:0!==this.mAttributeData.visibility&&!1!==this.mAttributeData.visibility)}},{key:"isVisibleInQuote",value:function(){return!!this.visibleOnFrame&&2!==this.mAttributeData.visibility}},{key:"serialize",value:function(e){if(!(!0!==e.discard_hidden||this.isVisible()&&this.isVisibleInQuote()))return null;var t=this.getAttribute(),n={attribute_id:t.id,attribute_name:t.name,attribute_value:this.getValue(),attribute_value_name:this.getValueName()};return e.include_keys&&(n.attribute_value_key=this.getValueKey(),n.attribute_key=t.key),n}},{key:"compareValue",value:function(e){return e===this.getValueName()}},{key:"registerMiddleware",value:function(e){this.middleware?this.middleware.setNext(e):this.middleware=e}},{key:"setNextValue",value:(r=(0,n.A)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.middleware){e.next=4;break}return e.next=3,this.middleware.execute(t);case 3:t=e.sent;case 4:return e.abrupt("return",this.setValue(t,n));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getValueKey",value:function(){}},{key:"getQueryParam",value:function(){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&!this.isVisible()?{}:!0===e?(0,c.A)({},this.mAttributeData.id,this.getValueName()):{}}},{key:"broadcast",value:function(e){var t=this._getDefaultSetOptions(e);t.emitEvent&&this.broadcastValueChange(this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.getValue(),t.rebuild,t.userData)}},{key:"onMaterialUpdated",value:function(e){}},{key:"getMiddleware",value:function(){return this.middleware}}]);var r}(dn.p);function gn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gn=function(){return!!e})()}function bn(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(yn,"TypeRTTI",new le.O("AttributeController",dn.p.TypeRTTI));var An=function(e){function t(e,n){var r,i,a,o;(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,gn()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mValueMutations",{}),(0,c.A)(r,"mValue",{value:""});var u=r.resolveValuable();if(u){Array.isArray(u.colors)||(u.colors=[]);var l=u.colors.findIndex((function(e){return!0===e.default}));l>=0&&r.setValue(u.colors[l].color)}return r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){var e=this,t=this.resolveValuable();t&&t.colors.forEach((function(t){var n=e.resolveValueMutation(t.color);t.visible=n.visible})),this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){this.mValue.value=e,this.dispatchToRenderer(t).then((function(){}),(function(e){v.UX.error(e)})),this.updateValues(),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){var e=this,t=this.mValue.value,n=this.resolveValuable();if(n){n.colors=n.colors||[];var r=n.colors.find((function(t){return t.color===e.mValue.value}));r&&(t=r.name)}return t}},{key:"resetValue",value:function(e){this.mValue.value="",this.broadcast(e)}},{key:"resolveValuable",value:function(){if(this.mAttributeData&&this.mAttributeData.attribute_values.length>0)return this.mAttributeData.attribute_values[0].attribute_value_valuable}},{key:"parse",value:function(e,t){e&&(0,h.Kg)(e.value)&&this.setValue(e.value,t)}},{key:"setVisibility",value:function(e,n){if(!this.visibleOnFrame)return bn(t,"setVisibility",this,3)([!1]);if(n&&null!==n.color&&void 0!==n.color){var r=this.resolveValueMutation(n.color);r&&(r.visible=e)}else bn(t,"setVisibility",this,3)([e,n])}},{key:"resolveValueMutation",value:function(e){if(null!=e){if(!this.mValueMutations[e]){var t=this.mAttributeData.attribute_values[0].attribute_value_valuable.colors.find((function(t){return t.color===e}));t&&(this.mValueMutations[e]={visible:t.visible})}return this.mValueMutations[e]}}},{key:"dispatchToRenderer",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:Number.isSafeInteger(n.material_group_id)?(r=this.mAttributeManagerComp._getMaterialGroupManager(),a=(0,h.uI)(this.mValue.value)?this.mValue.value.substring(0,7):"",o=this.resolveProductNode(),r.setColorOverwrite(n.material_group_id,a,o.getSceneObjectId())):Number.isSafeInteger(n.material_id)&&(s=this.resolveProductNode(),u=en.J.getManager(en.n.MaterialManager),c=(0,h.uI)(this.mValue.value)?this.mValue.value.substring(0,7):"",l=Number(n.material_id),u.setColorOverwrite(l,c,s.getSceneObjectId()));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]);var r}(yn);(0,c.A)(An,"TypeRTTI",new le.O("AttributeColorController",yn.TypeRTTI));var _n=__webpack_require__(41877),Mn=__webpack_require__.n(_n);function kn(e,t){var n=new(Mn())(e);return n.success?n.to(null!=t?t:"hex"):null}function wn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wn=function(){return!!e})()}var Tn=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,wn()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mValue",{value:"",output:""}),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){var n;this.mValue.value=e,this.mValue.output=null!==(n=kn(e,this.mAttributeData.meta.output_color_format))&&void 0!==n?n:"",this.dispatchToRenderer(t).then((function(){}),(function(e){v.UX.error(e)})),this.updateValues(),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){return this.mValue.value}},{key:"resetValue",value:function(e){this.mValue.value="",this.broadcast(e)}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"parse",value:function(e,t){null!=e&&void 0!==e.value&&this.setValue(e.value,t)}},{key:"dispatchToRenderer",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:if(Number.isSafeInteger(r.material_id)){e.next=5;break}return e.abrupt("return");case 5:a=this.resolveProductNode(),o=en.J.getManager(en.n.MaterialManager),s=null!==(n=kn(this.mValue.value,"hex"))&&void 0!==n?n:"#FFFFFF",o.setColorOverwrite(r.material_id,s,a.getSceneObjectId());case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]);var r}(yn);(0,c.A)(Tn,"TypeRTTI",new le.O("AttributeColorPickerController",yn.TypeRTTI));__webpack_require__(9868),__webpack_require__(71761);var xn=__webpack_require__(37968),Sn=(__webpack_require__(48718),function(){function e(){(0,s.A)(this,e)}return(0,u.A)(e,null,[{key:"Arctangent",value:function(e,t,n,r){var i=r-t,a=n-e,o=Math.atan2(i,a);return(o*=180/Math.PI)<0&&(o=360+o),o}},{key:"AngleTwoLines",value:function(e,t,n,r,i,a){var o=e-n,s=t-r,u=i-n,c=a-n,l=o*u+s*c,h=Math.sqrt(o*o+s*s)*Math.sqrt(u*u+c*c);return Math.acos(l/h)}},{key:"AngleOfTwoPoints",value:function(e,t,n,r){var i=n-e,a=r-t;return-Math.atan2(a,i)}},{key:"Clamp",value:function(e,t,n,r){return h.N5.isNumeric(e)?e>n?n:e<t?t:e:r}},{key:"RotateBasedOnUpAxis",value:function(t,n){var r=new te.P(0,1,0).applyQuaternion(t),i=n.dot(r);if(Math.abs(i)>1-e.EPS)return t;var a=Math.acos(i),o=r.cross(n).normalize();return(new ne.P).setFromAxisAngle(o,a).multiply(t)}},{key:"Vec2Cross",value:function(e,t){return e.x*t.y-e.y*t.x}},{key:"LineLineIntersection",value:function(e,t,n,r){var i=t.clone().sub(e),a=r.clone().sub(n),o=this.Vec2Cross(n.clone().sub(e),i),s=this.Vec2Cross(i,a);if(0==o&&0==s)return!!(e.equals(n)||e.equals(r)||t.equals(n)||t.equals(r))||!(n.x-e.x<0&&n.x-t.x<0&&r.x-e.x<0&&r.x-t.x<0&&n.y-e.y<0&&n.y-t.y<0&&r.y-e.y<0&&r.y-t.y<0);if(s===this.EPS)return!1;var u=o/s,c=this.Vec2Cross(n.clone().sub(e),a)/s;return c>=0&&c<=1&&u>=0&&u<=1}}])}());(0,c.A)(Sn,"EPS",1e-6);var Cn=__webpack_require__(28689),En=__webpack_require__(29928),Rn=__webpack_require__(28288),In=__webpack_require__(55178),On=__webpack_require__(14933),Dn=__webpack_require__(15307),Pn=function(){function e(t){(0,s.A)(this,e),(0,c.A)(this,"mImageSource",null),(0,c.A)(this,"mDefaultTexture",null),(0,c.A)(this,"mDefaultTextureSet",!1),(0,c.A)(this,"mDefaultTextureAssigned",!0),(0,c.A)(this,"mImageRepeatType",void 0),(0,c.A)(this,"mImageSizeType",void 0),(0,c.A)(this,"mImageWidth",0),(0,c.A)(this,"mImageHeight",0),(0,c.A)(this,"mMaterialManager",void 0),(0,c.A)(this,"mActiveMaterial",void 0),(0,c.A)(this,"mTextureCanvas",void 0),this.mMaterialManager=t}return(0,u.A)(e,[{key:"update",value:(a=(0,n.A)(i().mark((function e(t,n,r){var a,s,u,c,l,h,f,m,p,d,v,y,g,b=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,u=!1,c=[],l=r?r.getSceneObjectId():void 0,this.mActiveMaterial&&this.mActiveMaterial.handle&&-1!==this.mActiveMaterial.id&&this.mActiveMaterial.id!==t.material_id?(h=this.mActiveMaterial.handle,c.push(new Promise((function(e){b.mMaterialManager.resolveResource(h,(function(t){e(t)})).then((function(){}),(function(){e(null)}))})))):c.push(Promise.resolve(null)),this.mActiveMaterial={id:t.material_id,handle:this.mMaterialManager.makeResource(t.material_id,void 0,l)},c.push(new Promise((function(e){b.mMaterialManager.resolveResource(b.mActiveMaterial.handle,(function(t){e(t)})).then((function(){}),(function(){e(null)}))}))),e.next=9,Promise.all(c);case 9:if(f=e.sent,m=(0,o.A)(f,1),p=m[0],a=f[1],p&&(this.hasDiffuseMap(p)&&(s=p.getDiffuseMap(),p.setDiffuseMap(this.mDefaultTexture)),p.markDirty(),this.mDefaultTextureSet=!1,this.mDefaultTextureAssigned=!0,this.mDefaultTexture=null,u=!0),a){e.next=18;break}return this.mDefaultTextureSet=!1,this.mDefaultTexture=null,this.mDefaultTextureAssigned=!0,e.abrupt("return");case 18:if(this.mDefaultTextureSet||(this.mDefaultTextureSet=!0,this.hasDiffuseMap(a)&&(this.mDefaultTexture=a.getDiffuseMap())),u&&(this.hasDiffuseMap(a)&&a.setDiffuseMap(s),a.setTransparent(!0)),s||this.hasDiffuseMap(a)&&(s=a.getDiffuseMap()),d=void 0!==n.image_source&&null!==n.image_source?n.image_source:t.image_source,v=void 0!==n.repeat_type&&null!==n.repeat_type?n.repeat_type:t.repeat_type,y=void 0!==n.size&&null!==n.size?n.size:t.size_type,d){e.next=31;break}this.hasDiffuseMap(a)&&(a.setDiffuseMap(this.mDefaultTexture),this.mDefaultTextureAssigned=!0,delete this.mTextureCanvas),s=null,this.mImageRepeatType=void 0,this.mImageSizeType=void 0,e.next=44;break;case 31:if(null!==this.mImageSource&&this.mImageSource===d&&v===this.mImageRepeatType&&y===this.mImageSizeType){e.next=44;break}return this.mImageRepeatType=v,this.mImageSizeType=y,e.next=36,this.buildTexture(t,n,a,d);case 36:g=e.sent,s=g.texture,this.mImageWidth=g.width,this.mImageHeight=g.height,this.mDefaultTextureAssigned=!1,this.hasDiffuseMap(a)&&a.setDiffuseMap(s),a.setTransparent(!0),a.getOpacity()<Sn.EPS&&a.setOpacity(1);case 44:this.mImageSource=d,this.recalculate(t,n,s,this.mImageWidth,this.mImageHeight),a.markDirty(),e.next=52;break;case 49:e.prev=49,e.t0=e.catch(0),a&&(this.hasDiffuseMap(a)&&(a.getDiffuseMap()&&this.mMaterialManager.getTextureManager().disposeTexture(a.getDiffuseMap()),a.setDiffuseMap(null)),a.setTransparent(!0),a.markDirty());case 52:case"end":return e.stop()}}),e,this,[[0,49]])}))),function(e,t,n){return a.apply(this,arguments)})},{key:"destroy",value:function(){this.mImageSource=null,this.mActiveMaterial&&this.mMaterialManager&&(this.mMaterialManager.disposeResource(this.mActiveMaterial.handle),delete this.mActiveMaterial)}},{key:"buildTexture",value:(r=(0,n.A)(i().mark((function t(n,r,a,o){var s=this;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,i){if(!a||!o)return i();var u=s.hasDiffuseMap(a)?a.getDiffuseMap():null;u&&s.mDefaultTexture&&u.getUniqueId()!==s.mDefaultTexture.getUniqueId()&&(s.mMaterialManager.getTextureManager().disposeTexture(u),u=null);var c=document.createElement("img");c.setAttribute("crossorigin","anonymous"),c.addEventListener("load",(function(){var i=document.createElement("canvas");i.setAttribute("crossorigin","anonymous"),i.style.display="none",document.body.appendChild(i);var a=void 0!==r.repeat_type&&null!==r.repeat_type?r.repeat_type:n.repeat_type,o="clamp"===a?e.TRANSPARENT_PIXELS:0;i.width=e.IMAGE_COPY_SIZE,i.height=e.IMAGE_COPY_SIZE,s.mTextureCanvas=i;var u=R.K.renderer().getRenderEngine().createTextureCanvas("image-upload:diffuse",i,!0,void 0,"clamp"===a?Cn.qC.ClampToEdge:Cn.qC.Repeat,"clamp"===a?Cn.qC.ClampToEdge:Cn.qC.Repeat,Cn.wm.Nearest,Cn.wm.Nearest,Cn.wm.None,void 0,void 0,void 0,0);u.getContext().drawImage(c,o,o,i.width-2*o,i.height-2*o),u.markDirty(),t({texture:u,width:c.width,height:c.height})})),c.addEventListener("error",(function(e){v.UX.error(e),i()})),c.src=o})));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n,i){return r.apply(this,arguments)})},{key:"recalculate",value:function(t,n,r,i,a){if(t&&n&&r){var o=t.ratio,s=void 0!==n.size&&null!==n.size?n.size:t.size_type,u=i||1,c=a||1,l=Array.isArray(n.offset)&&void 0!==n.offset[0]&&null!==n.offset[0]?n.offset[0]:t.offset_x,h=Array.isArray(n.offset)&&void 0!==n.offset[1]&&null!==n.offset[1]?n.offset[1]:t.offset_y,f=void 0!==n.rotation&&null!==n.rotation?n.rotation:t.rotation,m=void 0!==n.scale&&null!==n.scale?n.scale:t.scale,p=o,d=void 0!==n.repeat_type&&null!==n.repeat_type?n.repeat_type:t.repeat_type,v=1/e.IMAGE_COPY_SIZE,y="clamp"===d?e.TRANSPARENT_PIXELS:0,g=ee.I.One(),b=(u>c?1:u/c)/p,A=(u>c?c/u:1)/1,M=1,k=1;switch(s){case"contain":var w=1,T=1;b>A?(w=1,T=A/b):(T=1,w=b/A),M=1/w,k=1/T;break;case"cover":var x=1,S=1;b<A?(x=1,S=A/b):(S=1,x=b/A),M=1/x,k=1/S}var C=(1+v)/(1-v*(2*y));g.set(M/C/m,k/C/m);var E=new ee.I(-l,h).multiplyScalar(.01).multiply(new ee.I(M,k));r.setOffset(E),r.setCenter(new ee.I(.5,.5).sub(E)),r.setRotation(-(0,_.pu)(f)),r.setRepeat(g),r.updateMatrix(),r.markDirty()}}},{key:"hasDiffuseMap",value:function(e){return e instanceof En.k||e instanceof Rn.o||(e instanceof In._||e instanceof On.r||e instanceof Dn.r)}},{key:"applyTexturesToModel",value:(t=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c,l,h;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mActiveMaterial&&!this.mDefaultTextureAssigned&&this.mTextureCanvas){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.mMaterialManager.resolveResource(this.mActiveMaterial.handle);case 4:if(n=e.sent,this.hasDiffuseMap(n)&&(r=n.getDiffuseMap()),r){e.next=8;break}return e.abrupt("return");case 8:a=this.mTextureCanvas,(o=document.createElement("canvas")).width=a.width,o.height=a.height,o.setAttribute("crossorigin","anonymous"),o.style.display="none",document.body.appendChild(o),(s=o.getContext("2d")).resetTransform(),s.clearRect(0,0,o.width,o.height),u=a.width/r.getRepeat().x,c=a.height/r.getRepeat().y,s.translate(.5*a.width,.5*a.height),s.rotate(-r.getRotation()),s.translate(-.5*a.width,-.5*a.height),l=(new ee.I).copy(r.getOffset()).rotateAround(new ee.I,-r.getRotation()),s.drawImage(a,0,0,a.width,a.height,.5*a.width-.5*u-l.x*a.width,.5*a.height-.5*c- -l.y*a.height,u,c),h=o.toDataURL("image/png"),"PbrMaterial"===t.type?t.diffuse_map=h:t.map=h,o.width=0,o.height=0,o.remove();case 30:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]);var t,r,a}();(0,c.A)(Pn,"TRANSPARENT_PIXELS",4),(0,c.A)(Pn,"IMAGE_COPY_SIZE",1024);var Bn=__webpack_require__(17450),Fn=__webpack_require__(66847);function Nn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Nn=function(){return!!e})()}var Ln=function(e){function t(e,n){var r,i,a,u;if((0,s.A)(this,t),i=this,a=t,u=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Nn()?Reflect.construct(a,u||[],(0,oe.A)(i).constructor):a.apply(i,u)),(0,c.A)(r,"mValue",{image_source:"",offset:[0,0],ratio:1,repeat_type:"clamp",size:"contain",rotation:0,scale:1}),(0,c.A)(r,"mImageUploadController",void 0),(0,c.A)(r,"mImageUploadEvent",new M.B),Array.isArray(r.mAttributeData.attribute_values)&&r.mAttributeData.attribute_values.length>0){var l=(0,o.A)(r.mAttributeData.attribute_values,1)[0].attribute_value_valuable||{};r.mValue.image_source=l.image_source||r.mValue.image_source,r.mValue.ratio=Number.isSafeInteger(l.ratio)?l.ratio:r.mValue.ratio,r.mValue.size=l.size_type||r.mValue.size,r.mValue.repeat_type=l.repeat_type||r.mValue.repeat_type,Number.isSafeInteger(l.offset_x)&&Number.isSafeInteger(l.offset_y)&&(r.mValue.offset=[l.offset_x,l.offset_y]),r.mValue.rotation=Number.isSafeInteger(l.rotation)?l.rotation:r.mValue.rotation,r.mValue.scale=Number.isSafeInteger(l.scale)?l.scale:r.mValue.scale}return r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"destroy",value:function(){this.mImageUploadEvent.unsubscribe(),this.mImageUploadController&&(this.mImageUploadController.destroy(),delete this.mImageUploadController)}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"broadcastAttributeUpdated",value:function(){var e,n,r,i,a;this.updateValues(),this.dispatchToRenderer().then((function(){}),(function(e){v.UX.error(e)})),(e=t,n="broadcastAttributeUpdated",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}},{key:"updateValues",value:function(){if(Array.isArray(this.mAttributeData.attribute_values)&&this.mAttributeData.attribute_values.length>0){var e=(0,o.A)(this.mAttributeData.attribute_values,1)[0].attribute_value_valuable||{};Number.isSafeInteger(e.ratio)&&(this.mValue.ratio=e.ratio)}this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){"string"!=typeof e&&(this.mValue=Object.assign(this.mValue,e));var n="string"==typeof e?e:e.image_source;if((0,h.Kg)(n)){var r=n.length;if(/@offset:(.*?);/.test(n)){var i,a=n.match(/@offset:(.*?);/);r=r>a.index?a.index:r;var o=a[1],s=null;try{s=JSON.parse(o)}catch(e){}Array.isArray(s)&&(null===(i=s)||void 0===i?void 0:i.length)>1&&(this.mValue.offset=[s[0],s[1]])}if(/@rotation:(.*?);/.test(n)){var u=n.match(/@rotation:(.*?);/),c=u[1];r=r>u.index?u.index:r;var l=parseInt(c,10);isNaN(l)||(this.mValue.rotation=l)}if(/@scale:(.*?);/.test(n)){var f=n.match(/@scale:(.*?);/),m=f[1];r=r>f.index?f.index:r;var p=parseFloat(m);isNaN(p)||(this.mValue.scale=p)}r>0&&(n=n.slice(0,r)),this.mValue.image_source=n.trim()}this.updateValues(),this.dispatchToRenderer(t).then((function(){}),(function(e){v.UX.error(e)})),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){var e=Array.isArray(this.mValue.offset)&&this.mValue.offset.length>1?"[".concat(this.mValue.offset.map((function(e){return Number(e).toFixed(2)})),"]"):"[0,0]",t=Number.isSafeInteger(this.mValue.rotation)?"".concat(this.mValue.rotation):"0",n=Number.isSafeInteger(this.mValue.scale)?"".concat(Number(this.mValue.scale).toFixed(2)):"0";return(0,h.uI)(this.mValue.image_source)?"".concat(this.mValue.image_source," @offset:").concat(e,"; @rotation:").concat(t,"; @scale:").concat(n,";"):""}},{key:"resetValue",value:function(e){this.mValue.image_source="",this.broadcast(e)}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"parse",value:function(e,t){e&&(0,h.Kg)(e.image_source)&&this.setValue(e,t)}},{key:"onMaterialUpdated",value:function(e){var t=this.resolveValuable().material_id;e.materialModelId===t&&this.visibleOnFrame&&![0,3].includes(this.mAttributeData.visibility)&&this.mAttributeData.visible&&this.dispatchToRenderer().then((function(){}),(function(e){v.UX.error(e)}))}},{key:"dispatchToRenderer",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:this.mImageUploadController||(r=en.J.getManager(en.n.MaterialManager),this.mImageUploadController=new Pn(r),this.mImageUploadEvent.pipe((0,Bn.L)((function(){return(0,xn.H)(new Promise((function(e){var t=JSON.parse(JSON.stringify(n)),r=JSON.parse(JSON.stringify(a.mValue));a.mImageUploadController.update(t,r,a.resolveProductNode()).then((function(){return e()}),(function(t){v.UX.warn("Failed to update image upload:",t),e()}))})))})),(0,Fn.W)((function(e,t){return t}))).subscribe({next:function(){v.UX.print("Image upload updated."),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))},error:function(e){v.UX.warn("Failed to update image upload (pipeline):",e)}})),this.mImageUploadEvent.next();case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getResourceController",value:function(){return this.mImageUploadController}}]);var r}(yn);function jn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jn=function(){return!!e})()}function Un(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Ln,"TypeRTTI",new le.O("AttributeImageUploadController",yn.TypeRTTI));var Vn=function(e){function t(e,n){var r,i,a,o;(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,jn()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mSubscriptions",[]),(0,c.A)(r,"mMaterialGroupId",void 0),r.mMaterialGroupId=r.resolveMaterialGroupId();var u=r.mAttributeManagerComp._getMaterialGroupManager();return u&&r.mSubscriptions.push(u.onMaterialChanged.subscribe({next:function(e){r.mMaterialGroupId===e.id&&r.updateValues()}})),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"destroy",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),Un(t,"destroy",this,3)([])}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){if(null!==this.mMaterialGroupId){var e=this.mAttributeManagerComp._getMaterialGroupManager();if(e)this.mAttributeData.attribute_values[0].attribute_value_valuable.material_group=e.getGroup(this.mMaterialGroupId)}this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){var n=this;if(e){var r=this.mAttributeManagerComp._getMaterialGroupManager(),i=this._getDefaultSetOptions(t);if(r){var a=[];"number"==typeof e?a.push(r.setActiveMaterial(this.mMaterialGroupId,e,i.emitEvent)):"string"==typeof e?a.push(r.setActiveMaterialByName(this.mMaterialGroupId,e,i.emitEvent)):"number"==typeof(null==e?void 0:e.material_id)&&a.push(r.setActiveMaterial(this.mMaterialGroupId,e.material_id,i.emitEvent)),Promise.all(a).then((function(){n.updateValues(),n.broadcast(t)})).catch((function(e){v.UX.error(e)}))}}}},{key:"broadcast",value:function(e){var t=this._getDefaultSetOptions(e);if(t.emitEvent){var n=this.mAttributeManagerComp._getMaterialGroupManager(),r=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,i=n?n.getActiveRefId(this.mMaterialGroupId):null;this.broadcastValueChange(r,i,t.rebuild,t.userData)}}},{key:"setValueByKey",value:function(e,t){var n=this.mAttributeManagerComp._getMaterialGroupManager(),r=this._getDefaultSetOptions(t);n&&(v.UX.print("Setting material group reference via key on group: ".concat(this.mMaterialGroupId)),n.setActiveMaterialBySku(this.mMaterialGroupId,e,r.emitEvent).catch((function(e){return v.UX.error(e)})),this.updateValues(),this.broadcast(r))}},{key:"getValue",value:function(){var e=this.mAttributeManagerComp._getMaterialGroupManager();return{material_id:e?e.getActiveRefId(this.mMaterialGroupId):null}}},{key:"getValueName",value:function(){var e=this.mAttributeManagerComp._getMaterialGroupManager();if(!e)return null;var t=e.getActiveRefModel(this.mMaterialGroupId);return t?(0,h.uI)(t.name)?t.name:t.material_name:null}},{key:"getValueKey",value:function(){var e,t=this.mAttributeManagerComp._getMaterialGroupManager();if(t)return null===(e=t.getActiveRefModel(this.mMaterialGroupId))||void 0===e?void 0:e.sku}},{key:"resetValue",value:function(e){var t=this.mAttributeManagerComp._getMaterialGroupManager();t&&t.resetActiveMaterial(this.mMaterialGroupId,!0===(null==e?void 0:e.emitEvent)),this.broadcast(e)}},{key:"isVisibleInQuote",value:function(){if(!Un(t,"isVisibleInQuote",this,3)([]))return!1;var e,n=this.mAttributeManagerComp._getMaterialGroupManager();return!n||2!==(null===(e=n.getActiveRefModel(this.mMaterialGroupId))||void 0===e?void 0:e.visible)}},{key:"setVisibility",value:function(e,n){if(!this.visibleOnFrame)return Un(t,"setVisibility",this,3)([!1]);if(n&&Number.isSafeInteger(n.option_id)){var r=this.mAttributeManagerComp._getMaterialGroupManager();null!==this.mMaterialGroupId&&Number.isSafeInteger(n.option_id)&&r.setMaterialVisibility(this.mMaterialGroupId,n.option_id,e)}else Un(t,"setVisibility",this,3)([e,n])}},{key:"parse",value:function(e,t){e&&Number.isSafeInteger(e.material_id)&&this.setValue(e,t)}},{key:"dispatchToRenderer",value:(r=(0,n.A)(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.mAttributeManagerComp._getMaterialGroupManager()){e.next=3;break}return e.abrupt("return");case 3:return r=n.getActiveRefId(this.mMaterialGroupId),e.next=6,n.setActiveMaterial(this.mMaterialGroupId,r,t.emitEvent);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"resolveMaterialGroupId",value:function(){if(this.mAttributeData&&this.mAttributeData.attribute_values.length>0){var e=this.mAttributeData.attribute_values[0].attribute_value_valuable;if(e&&Number.isSafeInteger(e.material_group_id))return e.material_group_id}return null}}]);var r}(yn);(0,c.A)(Vn,"TypeRTTI",new le.O("AttributeMatgroupController",yn.TypeRTTI));var zn=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"applyMinMax",value:function(e,t){return(0,h.kf)(e)?((0,h.kf)(t.min_value)&&(e=e<t.min_value?t.min_value:e),(0,h.kf)(t.max_value)&&(e=e>t.max_value?t.max_value:e),e):null}}])}();function Hn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Hn=function(){return!!e})()}var Gn=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Hn()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"calculate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return null;var r=0;return e.every((function(e){if(!(0,h.kf)(e.value))return!1;var i=parseFloat(e.value);return n&&(i=t.applyMinMax(i,e)),r+=i,!0}))?r:null}}])}(zn);function qn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qn=function(){return!!e})()}var Wn=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,qn()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"calculate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return null;var r=null;return e.every((function(e){if(!(0,h.kf)(e.value))return!1;var i=parseFloat(e.value);return n&&(i=t.applyMinMax(i,e)),null===r?r=i:r*=i,!0}))?r:null}}])}(zn);function Kn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kn=function(){return!!e})()}var Xn=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Kn()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"calculate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return null;var r=null;return e.every((function(e){if(!(0,h.kf)(e.value))return!1;var i=parseFloat(e.value);return n&&(i=t.applyMinMax(i,e)),null===r?r=i:0===i?r=0:r/=i,!0}))?r:null}}])}(zn);function Yn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yn=function(){return!!e})()}var $n=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Yn()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"calculate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return null;var r=null;return e.every((function(e){if(!(0,h.kf)(e.value))return!1;var i=parseFloat(e.value);return n&&(i=t.applyMinMax(i,e)),null===r?r=i:r-=i,!0}))?r:null}}])}(zn);function Zn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zn=function(){return!!e})()}var Qn=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Zn()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"calculate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return null;var r=0;return e.every((function(e){if(!(0,h.kf)(e.value))return!1;var i=parseFloat(e.value);return n&&(i=t.applyMinMax(i,e)),r+=i,r*=r,!0}))?r:null}}])}(zn);function Jn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jn=function(){return!!e})()}var er=function(e){function t(){var e,n,r,i,a=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,s.A)(this,t),n=this,r=t,r=(0,oe.A)(r),e=(0,ae.A)(n,Jn()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mUseDiameter",void 0),(0,c.A)(e,"mHalfCircle",void 0),e.mUseDiameter=a,e.mHalfCircle=o,e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"calculate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e)||0===e.length)return null;var n=e[0].value;if(!(0,h.kf)(n))return null;t&&(n=this.applyMinMax(n,e[0])),this.mUseDiameter&&(n*=.5);var r=n*n*3.14159265359;return this.mHalfCircle&&(r*=.5),r}}])}(zn);function tr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tr=function(){return!!e})()}var nr=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,tr()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"calculate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e)||e.length<3)return null;var n=e[0].value;if(!(0,h.kf)(n))return null;t&&(n=this.applyMinMax(n,e[0]));var r=e[1].value;if(!(0,h.kf)(r))return null;t&&(r=this.applyMinMax(r,e[1]));var i=e[2].value;return(0,h.kf)(i)?(t&&(i=this.applyMinMax(i,e[2])),i*(n+r)*.5):null}}])}(zn);function rr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rr=function(){return!!e})()}var ir=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,rr()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"calculate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e)||e.length<2)return null;var n=e[0].value;if(!(0,h.kf)(n))return null;t&&(n=this.applyMinMax(n,e[0]));var r=e[1].value;return(0,h.kf)(r)?(t&&(r=this.applyMinMax(r,e[1])),r*n*.5):null}}])}(zn);function ar(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ar=function(){return!!e})()}var or=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,ar()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"calculate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e)||e.length<3)return null;var n=e[0].value;if(!(0,h.kf)(n))return null;t&&(n=this.applyMinMax(n,e[0]));var r=e[1].value;if(!(0,h.kf)(r))return null;t&&(r=this.applyMinMax(r,e[1]));var i=e[2].value;return(0,h.kf)(i)?(t&&(i=this.applyMinMax(i,e[2])),.5*(n+r)*i):null}}])}(zn);function sr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(sr=function(){return!!e})()}var ur=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,sr()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"calculate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e)||e.length<3)return null;var n=e[0].value;if(!(0,h.kf)(n))return null;t&&(n=this.applyMinMax(n,e[0]));var r=e[1].value;if(!(0,h.kf)(r))return null;t&&(r=this.applyMinMax(r,e[1]));var i=e[2].value;return(0,h.kf)(i)?(t&&(i=this.applyMinMax(i,e[2])),n*i+(r-n)*i*.5):null}}])}(zn);function cr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cr=function(){return!!e})()}var lr=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,cr()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"calculate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e)||e.length<3)return null;var n=e[0].value;if(!(0,h.kf)(n))return null;t&&(n=this.applyMinMax(n,e[0]));var r=e[1].value;if(!(0,h.kf)(r))return null;t&&(r=this.applyMinMax(r,e[1]));var i=e[2].value;return(0,h.kf)(i)?(t&&(i=this.applyMinMax(i,e[2])),i*(n+r)):null}}])}(zn);function hr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hr=function(){return!!e})()}var fr=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,hr()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"calculate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e)||e.length<3)return null;var n=e[0].value;if(!(0,h.kf)(n))return null;t&&(n=this.applyMinMax(n,e[0]));var r=e[1].value;if(!(0,h.kf)(r))return null;t&&(r=this.applyMinMax(r,e[1]));var i=e[2].value;return(0,h.kf)(i)?(t&&(i=this.applyMinMax(i,e[2])),i*(n>r?n:r)):null}}])}(zn);function mr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mr=function(){return!!e})()}var pr=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,mr()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mOperationController",null),(0,c.A)(r,"mDefaultOperands",null),(0,c.A)(r,"mValue",{operands:[],calculated_value:null}),r.updateValueOperands(),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"updateValueOperands",value:function(){this.mOperationController=null,this.mValue.operands=[];var e=this.mAttributeData.attribute_values;if(e.length>0){var t=e[0].attribute_value_valuable;Array.isArray(t.operands)&&(this.mDefaultOperands=JSON.parse(JSON.stringify(t.operands)),this.mValue.operands=t.operands,this.mValue.operands.forEach((function(e){(0,h.kf)(e.value)?e.value=parseFloat(e.value):e.value=null,(0,h.kf)(e.min_value)?e.min_value=parseFloat(e.min_value):e.min_value=null,(0,h.kf)(e.max_value)?e.max_value=parseFloat(e.max_value):e.max_value=null}))),(0,h.uI)(t.operation)&&this.createOperationController(t.operation)}this.updateCalculatedValue()}},{key:"createOperationController",value:function(e){if((0,h.uI)(e))switch(e){case"add":this.mOperationController=new Gn;break;case"multiply":this.mOperationController=new Wn;break;case"divide":this.mOperationController=new Xn;break;case"subtract":this.mOperationController=new $n;break;case"squared":this.mOperationController=new Qn;break;case"circle_area":this.mOperationController=new er(!1,!1);break;case"half_circle_area":this.mOperationController=new er(!1,!0);break;case"circle_area_d":this.mOperationController=new er(!0,!1);break;case"half_circle_area_d":this.mOperationController=new er(!0,!0);break;case"triangle_area":case"parallelogram_area":this.mOperationController=new nr;break;case"right_triangle_area":case"symmetric_triangle_area":this.mOperationController=new ir;break;case"trapezium_area":this.mOperationController=new or;break;case"rect_bevelled_long_area":case"rect_bevelled_short_area":this.mOperationController=new ur;break;case"max_length_area":this.mOperationController=new fr;break;case"composite_length_area":this.mOperationController=new lr}}},{key:"broadcastAttributeUpdated",value:function(){var e,n,r,i,a;this.updateValueOperands(),(e=t,n="broadcastAttributeUpdated",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}},{key:"updateCalculatedValue",value:function(){this.mValue.calculated_value=null,this.mOperationController&&(this.mValue.calculated_value=this.mOperationController.calculate(this.mValue.operands,!1))}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue(e)}},{key:"setValue",value:function(e,t){var n=this;e&&Object.keys(e).forEach((function(t){if((0,h.kf)(t)){var r=parseInt(t,10);(0,h.kf)(e[t].value)&&r<n.mValue.operands.length&&(n.mValue.operands[r].value=parseFloat(e[t].value))}})),this.updateCalculatedValue(),this.updateValues(!1),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"compareValue",value:function(e){return e==this.getValue().calculated_value}},{key:"getValue",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.updateCalculatedValue(),this.mValue}},{key:"getValueName",value:function(){return this.updateCalculatedValue(),Number.isFinite(this.mValue.calculated_value)?"".concat(this.mValue.calculated_value):""}},{key:"resetValue",value:function(e){this.mValue.calculated_value=null,Array.isArray(this.mDefaultOperands)?this.mValue.operands=JSON.parse(JSON.stringify(this.mDefaultOperands)):Array.isArray(this.mValue.operands)&&this.mValue.operands.forEach((function(e){e.value=null})),this.broadcast(e)}},{key:"parse",value:function(e,t){if(v.UX.print("parsing operable with: ",e),e&&Array.isArray(e.operands)){var n={};e.operands.forEach((function(e,t){n[t]=e})),this.setValue(n,t)}}},{key:"dispatchToRenderer",value:(r=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})}]);var r}(yn);function dr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dr=function(){return!!e})()}function vr(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(pr,"TypeRTTI",new le.O("AttributeOperableNumbersInputController",yn.TypeRTTI));var yr=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,dr()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mValueMutations",{}),r.mAttributeData.attribute_values.sort((function(e,t){var n=e.attribute_value_valuable,r=t.attribute_value_valuable;return n.position-r.position})),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"resolveValueMutation",value:function(e){if(null!=e){if(!this.mValueMutations[e]){var t=this.mAttributeData.attribute_values.find((function(t){return t.id===e}));t&&(this.mValueMutations[e]={selected:!1,visible:0!==t.visibility,disabled:!0===t.disabled})}return this.mValueMutations[e]}}},{key:"updateValues",value:function(){var e=this;this.mAttributeData.attribute_values.forEach((function(t){var n=e.resolveValueMutation(t.id);t.visible=n.visible,t.disabled=n.disabled}));var t=this.getValue(),n=Number.isSafeInteger(t.attribute_value_id)?t.attribute_value_id:null;this.mAttributeData.selected_value_id=n,this.mAttributeData.selected_value_value=t}},{key:"setValue",value:function(e,t){var n=this,r=null;if((0,h.kf)(e))r="string"==typeof e?parseInt(e,10):e;else{var i="string"==typeof e?e.toLowerCase():e,a=this.mAttributeData.attribute_values.find((function(e){return"string"==typeof e.name&&e.name.toLowerCase()===i}));a&&(r=a.id)}Object.keys(this.mValueMutations).forEach((function(e){n.mValueMutations[e].selected=!1}));var o=this.resolveValueMutation(r);o?(o.selected=!0,this.updateValues(),this.broadcast(t)):v.UX.warn("trying to select none existing value ".concat(r," in question@setValue"))}},{key:"broadcast",value:function(e){var t=this._getDefaultSetOptions(e);t.emitEvent&&this.broadcastValueChange(this.mAttributeData.selected_value_id,this.getValue(),t.rebuild,t.userData)}},{key:"setValueByKey",value:function(e,t){var n="string"==typeof e?e.toLowerCase():e,r=this.mAttributeData.attribute_values.find((function(e){return"string"==typeof e.key&&e.key.toLowerCase()===n}));r&&this.setValue(r.id,t)}},{key:"compareValue",value:function(e){return e==this.getValue().attribute_value_id}},{key:"getValue",value:function(){var e=this,t={attribute_value_id:null};if(Object.keys(this.mValueMutations).every((function(n){return!e.mValueMutations[n].selected||(t.attribute_value_id=parseInt(n,10),!1)})),null!==t.attribute_value_id)return t;var n=this.mAttributeData.attribute_values.find((function(e){return!0===e.default}));return n?{attribute_value_id:n.id}:this.mAttributeData.attribute_values.length>0?{attribute_value_id:this.mAttributeData.attribute_values[0].id}:{attribute_value_id:null}}},{key:"getValueName",value:function(){var e=this.getValue();if(!Number.isSafeInteger(e.attribute_value_id))return"";var t=this.mAttributeData.attribute_values.find((function(t){return t.id==e.attribute_value_id}));return t?t.name:""}},{key:"getValueKey",value:function(){var e=this.getValue(),t=this.mAttributeData.attribute_values.find((function(t){return t.id===e.attribute_value_id}));if(t)return t.key}},{key:"resetValue",value:function(e){var t=this,n=this._getDefaultSetOptions(e);Object.keys(this.mValueMutations).forEach((function(e){var r=!1!==t.mValueMutations[e].selected;t.mValueMutations[e].selected=!1,n.emitEvent&&r&&t.broadcastValueChange(parseInt(e,10),!1,n.rebuild,n.userData)}))}},{key:"isVisibleInQuote",value:function(){if(!vr(t,"isVisibleInQuote",this,3)([]))return!1;var e=this.getValue(),n=this.mAttributeData.attribute_values.find((function(t){return t.id===e.attribute_value_id}));return!n||2!==n.visibility}},{key:"setVisibility",value:function(e,n){if(!this.visibleOnFrame)return vr(t,"setVisibility",this,3)([!1]);if(n&&Number.isSafeInteger(n.option_id)){var r=this.resolveValueMutation(n.option_id);r&&(r.visible=e)}else vr(t,"setVisibility",this,3)([e,n])}},{key:"setDisabled",value:function(e,t){if(t&&Number.isSafeInteger(t.option_id)){var n=this.resolveValueMutation(t.option_id);n&&(n.disabled=e)}}},{key:"getQueryParam",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getValue();if(!Number.isSafeInteger(t.attribute_value_id))return{};var n={};return e&&(!this.isVisible()||!1===this.resolveValueMutation(t.attribute_value_id).visible)||(n[this.mAttributeData.id]=t.attribute_value_id),n}},{key:"parse",value:function(e,t){e&&Number.isSafeInteger(e.attribute_value_id)&&this.setValue(e.attribute_value_id,t)}},{key:"dispatchToRenderer",value:(r=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})}]);var r}(yn);function gr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gr=function(){return!!e})()}(0,c.A)(yr,"TypeRTTI",new le.O("AttributeQuestionController",yn.TypeRTTI));var br=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,gr()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mValue",""),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getAttribute",value:function(){return this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue(),this.mAttributeData}},{key:"setValue",value:function(e,t){this.mValue=e,this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){return this.mValue}},{key:"resetValue",value:function(e){this.mValue="",this.broadcast(e)}},{key:"parse",value:function(e,t){}},{key:"serialize",value:function(e){return null}},{key:"dispatchToRenderer",value:(r=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})}]);var r}(yn);function Ar(e,t){return(0,x.N)((function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe((0,S._)(r,(function(n){null==i||i.unsubscribe();var o=0,u=a++;(0,ln.Tg)(e(n,u)).subscribe(i=(0,S._)(r,(function(e){return r.next(t?t(n,e,u,o++):e)}),(function(){i=null,s()})))}),(function(){o=!0,s()})))}))}(0,c.A)(br,"TypeRTTI",new le.O("AttributeSeparatorController",yn.TypeRTTI));__webpack_require__(48814),__webpack_require__(43995);var _r=__webpack_require__(48477),Mr=__webpack_require__(62467);function kr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return wr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function wr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Tr=function(){function e(){(0,s.A)(this,e),(0,c.A)(this,"mModels",{}),(0,c.A)(this,"mPrintReadyFileLoaders",{}),(0,c.A)(this,"mDependencyLoaders",{})}return(0,u.A)(e,[{key:"resetCache",value:function(){var e=this;Object.keys(this.mPrintReadyFileLoaders).forEach((function(t){e.mPrintReadyFileLoaders[t].error("disposed"),delete e.mPrintReadyFileLoaders[t]})),Object.keys(this.mDependencyLoaders).forEach((function(t){e.mDependencyLoaders[t].error("disposed"),delete e.mDependencyLoaders[t]})),this.mModels={}}},{key:"resolveModel",value:(a=(0,n.A)(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h.N5.isNumeric(t)){e.next=2;break}throw new Error("Requested id is not an integer: ".concat(t));case 2:if(!((n=t)in this.mModels)){e.next=5;break}return e.abrupt("return",this.mModels[n]);case 5:return e.next=7,this.finishDependencies();case 7:return e.abrupt("return",this.getModelFromAPI(n));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"finishDependencies",value:(r=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=Object.keys(t.mDependencyLoaders).map((function(e){return t.mDependencyLoaders[e].pipe((0,Fn.W)((function(){return(0,Mr.of)([])})))}));if(0===r.length)return e(!0);(0,sn.p)(r).pipe((0,cn.T)((function(e){return e.every((function(e){return e}))}))).subscribe({next:function(t){e(t)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"getModelFromAPI",value:(t=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){if(t in n.mModels)return e(n.mModels[t]);t in n.mPrintReadyFileLoaders||(n.mPrintReadyFileLoaders[t]=new L.m(1),J.k.getInstance().get("".concat(et.w.apiUrl,"print-ready-file/").concat(t)).then((function(e){n.mPrintReadyFileLoaders[t].next(It.eE.getItem(e.data)),n.mPrintReadyFileLoaders[t].complete()})).catch((function(e){n.mPrintReadyFileLoaders[t].error(e)}))),n.mPrintReadyFileLoaders[t].pipe((0,E.s)(1)).subscribe({next:function(r){n.mModels[t]=r,e(r)},error:function(e){delete n.mPrintReadyFileLoaders[t],r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"preloadCatalogue",value:function(e){var t=this;return this.mDependencyLoaders[e]||(this.mDependencyLoaders[e]=new L.m(1),Rt._.getInstance().resolveBootstrapData(e).pipe((0,E.s)(1)).subscribe({next:function(n){var r,i=n.getPrintReadyFiles(),a=kr(It.eE.getItems(i));try{for(a.s();!(r=a.n()).done;){var o=r.value;t.mModels[o.id]=o}}catch(e){a.e(e)}finally{a.f()}t.mDependencyLoaders[e].next(!0),t.mDependencyLoaders[e].complete()},error:function(n){t.mDependencyLoaders[e].error(n),delete t.mDependencyLoaders[e]}})),this.mDependencyLoaders[e]}}],[{key:"getInstance",value:function(){return e.sInstance||(e.sInstance=new e),e.sInstance}}]);var t,r,a}();(0,c.A)(Tr,"sInstance",null);var xr=function(){function e(t,n){(0,s.A)(this,e),(0,c.A)(this,"name",void 0),(0,c.A)(this,"mediaId",void 0),(0,c.A)(this,"settings",void 0),(0,c.A)(this,"id",void 0),(0,c.A)(this,"media",void 0),(0,c.A)(this,"watermarkMedia",void 0),this.name=t,this.mediaId=n,this.settings=this.settingsDefaultValues()}return(0,u.A)(e,[{key:"getMedia",value:(r=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",tn.u.getInstance().resolveModel(t));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"settingsDefaultValues",value:function(){return{placeholders:!1,print_marks:!0,resolution:1024,dpi:300,output_format:"png"}}},{key:"hasWatermark",value:function(){return!!(this.settings&&this.settings.watermark&&this.settings.watermark.svg_element&&this.settings.watermark.media_id)}},{key:"loadWatermarkMedia",value:(t=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getMedia(this.settings.watermark.media_id);case 2:this.watermarkMedia=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"parse",value:function(t){var n,r,i=new e(t.name,t.media_id);(t.id&&(i.id=t.id),t.settings)&&(i.settings={placeholders:null!==(n=t.settings.placeholders)&&void 0!==n?n:i.settings.placeholders,print_marks:null!==(r=t.settings.print_marks)&&void 0!==r?r:i.settings.print_marks,resolution:t.settings.resolution||i.settings.resolution,dpi:t.settings.dpi||i.settings.dpi,output_format:t.settings.output_format||i.settings.output_format});return t.settings&&t.settings.watermark&&(i.settings.watermark=t.settings.watermark),i}},{key:"serialize",value:function(e){var t=e.settingsDefaultValues(),n={name:e.name,media_id:e.mediaId,settings:{placeholders:e.settings.placeholders,print_marks:e.settings.print_marks,resolution:e.settings.resolution||t.resolution,dpi:e.settings.dpi||t.dpi,output_format:e.settings.output_format||t.output_format}};return e.id&&(n.id=e.id),e.settings.watermark&&(n.settings.watermark=e.settings.watermark),n}}]);var t,r}();function Sr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sr=function(){return!!e})()}function Cr(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Er=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Sr()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mTextureMediaId",void 0),(0,c.A)(r,"mTextureResolver",void 0),(0,c.A)(r,"mPrintReadyFileId",void 0),(0,c.A)(r,"mDisposed",!1),(0,c.A)(r,"mElementUpdatedSubscription",void 0),(0,c.A)(r,"mPalletizationContexts",{}),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"resolveSvgTextureController",value:(o=(0,n.A)(i().mark((function e(t){var r=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){var o,s,u,c,l;r.mTextureResolver&&r.mPrintReadyFileId!==t&&r.disposeSvgTexture(),r.mPrintReadyFileId=t,r.mTextureResolver||(r.mTextureResolver=new L.m(1),Tr.getInstance().resolveModel(t).then(function(){var e=(0,n.A)(i().mark((function e(t){var n,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.mTextureResolver&&!r.mDisposed){e.next=2;break}throw new Error("Media is disposed before resolving!");case 2:return u=xr.parse(t),r.mTextureMediaId=t.media_id,n=r.mTextureMediaId,a=en.J.getManager(en.n.TextureManager),o=a.makeResource(n,{forceShared:!0}),s=a.findResourceWithHandle(o),e.abrupt("return",a.resolveResource(o));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).then((0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.mTextureResolver&&!r.mDisposed){e.next=2;break}throw new Error("Media is disposed before resolving!");case 2:if(!(t=s.getController()).isTypeOf(_r.e.TypeRTTI)){e.next=6;break}return c=t,e.abrupt("return",r.resolvePrintReadyFile(c,u));case 6:r.mTextureResolver.error("Controller is not svg");case 7:case"end":return e.stop()}}),e)})))).then((function(){if(!r.mTextureResolver||r.mDisposed)throw new Error("Media is disposed before resolving!");r.mTextureResolver.next({handle:o,controller:c,printReadyFile:u})})).catch((function(e){v.UX.error(e),r.mTextureResolver?r.mTextureResolver.error(e):a()}))),r.mTextureResolver.pipe((0,E.s)(1),(0,w.p)((function(e){return!!e.controller})),Ar((function(e){return e.controller.onTextureReady().pipe((0,cn.T)((function(){return e})),(0,Fn.W)((function(e){return(0,un.$)(e)})))}))).subscribe({next:(l=(0,n.A)(i().mark((function t(n){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.printReadyFile){t.next=3;break}return t.next=3,r.resolvePrintReadyFileSettings(n.controller,n.printReadyFile);case 3:r.mElementUpdatedSubscription&&(r.mElementUpdatedSubscription.unsubscribe(),delete r.mElementUpdatedSubscription),r.mElementUpdatedSubscription=n.controller.onElementUpdated.subscribe({next:function(){r.dispatchToRenderer().then((function(){R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))}),(function(e){v.UX.error(e)}))}}),e(n.controller);case 6:case"end":return t.stop()}}),t)}))),function(e){return l.apply(this,arguments)}),error:function(e){a(e)},complete:function(){r.mTextureResolver&&(r.mTextureResolver.unsubscribe(),delete r.mTextureResolver),r.mElementUpdatedSubscription&&(r.mElementUpdatedSubscription.unsubscribe(),delete r.mElementUpdatedSubscription),delete r.mPrintReadyFileId,r.mDisposed||r.dispatchToRenderer().then((function(){R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))}),(function(e){v.UX.error(e)}))}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})},{key:"disposeSvgTexture",value:function(){this.mTextureResolver&&(this.mTextureResolver.pipe((0,E.s)(1)).subscribe({next:function(e){en.J.getManager(en.n.TextureManager).disposeResource(e.handle)},error:function(){}}),this.mTextureResolver&&(this.mTextureResolver.unsubscribe(),delete this.mTextureResolver),delete this.mPrintReadyFileId)}},{key:"broadcastAttributeUpdated",value:function(e){this.updateValues();var n=null!=e?e:this._getDefaultSetOptions(),r=structuredClone(this.getValue());this.setValue(r,n),Cr(t,"broadcastAttributeUpdated",this,3)([])}},{key:"destroy",value:function(){this.mDisposed=!0,Cr(t,"destroy",this,3)([]),this.disposeSvgTexture()}},{key:"onMaterialUpdated",value:function(e){}},{key:"resolvePrintReadyFile",value:(a=(0,n.A)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.printReadyFileStore[n.id]){e.next=2;break}return e.abrupt("return");case 2:if(!n.hasWatermark()){e.next=6;break}if(n.watermarkMedia){e.next=6;break}return e.next=6,n.loadWatermarkMedia();case 6:t.printReadyFileStore[n.id]=n;case 7:case"end":return e.stop()}}),e)}))),function(e,t){return a.apply(this,arguments)})},{key:"resolvePrintReadyFileSettings",value:(r=(0,n.A)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.settings){e.next=2;break}return e.abrupt("return");case 2:if(!n.hasWatermark()){e.next=5;break}return e.next=5,t.addWatermark(n.id,n.settings.watermark.svg_element);case 5:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})},{key:"getMediaId",value:function(){return this.mTextureMediaId}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"getPalletizationContext",value:function(e){return this.mPalletizationContexts[e]}},{key:"fixTextStyles",value:function(e){for(var t=null!=e?e:[],n=0;n<t.length;n++){Array.isArray(t[n])||(t[n]=[]);for(var r=0;r<t[n].length;r++)t[n][r]||(t[n][r]={})}return t}}]);var r,a,o}(yn);function Rr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ir(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rr(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Or(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Or=function(){return!!e})()}function Dr(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Er,"TypeRTTI",new le.O("AttributeSvgController",yn.TypeRTTI));var Pr=function(e){function t(e,n){var r,i,a,o;(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Or()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mValue",{name:"",attribute:"",key:"",media_id:null,print_ready_file_id:null,svg_element:null});var u=r.resolveValuable();if(u&&Array.isArray(u.attributes)&&u.attributes.length>0){var l=u.attributes.find((function(e){return h.N5.isTrue(e.default)}));l?r.setValue(l.key):r.setValue(u.attributes[0].key)}return r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){if("string"==typeof e){var n=this.resolveValuable(),r=this.getAttributeValueForKey(e);r&&n&&(this.mValue={key:r.key,media_id:n.media_id,print_ready_file_id:n.print_ready_file_id,svg_element:n.svg_element,name:r.name,attribute:r.attribute,value:r.value})}else this.mValue=Ir(Ir({},this.mValue),e);this.updateValues(),this.dispatchToRenderer(t).then((function(){}),(function(e){v.UX.error(e)})),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"compareValue",value:function(e){return e==this.getValue().value}},{key:"getValue",value:function(){if(this.mAttributeData.attribute_values.length>0){var e=this.mAttributeData.attribute_values[0].attribute_value_valuable;e&&(this.mValue.media_id=e.media_id,this.mValue.print_ready_file_id=e.print_ready_file_id,this.mValue.svg_element=e.svg_element)}return this.mValue}},{key:"getValueName",value:function(){return this.getValue().name}},{key:"resetValue",value:function(e){this.mValue.name="",this.mValue.attribute="",this.mValue.key="",delete this.mValue.value,this.broadcast(e)}},{key:"setVisibility",value:function(e,n){if(!this.visibleOnFrame)return Dr(t,"setVisibility",this,3)([!1]);if(n&&null!==n.option_id&&void 0!==n.option_id)try{var r=this.mAttributeData.attribute_values[0].attribute_value_valuable.attributes.find((function(e){return e.key===n.option_id}));r&&(r.visible=e)}catch(e){v.UX.print("failed to get svg valuable: ",e)}else Dr(t,"setVisibility",this,3)([e,n])}},{key:"parse",value:function(e,t){if(null!=e){var n,r=e;if(!r.value&&r.key)r.value=null===(n=this.getAttributeValueForKey(r.key))||void 0===n?void 0:n.value;this.setValue(r,t)}}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"getAttributeValueForKey",value:function(e){var t,n=this.resolveValuable();return null==n||null===(t=n.attributes)||void 0===t?void 0:t.find((function(t){return t.key===e}))}},{key:"dispatchToRenderer",value:(r=(0,n.A)(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.resolveSvgTextureController(n.print_ready_file_id);case 5:return r=e.sent,e.next=8,r.updateElement(n.svg_element,this.getValue());case 8:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]);var r}(Er);function Br(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Br(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Br(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Nr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Nr=function(){return!!e})()}function Lr(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Pr,"TypeRTTI",new le.O("AttributeSvgElementController",Er.TypeRTTI));var jr=function(e){function t(e,n){var r,i,a,o;(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Nr()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mValue",{name:"",media_id:null,print_ready_file_id:null,selected_element_id:null,elements:[]});var u=r.resolveValuable();if(u&&Array.isArray(u.attributes)&&u.attributes.length>0){var l=u.attributes.find((function(e){return h.N5.isTrue(e.default)}));l?r.setValue(l.key):r.setValue(u.attributes[0].key)}return r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){if((0,h.Kg)(e)){var n=this.mAttributeData.attribute_values[0].attribute_value_valuable,r=n.attributes.find((function(t){return t.key===e}));r&&(this.mValue={key:r.key,media_id:n.media_id,print_ready_file_id:n.print_ready_file_id,name:r.name,selected_element_id:r.selected_element_id})}else this.mValue=Fr(Fr({},this.mValue),e);this.updateValues(),this.dispatchToRenderer(t).then((function(){}),(function(e){v.UX.error(e)})),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"compareValue",value:function(e){return e==this.getValue().value}},{key:"getValue",value:function(){if(this.mAttributeData.attribute_values.length>0){var e=this.mAttributeData.attribute_values[0].attribute_value_valuable;e&&(this.mValue.media_id=e.media_id,this.mValue.print_ready_file_id=e.print_ready_file_id,this.mValue.elements=e.attributes.map((function(e){return e.selected_element_id})))}return this.mValue}},{key:"getValueName",value:function(){return this.getValue().name}},{key:"resetValue",value:function(e){this.mValue.name="",delete this.mValue.selected_element_id,delete this.mValue.value,this.broadcast(e)}},{key:"setVisibility",value:function(e,n){if(!this.visibleOnFrame)return Lr(t,"setVisibility",this,3)([!1]);if(n&&Number.isSafeInteger(n.option_id))try{var r=this.mAttributeData.attribute_values[0].attribute_value_valuable.attributes.find((function(e){return e.key===n.option_id}));r&&(r.visible=e)}catch(e){v.UX.print("failed to get svg valuable: ",e)}else Lr(t,"setVisibility",this,3)([e,n])}},{key:"parse",value:function(e,t){e&&void 0!==e.value&&this.setValue(e.value,t)}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"dispatchToRenderer",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.resolveSvgTextureController(n.print_ready_file_id);case 5:return r=e.sent,a=this.getValue(),o=a.elements.reduce((function(e,t){return Fr(Fr({},e),{},(0,c.A)({},t,t===a.selected_element_id))}),{}),e.next=10,r.updateVisibility(o);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]);var r}(Er);(0,c.A)(jr,"TypeRTTI",new le.O("AttributeSvgElementSelectorController",Er.TypeRTTI));__webpack_require__(35701);var Ur={r:.2126,g:.7152,b:.0722};function Vr(e){var t="#"===e[0]?e.substring(1):e;return 3===t.length?[parseInt(String(17*parseInt(t[0],16)),10),parseInt(String(17*parseInt(t[1],16)),10),parseInt(String(17*parseInt(t[2],16)),10)]:t.length>=6?[parseInt(String(parseInt(t[0]+t[1],16)),10),parseInt(String(parseInt(t[2]+t[3],16)),10),parseInt(String(parseInt(t[4]+t[5],16)),10)]:[0,0,0]}function zr(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ur,i=Math.abs(t[0]-e[0]),a=Math.abs(t[1]-e[1]),o=Math.abs(t[2]-e[2]);return(r.r*i+r.g*a+r.b*o)/(255*(n=r).r+255*n.g+255*n.b)}var Hr=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mNext",void 0)}),[{key:"setNext",value:function(e){return this.mNext=e,this}},{key:"handle",value:(e=(0,n.A)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.resolve(this.execute(t,n));case 2:if(!this.mNext){e.next=5;break}return e.next=5,this.mNext.handle(t,n);case 5:case"end":return e.stop()}}),e,this)}))),function(t,n){return e.apply(this,arguments)})}]);var e}();function Gr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gr=function(){return!!e})()}var qr=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Gr()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"execute",value:function(e,t){var n=e.svgEngine.getRootGroup();n.getObjects().forEach((function(e){e.visible||n.remove(e)}))}}])}(Hr);function Wr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wr=function(){return!!e})()}var Kr=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Wr()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"execute",value:function(e,t){var n=this;e.svgEngine.getObjects().forEach((function(e){switch(t.transparency_mode){case"allow":break;case"ignore":n.removeInvisibleObject(e);break;default:n.makeObjectOpaque(e),n.removeInvisibleObject(e)}}))}},{key:"makeObjectOpaque",value:function(e){(e.element.opacity>0||e.element.fillOpacity>0)&&(e.element.opacity=1,void 0!==e.element.fillOpacity&&null!==e.element.fillOpacity&&(e.element.fillOpacity=1))}},{key:"removeInvisibleObject",value:function(e){(e.element.opacity<=0||e.element.fillOpacity<=0)&&(e.element.visible=!1)}}])}(Hr);__webpack_require__(33771);function Xr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xr=function(){return!!e})()}var Yr=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Xr()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"execute",value:function(e,t){e.svgEngine.getObjects().forEach((function(e){if(!e.element.hasFill()||"linear"===e.element.fill.type||"radial"===e.element.fill.type){var t=e.element.fill.colorStops;if(t&&0!==t.length){var n=t.sort((function(e,t){return e.offset-t.offset})),r=(0,o.A)(n,1)[0];r&&(e.element.fill=r.color)}}}))}}])}(Hr);function $r(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($r=function(){return!!e})()}function Zr(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Qr=function(e){function t(e,n,r,i){var a,o,u,l;return(0,s.A)(this,t),o=this,u=t,l=[e,n,r],u=(0,oe.A)(u),a=(0,ae.A)(o,$r()?Reflect.construct(u,l||[],(0,oe.A)(o).constructor):u.apply(o,l)),(0,c.A)(a,"a",1),"string"==typeof e||e instanceof Ft.v||void 0===n?(0,ae.A)(a,a.set(e)):(0,ae.A)(a,a.setRGBA(e,n,r,i))}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"w",get:function(){return this.a},set:function(e){this.a=e}},{key:"set",value:function(e){return e instanceof t?this.copy(e):e instanceof Ft.v?this.copyColor3(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}},{key:"setScalar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.r=e,this.g=e,this.b=e,t&&(this.a=e),this}},{key:"setHex",value:function(e){return e=Math.floor(e),this.a=(e>>24&255)/255,this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}},{key:"setRGBA",value:function(e,t,n,r){return this.setRGB(e,t,n),this.a=r,this}},{key:"clone",value:function(){return new t(this.r,this.g,this.b,this.a)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}},{key:"copyColor3",value:function(e){return Zr(t,"copy",this,3)([e]),this.a=1,this}},{key:"getHex",value:function(){return 255*this.a<<24^255*this.r<<16^255*this.g<<8^255*this.b}},{key:"getHexString",value:function(){var e=("000000"+Zr(t,"getHex",this,3)([]).toString(16)).slice(-6).toUpperCase(),n=(255*this.a|0).toString(16).toUpperCase();return"#".concat(e).concat(n)}},{key:"getStyle",value:function(){return"rgba(".concat(255*this.r|0,",").concat(255*this.g|0,",").concat(255*this.b|0,",").concat(this.a,")")}},{key:"setStyle",value:function(e){var t;if(t=/^((?:rgb|hsl)a?)\(([^)]*)\)/.exec(e)){var n,r=t[1],i=t[2];switch(r){case"rgb":case"rgba":var a,o;if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,this.a=Math.min(1,parseFloat(n.length>3&&null!==(a=n[4])&&void 0!==a?a:"1.0")),this;if(n=/^\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,this.a=Math.min(1,parseFloat(n.length>3&&null!==(o=n[4])&&void 0!==o?o:"1.0")),this;break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i)){var s,u=parseFloat(n[1])/360,c=parseInt(n[2],10)/100,l=parseInt(n[3],10)/100;return this.a=Math.min(1,parseFloat(n.length>3&&null!==(s=n[4])&&void 0!==s?s:"1.0")),this.setHSL(u,c,l),this}}}else if(t=/^#([A-Fa-f\d]+)$/.exec(e)){var h=t[1],f=h.length;if(3===f)return this.r=parseInt(h.charAt(0)+h.charAt(0),16)/255,this.g=parseInt(h.charAt(1)+h.charAt(1),16)/255,this.b=parseInt(h.charAt(2)+h.charAt(2),16)/255,this.a=1,this;if(6===f)return this.r=parseInt(h.charAt(0)+h.charAt(1),16)/255,this.g=parseInt(h.charAt(2)+h.charAt(3),16)/255,this.b=parseInt(h.charAt(4)+h.charAt(5),16)/255,this.a=1,this;if(8===f)return this.r=parseInt(h.charAt(0)+h.charAt(1),16)/255,this.g=parseInt(h.charAt(2)+h.charAt(3),16)/255,this.b=parseInt(h.charAt(4)+h.charAt(5),16)/255,this.a=parseInt(h.charAt(6)+h.charAt(7),16)/255,this}return this}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.r+=e.r,this.g+=e.g,this.b+=e.b,t&&(this.a+=e.a),this}},{key:"addColors",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,n&&(this.a=e.a+t.a),this}},{key:"addScalar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.r+=e,this.g+=e,this.b+=e,t&&(this.a+=e),this}},{key:"sub",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),t&&(this.a=Math.max(0,this.a-e.a)),this}},{key:"multiply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.r*=e.r,this.g*=e.g,this.b*=e.b,t&&(this.a*=e.a),this}},{key:"multiplyScalar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.r*=e,this.g*=e,this.b*=e,t&&(this.a*=e),this}},{key:"lerp",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,n&&(this.a+=(e.a-this.a)*t),this}},{key:"lerpAlpha",value:function(e,t,n){return this.a=e+(t-e)*n,this}},{key:"equals",value:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b&&e.a===this.a}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this.a=e[t+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,e}},{key:"getAvg",value:function(){return(this.r+this.g+this.b+this.a)/4}}],[{key:"TransparentWhite",value:function(){return new t(1,1,1,0)}},{key:"TransparentBlack",value:function(){return new t(0,0,0,0)}}])}(Ft.v);function Jr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jr=function(){return!!e})()}var ei=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Jr()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"execute",value:function(e,t){var n=this,r=e.svgEngine.getObjects(),i=new Map,a=new Map;r.forEach((function(e){if(e.element.type&&"group"!==e.element.type){var r=n.getColor(e,t);0!==r.length&&(i.has(r)?i.get(r).push(e):i.set(r,[e]),a.set(e.uuid,{fill:e.element.fill,fillOpacity:e.element.fillOpacity,stroke:e.element.stroke,strokeOpacity:e.element.strokeOpacity,backgroundColor:e.element.backgroundColor,opacity:e.element.opacity}))}})),e.palette=i,e.originalColors=a}},{key:"getColor",value:function(e,t){if(!Array.isArray(e.element.colorProperties)||0===e.element.colorProperties.length)return"";if(e.element.hasFill()&&"string"!=typeof e.element.fill){if("linear"===e.element.fill.type||"radial"===e.element.fill.type){var n=e.element.fill.colorStops[0];return this.convertToHex(n.color,t)}return""}return this.convertToHex(e.element.fill,t)}},{key:"convertToHex",value:function(e,t){switch(t.transparency_mode){case"allow":case"ignore":return"".concat(new Qr(e).getHexString());default:return"".concat(new Ft.v(e).getHexString())}}}])}(Hr);function ti(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ni(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ni(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ni(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ri(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ri=function(){return!!e})()}var ii=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,ri()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mColorDistanceMethod","manhattan"),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"execute",value:function(e,t){var n=e.palette,r=t.maxColors||1;if(!(n.size<=r)){for(var i=.01;n.size>r;){for(var s=Array.from(n.keys()),u=0;u<s.length;u++)if(n.has(s[u]))for(var c=0;c<s.length;c++)if(n.has(s[c])&&u!==c){var l=s[u],h=s[c],f=Vr(l),m=Vr(h);if(this.colorDistance(f,m)<=i){var p,d=n.get(h);n.delete(h),(p=n.get(l)).push.apply(p,(0,a.A)(d))}if(n.size<=r)break}i+=.005}var v,y=ti(n);try{var g=function(){var e=(0,o.A)(v.value,2),t=e[0];e[1].forEach((function(e){e.element.hasFill()&&(e.element.fill=t),e.element.hasStroke()&&(e.element.stroke=t)}))};for(y.s();!(v=y.n()).done;)g()}catch(e){y.e(e)}finally{y.f()}}}},{key:"colorDistance",value:function(e,t){return"euclidean"===this.mColorDistanceMethod?function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ur,i=t[0]-e[0],a=t[1]-e[1],o=t[2]-e[2];return Math.sqrt((r.r*(i*i)+r.g*(a*a)+r.b*(o*o))/(65025*(n=r).r+65025*n.g+65025*n.b))}(e,t):zr(e,t)}}])}(Hr);function ai(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return oi(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oi(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function oi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function si(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(si=function(){return!!e})()}var ui=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,si()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"execute",value:function(e,t){var n,r=this,i=e.palette,a=ai(e.paletteOverride);try{var s,u=function(){var e=(0,o.A)(n.value,2),a=e[0],s=e[1];if(!s)return{v:void 0};var u=i.get(a);if(!u)return{v:void 0};u.forEach((function(e){var n=r.applyTransparentModeToColor(e,s,t);r.overrideColor(e.element,n.color,n.opacity)}))};for(a.s();!(n=a.n()).done;)if(s=u())return s.v}catch(e){a.e(e)}finally{a.f()}}},{key:"overrideColor",value:function(e,t,n){var r=e.colorProperties;Array.isArray(r)&&r.length>0?(r.forEach((function(n){h.N5.isNonEmptyString(e[n])&&(e[n]=t)})),e.clipPath&&this.overrideColor(e.clipPath,t,n)):e.hasFill()&&(e.fill=t),e.opacity=n,e.fillOpacity=n}},{key:"applyTransparentModeToColor",value:function(e,t,n){var r=t,i=1;switch(n.transparency_mode){case"allow":9===r.length&&(i=parseInt(r.charAt(7)+r.charAt(8),16)/255),r=r.slice(0,7).padEnd(7,"F");break;case"ignore":r=r.slice(0,7).padEnd(7,"F"),i=void 0!==e.element.fillOpacity&&null!==e.element.fillOpacity?e.element.fillOpacity:void 0!==e.element.opacity&&null!==e.element.opacity?e.element.opacity:1;break;default:r=r.slice(0,7).padEnd(7,"F"),i=1}return{color:r,opacity:i}}}])}(Hr);__webpack_require__(46058);function ci(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ci=function(){return!!e})()}var li=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,ci()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"execute",value:function(e,t){var n=this;e.svgEngine.getObjects().forEach((function(e){n.fixColor(e.element,t)}))}},{key:"fixColor",value:function(e,t){if(Array.isArray(e.colorProperties)&&0!==e.colorProperties.length)if(!e.hasFill()||"string"==typeof e.fill||"linear"!==e.fill.type&&"radial"!==e.fill.type){e.clipPath&&this.fixColor(e.clipPath,t);var n=this.convertToHex(e,e.fill,t);h.N5.isNonEmptyString(n)&&(e.hasFill()&&(e.fill=n),e.hasStroke()&&(e.stroke=n)),h.N5.isNonEmptyString(e.fillRule)&&(e.fillRule="nonzero")}else{var r=e.fill.colorStops[0],i=this.convertToHex(e,r.color,t);h.N5.isNonEmptyString(i)&&(r.color=i)}}},{key:"convertToHex",value:function(e,t,n){if(t){if("currentColor"===t)return e.group?this.convertToHex(e.group,e.group.fill,n):"opaque"===n.transparency_mode?"#000000":"#000000FF";switch(n.transparency_mode){case"allow":case"ignore":return new Qr(t).getHexString();default:return new Ft.v(t).getHexString()}}}}])}(Hr);function hi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hi=function(){return!!e})()}var fi=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,hi()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"execute",value:function(e,t){var n=this;e.svgEngine.getObjects().forEach((function(e){n.removeShadows(e)}))}},{key:"removeShadows",value:function(e){e.element.shadow&&(e.element.shadow=null)}}])}(Hr);function mi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mi=function(){return!!e})()}var pi=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,mi()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"execute",value:function(e,t){}}])}(Hr);function di(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(di=function(){return!!e})()}var vi=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,di()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"execute",value:function(e,t){}}])}(Hr);function yi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yi=function(){return!!e})()}var gi=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,yi()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"renderResolution",1024),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"execute",value:function(e,t){var n=this,r=e.svgEngine.getSvgCanvas(),i=e.svgEngine.getRootGroup(),a=e.svgEngine.getObjects();this.makeNumberSafe(r,"width",this.renderResolution),this.makeNumberSafe(r,"height",this.renderResolution),this.makeNumberSafe(i,"width",r.width),this.makeNumberSafe(i,"height",r.height),i.width<=0&&(i.width=r.width),i.height<=0&&(i.height=r.height),this.makeObjectSafe(i),a.forEach((function(e){n.makeObjectSafe(e.element)}))}},{key:"makeNumberSafe",value:function(e,t,n){e&&void 0!==e[t]&&Number.isNaN(e[t])&&(e[t]=n)}},{key:"makeObjectSafe",value:function(e){var t=this;e&&(this.makeNumberSafe(e,"width",this.renderResolution),this.makeNumberSafe(e,"height",this.renderResolution),this.makeNumberSafe(e,"zoomX",1),this.makeNumberSafe(e,"zoomY",1),this.makeNumberSafe(e,"scaleX",1),this.makeNumberSafe(e,"scaleY",1),this.makeNumberSafe(e,"top",0),this.makeNumberSafe(e,"left",0),e.lineCoords&&Object.keys(e.lineCoords).forEach((function(n){void 0!==e.lineCoords[n].x&&t.makeNumberSafe(e.lineCoords[n],"x",0),void 0!==e.lineCoords[n].y&&t.makeNumberSafe(e.lineCoords[n],"y",0)})),e.aCoords&&Object.keys(e.aCoords).forEach((function(n){void 0!==e.aCoords[n].x&&t.makeNumberSafe(e.aCoords[n],"x",0),void 0!==e.aCoords[n].y&&t.makeNumberSafe(e.aCoords[n],"y",0)})),e.clipPath&&this.makeObjectSafe(e.clipPath))}}])}(Hr);__webpack_require__(11392);function bi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bi=function(){return!!e})()}var Ai=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,bi()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"execute",value:function(e,t){var n=this;e.svgEngine.getObjects().forEach((function(e){n.removeImage(e.element)}))}},{key:"hasImage",value:function(e){return!(!e||"string"!=typeof e)&&(e.startsWith("http")||e.substring(0,50).includes("base64,"))}},{key:"removeImage",value:function(e){var t=this;if(e){if(Array.isArray(e.colorProperties)&&0===e.colorProperties.length?e.colorProperties.forEach((function(n){t.hasImage(e[n])&&delete e[n]})):e.hasFill()&&this.hasImage(e.fill)&&delete e.fill,e.hasFill()&&"string"!=typeof e.fill&&("linear"===e.fill.type||"radial"===e.fill.type)){var n=e.fill.colorStops;Array.isArray(n)&&n.forEach((function(e){t.hasImage(e.color)&&delete e.color}))}"image"===e.type&&this.hasImage(e.getSrc())&&e.setSrc(""),e.clipPath&&this.removeImage(e.clipPath)}}}])}(Hr);function _i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Mi(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mi(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Mi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ki(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ki=function(){return!!e})()}var wi,Ti,xi=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,ki()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"execute",value:function(e,t){var n,r=e.palette,i=e.originalColors,a=_i(r);try{for(a.s();!(n=a.n()).done;){var s,u=_i((0,o.A)(n.value,2)[1]);try{for(u.s();!(s=u.n()).done;){var c=s.value,l=i.get(c.uuid);if(!l)return;this.applyRecoveryObject(c.element,l)}}catch(e){u.e(e)}finally{u.f()}}}catch(e){a.e(e)}finally{a.f()}}},{key:"applyRecoveryObject",value:function(e,t){e.fill=t.fill,e.fillOpacity=t.fillOpacity,e.stroke=t.stroke,e.strokeOpacity=t.strokeOpacity,e.backgroundColor=t.backgroundColor,e.opacity=t.opacity}}])}(Hr),Si=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mOptimizeHandler",void 0),(0,c.A)(this,"mAnalyzeHandler",void 0),(0,c.A)(this,"mPalletizeHandler",void 0),(0,c.A)(this,"mRecoverHandler",void 0),this.mOptimizeHandler=this.setHandlers([new gi,new Ai,new Kr,new qr,new li,new Yr,new fi,new pi,new vi]),this.mAnalyzeHandler=this.setHandlers([new ei,new ii]),this.mPalletizeHandler=this.setHandlers([new ui]),this.mRecoverHandler=this.setHandlers([new xi])}),[{key:"optimize",value:(a=(0,n.A)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mOptimizeHandler.handle(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"analyze",value:(r=(0,n.A)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mAnalyzeHandler.handle(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"palletize",value:(t=(0,n.A)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mPalletizeHandler.handle(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"recover",value:(e=(0,n.A)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mRecoverHandler.handle(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(t,n){return e.apply(this,arguments)})},{key:"setHandlers",value:function(e){for(var t=1;t<e.length;t++)e[t-1].setNext(e[t]);return e[0]}}]);var e,t,r,a}(),Ci=__webpack_require__(27046),Ei=function(){return(0,u.A)((function e(t){if((0,s.A)(this,e),(0,c.A)(this,"mOptions",void 0),(0,c.A)(this,"mEngine",void 0),this.mOptions=t,1===this.mOptions.version)this.mEngine=new Si;else v.UX.warn("Version is not provided to svg palletization. Using latest version instead."),this.mEngine=new Si}),[{key:"optimize",value:(o=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mEngine.optimize(t,this.mOptions);case 2:t.optimized=!0;case 3:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"analyze",value:(a=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mEngine.analyze(t,this.mOptions);case 2:t.analyzed=!0;case 3:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"palletize",value:(r=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mEngine.palletize(t,this.mOptions);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"recover",value:(t=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mEngine.recover(t,this.mOptions);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"render",value:function(e){return e.svgEngine.getRootGroup().dirty=!0,e.svgEngine.getObjects().forEach((function(e){e.element.dirty=!0})),e.svgEngine.render(),e.canvas}}],[{key:"create",value:(e=(0,n.A)(i().mark((function e(t,n,r){var a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=new Ci.L,e.next=3,a.create(t,n,r);case 3:return o=e.sent,e.abrupt("return",{svgEngine:a,canvas:o.canvas,palette:new Map,paletteOverride:new Map,originalColors:new Map,optimized:!1,analyzed:!1});case 5:case"end":return e.stop()}}),e)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"destroy",value:function(e){e&&(e.svgEngine&&(e.svgEngine.destroy(),delete e.svgEngine),e.canvas&&delete e.canvas,e.palette&&(e.palette.clear(),delete e.palette),e.paletteOverride&&(e.paletteOverride.clear(),delete e.paletteOverride),e.optimized=!1,e.analyzed=!1)}}]);var e,t,r,a,o}(),Ri={sanitizeColors:function(e){for(var t=0;t<e.palletization_colors.length;t++){var n=e.palletization_colors[t].color;e.palletization_colors[t].color=this.sanitizeColor(n,e.palletization_transparency_mode)}},sanitizeColor:function(e,t){if("#"!==e[0]&&(e="#".concat(e)),"allow"===t)9!==e.length&&(e=e.slice(0,9).padEnd(9,"F"));else e.length>7&&(e=e.slice(0,7).padEnd(7,"F"));return e.toUpperCase()},createTexture:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,n=document.createElement("canvas");return n.width=t,n.height=t,n.style.display="none",document.body.appendChild(n),R.K.renderer().getRenderEngine().createTextureCanvas(e,n,!0,void 0,void 0,void 0,void 0,void 0,void 0,!1,Cn.nC.RGBA,void 0,4)},clearPalettes:function(e){e.palette=[],e.palette_override=[]},applyPalletization:function(e,t,r,a,o,s){var u=this;return(0,n.A)(i().mark((function n(){var a,c;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=new Ei({version:o.version,maxColors:o.max_colors||1,transparency_mode:o.transparency_mode}),e){n.next=7;break}return v.UX.print("Svg Palletization: creating context for object:",s.object_id),n.next=6,Ei.create(r,1024,t);case 6:e=n.sent;case 7:if(e.optimized){n.next=11;break}return v.UX.print("Svg Palletization: optimizing object:",s.object_id),n.next=11,a.optimize(e);case 11:if(e.analyzed){n.next=20;break}if(!(e.palette.size>0)){n.next=16;break}return v.UX.print("Svg Palletization: reverting to original colors before analyzing:",s.object_id),n.next=16,a.recover(e);case 16:return v.UX.print("Svg Palletization: analyzing object:",s.object_id),n.next=19,a.analyze(e);case 19:s.palette=Array.from(e.palette.keys());case 20:if(s.palette&&s.palette.length>0)for(o.allowed_colors=o.allowed_colors.filter((function(e){return e.visible})),u.applyPalletizationOverrides(s,o),e.paletteOverride.clear(),c=0;c<s.palette.length;c++)e.paletteOverride.set(s.palette[c],s.palette_override[c]);if(!(e.optimized&&e.analyzed&&e.palette&&e.palette.size>0&&e.paletteOverride&&e.paletteOverride.size>0)){n.next=24;break}return n.next=24,a.palletize(e);case 24:return n.abrupt("return",{context:e,render:a.render(e)});case 25:case"end":return n.stop()}}),n)})))()},applyPalletizationOverrides:function(e,t){for(var n,r,i=this.sanitizeColor(null!==(n=null===(r=t.allowed_colors[0])||void 0===r?void 0:r.color)&&void 0!==n?n:"#FFFFFF",t.transparency_mode),a=function(n){if(!e.palette_override[n])return 1;var r=t.allowed_colors.find((function(t){return t.color===e.palette_override[n]}));r&&r.visible||(e.palette_override[n]=null)},s=0;s<e.palette.length;s++)a(s);if(e.palette.length!==e.palette_override.filter((function(e){return!!e})).length){for(var u=new Map,c=function(){var n,r,a,s,c=Vr(e.palette[l]),h={index:l,locked:!1,selectedIndex:0,palette:[]};t.allowed_colors.forEach((function(e,t){h.palette.push({index:t,distance:zr(Vr(e.color),c),color:e.color,visible:e.visible})})),h.palette.sort((function(e,t){return e.distance-t.distance}));var f=h.palette.filter((function(e){return e.visible})),m=(0,o.A)(f,1)[0];h.locked=(null!==(n=null==m?void 0:m.distance)&&void 0!==n?n:1/0)<=.05,h.selectedIndex=null!==(r=null==m?void 0:m.index)&&void 0!==r?r:0,u.set(e.palette[l],h),e.palette_override[l]=null!==(a=null===(s=t.allowed_colors[null==m?void 0:m.index])||void 0===s?void 0:s.color)&&void 0!==a?a:i},l=0;l<e.palette.length;l++)c();if(0!==t.allowed_colors.length){v.UX.print("SVG Palletization: Originally chosen colors:",u,JSON.parse(JSON.stringify(t.allowed_colors)),JSON.parse(JSON.stringify(e.palette_override)));var h=Math.floor(e.palette.length/Math.max(t.allowed_colors.length,1)),f=function(){var e=new Map;return t.allowed_colors.forEach((function(t,n){e.set(t.color,{index:n,count:0,visible:t.visible})})),u.forEach((function(n){var r=t.allowed_colors[n.selectedIndex],i=e.get(r.color);i&&i.count++})),e}(),m=Array.from(f),p=m.filter((function(e){return 0===e[1].count&&e[1].visible}));0!==m.filter((function(e){return e[1].count>h&&e[1].visible})).length?(v.UX.print("SVG Palletization: We need to randomize override colors:",e.palette.length,t.allowed_colors.length,e.palette_override.length),p.forEach((function(e){var n=(0,o.A)(e,2),r=n[0],i=n[1],a=Array.from(u).map((function(e){var n=(0,o.A)(e,2),i=n[0],a=n[1],s=a.palette.find((function(e){return t.allowed_colors[e.index].color===r})),u=f.get(t.allowed_colors[a.selectedIndex].color);return{originalColor:i,allowedColorIndex:u.index,distance:s.distance,count:u.count,locked:a.locked,visible:u.visible}}));a.sort((function(e,t){return t.count-e.count}));var s,c=a[0].count,l=a.filter((function(e){return!e.locked&&e.visible})),h=a.filter((function(e){return e.count===c&&!e.locked&&e.visible})).sort((function(e,t){return e.distance-t.distance})),p=(0,o.A)(h,1)[0];p||(p=null!==(s=l[0])&&void 0!==s?s:a[0]);var d=t.allowed_colors[p.allowedColorIndex],v=m.find((function(e){return(0,o.A)(e,1)[0]===d.color})),y=(0,o.A)(v,2)[1];u.get(p.originalColor).selectedIndex=i.index,y.count--,i.count++})),u.forEach((function(n){e.palette_override[n.index]=t.allowed_colors[n.selectedIndex].color}))):v.UX.print("SVG Palletization: No need to randomize colors!",t.allowed_colors,e.palette_override)}else v.UX.print("SVG Palletization: Terminate palletization process, as no allowed colors are available. Fallback colors are assigned instead.")}},generateHash:function(e){return f.V.Md5(JSON.stringify({object_id:e.object_id,palette:e.palette,overrides:e.palette_override}))},destroyContext:function(e){Ei.destroy(e)}};function Ii(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ii(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ii(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Di(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Di=function(){return!!e})()}(Ti=wi||(wi={})).PROCESSED_FILE="processed_file",Ti.ORIGINAL_FILE="original_file";var Pi=function(e){function t(e,n){var r,i,a,o;(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Di()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mValue",{image_source:"",original_image_source:"",media_id:null,print_ready_file_id:null,svg_element:null,clipping_element:null,offset:[],size:null,scale:1,rotation:0,value_output:wi.PROCESSED_FILE,palletization:{settings:{enabled:!1,version:1,max_colors:1,allowed_colors:[],transparency_mode:"opaque"}}}),(0,c.A)(r,"mUpdateEvent",new M.B),(0,c.A)(r,"mOriginalImageSource",void 0),(0,c.A)(r,"mPalletizationContext",void 0),(0,c.A)(r,"mPalletizationTexture",void 0),(0,c.A)(r,"mPalletizationDirtyFlag",void 0),r.mUpdateEvent.pipe((0,Bn.L)((function(e){return(0,xn.H)(r.processUpdateEvent(e))})),(0,Fn.W)((function(e,t){return t}))).subscribe({next:function(){v.UX.print("Image upload updated."),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))},error:function(e){v.UX.warn("Failed to update image upload (pipeline):",e)}});var u,l,f=r.resolveValuable();f&&(Array.isArray(f.palletization_colors)&&Ri.sanitizeColors(f),r.mValue={size:(0,h.uI)(f.size_type)?f.size_type:"cover",scale:f.allow_scaling&&(0,h.kf)(f.scale)?Number(f.scale):void 0,rotation:f.allow_rotation&&(0,h.kf)(f.rotation)?Number(f.rotation):void 0,offset:[f.allow_offset&&(0,h.kf)(f.offset_x)?Number(f.offset_x):0,f.allow_offset&&(0,h.kf)(f.offset_y)?Number(f.offset_y):0],palletization:{settings:{enabled:f.allow_palletization,version:1,max_colors:null!==(u=f.palletization_max_colors)&&void 0!==u?u:1,allowed_colors:f.allow_palletization?f.palletization_colors.slice(0):[],transparency_mode:null!==(l=f.palletization_transparency_mode)&&void 0!==l?l:"opaque"}}},r.updateValues(),r.mUpdateEvent.next({broadcast_options:{emitEvent:!1,rebuild:!0}}));return r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"processUpdateEvent",value:(l=(0,n.A)(i().mark((function e(t){var n,r,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,r=JSON.parse(JSON.stringify(this.resolveValuable())),a=JSON.parse(JSON.stringify(this.mValue)),void 0!==r.media_id&&r.svg_element){e.next=6;break}return this.broadcast(t.broadcast_options),e.abrupt("return");case 6:if(!r.allow_palletization){e.next=10;break}return e.next=9,this.processPalletization(r,a);case 9:a.image_source=e.sent;case 10:return e.next=12,this.resolveSvgTextureController(r.print_ready_file_id);case 12:return o=e.sent,e.next=15,o.updateImage(r.svg_element,null!==(n=a.image_source)&&void 0!==n?n:null,a,r,this.mPalletizationContext);case 15:R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),v.UX.error("Failed in processUpdateEvent:",e.t0);case 21:return e.prev=21,this.broadcast(t.broadcast_options),e.finish(21);case 24:case"end":return e.stop()}}),e,this,[[0,18,21,24]])}))),function(e){return l.apply(this,arguments)})},{key:"getType",value:function(){return t.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){var e,t=this.mAttributeData.attribute_values[0].attribute_value_valuable;this.mValue.palletization.settings.enabled=t.allow_palletization,this.mValue.palletization.settings.enabled&&!t.external_colors&&(this.mValue.palletization.settings.allowed_colors=t.palletization_colors.slice(0)),this.mValue.media_id=t.media_id,this.mValue.print_ready_file_id=t.print_ready_file_id,this.mValue.svg_element=t.svg_element,this.mValue.clipping_element=t.clipping_element,this.mValue.value_output=null!==(e=t.value_output)&&void 0!==e?e:wi.PROCESSED_FILE,this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:void 0,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){if(e){var n=this.resolveValuable();if("string"!=typeof e&&e){var r=e;r.palletization&&(this.copyValueFromPalletization(r,n),delete r.palletization),this.mValue=Oi(Oi({},this.mValue),r)}else this.mValue.image_source=e;n.allow_palletization&&this.updatePalletizationObject(),this.updateValues(),this.dispatchToRenderer(t).then((function(){})).catch((function(e){v.UX.error(e)}))}}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"copyValueFromPalletization",value:function(e,t){var n=this;e.palletization&&(e.palletization.settings&&Array.isArray(e.palletization.settings.allowed_colors)&&t.external_colors&&(this.mValue.palletization.settings.allowed_colors.splice(0),e.palletization.settings.allowed_colors.forEach((function(e,t){var r,i,a=kn(e.color,"hex");a&&n.mValue.palletization.settings.allowed_colors.push({name:null!==(r=e.name)&&void 0!==r?r:a,color:a,position:null!==(i=e.position)&&void 0!==i?i:t,visible:!1!==e.visible})})),this.mValue.palletization.object&&(this.mValue.palletization.object.palette_override=[],this.mPalletizationDirtyFlag=!0)),e.palletization.object?(this.mValue.palletization.object||(this.mValue.palletization.object={object_id:null,hash:"",palette:[],palette_override:[]}),this.mValue.palletization.object.object_id=e.palletization.object.object_id,e.palletization.object.palette_override&&(this.mValue.palletization.object.palette_override=e.palletization.object.palette_override.slice(0),this.mPalletizationDirtyFlag=!0)):this.disposePalletizationObject())}},{key:"updatePalletizationObject",value:function(){this.mValue.image_source||!this.mValue.palletization.object?this.mValue.image_source&&!this.mValue.palletization.object&&(this.mValue.palletization.object={object_id:null,hash:"",palette:[],palette_override:[]}):this.disposePalletizationObject()}},{key:"compareValue",value:function(e){return e===this.getValue().image_source}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){var e,t=this.getValue(),n=t.value_output===wi.PROCESSED_FILE?t.image_source:null!==(e=t.original_image_source)&&void 0!==e?e:t.image_source;if(!n)return"";var r=[];return r.push("".concat(n)),h.N5.isNumeric(t.scale)&&r.push("@scale:".concat(t.scale,";")),h.N5.isNumeric(t.rotation)&&r.push("@rotation:".concat(t.rotation,";")),r.join(" ")}},{key:"resetValue",value:function(e){this.mValue.image_source="",this.mValue.original_image_source="",delete this.mValue.value,this.broadcast(e)}},{key:"parse",value:function(e,t){if("string"==typeof e)return this.setValue(e,t);if(e&&void 0!==e.image_source&&null!==e.image_source){var n,r,i,a,o=e;if(!e.palletization&&o.palletization_palette)e.palletization={settings:{enabled:Boolean(null!==(n=null!==(r=o.allow_palletization)&&void 0!==r?r:o.palletization_enabled)&&void 0!==n&&n),version:Number(null!==(i=o.palletization_version)&&void 0!==i?i:1),max_colors:Number(null!==(a=o.palletization_max_colors)&&void 0!==a?a:1),allowed_colors:o.palletization_colors,transparency_mode:o.palletization_transparency_mode},object:{object_id:null,hash:"",palette:Array.isArray(o.palletization_palette)?o.palletization_palette.slice(0):[],palette_override:Array.isArray(o.palletization_palette_override)?o.palletization_palette_override.slice(0):[]}};this.setValue(e,t)}}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"dispatchToRenderer",value:(o=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.mUpdateEvent.next({broadcast_options:t});case 1:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"processPalletization",value:(a=(0,n.A)(i().mark((function e(t,n){var r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.image_source,n.palletization.object){e.next=4;break}return this.disposePalletizationObject(),e.abrupt("return","");case 4:if(a=this.mPalletizationDirtyFlag,this.mOriginalImageSource!==r&&(this.mOriginalImageSource=r,a=!0),0===n.palletization.object.palette_override.length&&(a=!0),!(this.mOriginalImageSource&&h.N5.isSvg(this.mOriginalImageSource)&&a)){e.next=13;break}return this.mPalletizationDirtyFlag=!1,this.mPalletizationTexture||(this.mPalletizationTexture=Ri.createTexture("svg-image-palletization")),e.next=12,this.executePalletization(t,n,n.palletization.object);case 12:r=e.sent;case 13:return e.abrupt("return",r);case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"executePalletization",value:(r=(0,n.A)(i().mark((function e(t,n,r){var a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.image_source,e.prev=1,e.next=4,Ri.applyPalletization(this.mPalletizationContext,this.mPalletizationTexture,this.mOriginalImageSource,t,n.palletization.settings,r);case 4:o=e.sent,this.mPalletizationContext=o.context,this.mValue.palletization.object&&(this.mValue.palletization.object.palette=n.palletization.object.palette.slice(0),this.mValue.palletization.object.palette_override=n.palletization.object.palette_override.slice(0),this.mValue.palletization.object.hash=Ri.generateHash(n.palletization.object)),a=o.render.toDataURL(),e.next=18;break;case 10:e.prev=10,e.t0=e.catch(1),v.UX.error("Unable to palletize image:",e.t0),this.mOriginalImageSource="",n.image_source="",this.mValue.image_source="",this.mValue.original_image_source="",a="";case 18:return e.abrupt("return",a);case 19:case"end":return e.stop()}}),e,this,[[1,10]])}))),function(e,t,n){return r.apply(this,arguments)})},{key:"setVisibilityPalletizationColors",value:function(e){var t=this;this.mPalletizationDirtyFlag=!1;var n=this.resolveValuable(),r={};Object.keys(e).forEach((function(t){var i=Ri.sanitizeColor(t,n.palletization_transparency_mode);r[i]=e[t]})),null==n||n.palletization_colors.forEach((function(e){e.visible=!Object.keys(r).includes(e.color)||!r[e.color]})),this.mValue.palletization.settings.allowed_colors.forEach((function(e){e.visible=!Object.keys(r).includes(e.color)||!r[e.color],t.mPalletizationDirtyFlag=!0}));var i={emitEvent:!1,rebuild:!1};this.processUpdateEvent({broadcast_options:i}).then((function(){t.broadcastAttributeUpdated(i)})).catch((function(e){v.UX.error(e)}))}},{key:"disposePalletizationObject",value:function(){this.mValue.palletization.object&&(Ri.clearPalettes(this.mValue.palletization.object),delete this.mValue.palletization.object),this.mPalletizationContext&&(Ri.destroyContext(this.mPalletizationContext),delete this.mPalletizationContext),this.mPalletizationTexture&&(this.mPalletizationTexture.dispose(),delete this.mPalletizationTexture)}}]);var r,a,o,l}(Er);function Bi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bi(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ni(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ni=function(){return!!e})()}function Li(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Pi,"TypeRTTI",new le.O("AttributeSvgImageController",Er.TypeRTTI));var ji=function(e){function t(e,n){var r,i,a,o;(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Ni()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mValue",{name:"",media_id:null,print_ready_file_id:null,selected_media_id:null,svg_element:null}),(0,c.A)(r,"mUpdateEvent",new M.B),r.mUpdateEvent.pipe((0,Bn.L)((function(){return(0,xn.H)(r.processUpdateEvent())})),(0,Fn.W)((function(e,t){return t}))).subscribe({next:function(){v.UX.print("Svg Image Selector updated."),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))},error:function(e){v.UX.warn("Failed to update svg image selector:",e)}});var u=r.resolveValuable();if(u&&Array.isArray(u.attributes)&&u.attributes.length>0){var l=u.attributes.find((function(e){return h.N5.isTrue(e.default)})),f=null!=l?l:u.attributes[0];r.mValue={key:f.key,name:f.name,selected_media_id:f.selected_media_id,media_id:u.media_id,print_ready_file_id:u.print_ready_file_id,svg_element:u.svg_element},r.updateValues(),r.mUpdateEvent.next()}return r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){if((0,h.Kg)(e)){var n=this.mAttributeData.attribute_values[0].attribute_value_valuable,r=n.attributes.find((function(t){return t.key===e}));r&&(this.mValue={key:r.key,media_id:n.media_id,print_ready_file_id:n.print_ready_file_id,svg_element:n.svg_element,name:r.name,selected_media_id:r.selected_media_id})}else this.mValue=Fi(Fi({},this.mValue),e);this.updateValues(),this.dispatchToRenderer(t).then((function(){R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))}),(function(e){v.UX.error(e)})),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"compareValue",value:function(e){return e==this.getValue().key}},{key:"getValue",value:function(){if(this.mAttributeData.attribute_values.length>0){var e=this.mAttributeData.attribute_values[0].attribute_value_valuable;e&&(this.mValue.media_id=e.media_id,this.mValue.print_ready_file_id=e.print_ready_file_id,this.mValue.svg_element=e.svg_element,this.mValue.scale=e.scale)}return this.mValue}},{key:"getValueName",value:function(){return this.getValue().name}},{key:"resetValue",value:function(e){this.mValue.name="",delete this.mValue.selected_media_id,delete this.mValue.value,this.broadcast(e)}},{key:"setVisibility",value:function(e,n){if(!this.visibleOnFrame)return Li(t,"setVisibility",this,3)([!1]);if(n&&Number.isSafeInteger(n.option_id))try{var r=this.mAttributeData.attribute_values[0].attribute_value_valuable.attributes.find((function(e){return e.key===n.option_id}));r&&(r.visible=e)}catch(e){v.UX.print("failed to get svg valuable: ",e)}else Li(t,"setVisibility",this,3)([e,n])}},{key:"parse",value:function(e,t){e&&this.setValue(e,t)}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"dispatchToRenderer",value:(a=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.mUpdateEvent.next();case 1:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"processUpdateEvent",value:(r=(0,n.A)(i().mark((function e(){var t,n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.resolveSvgTextureController(t.print_ready_file_id);case 5:return n=e.sent,r=this.getValue(),e.next=9,tn.u.getInstance().resolveModel(r.selected_media_id);case 9:return a=e.sent,e.next=12,n.updatePattern(t.svg_element,a.source_url,r);case 12:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}]);var r,a}(Er);(0,c.A)(ji,"TypeRTTI",new le.O("AttributeSvgImageSelectorController",Er.TypeRTTI));var Ui=/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,Vi=function(e){return e?String(e).replace(Ui,""):e};function zi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zi(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gi=function(){return!!e})()}var qi=function(e){function t(e,n){var r,i,a,o;(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Gi()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mValue",{text:"",media_id:null,print_ready_file_id:null,svg_element:null,clipping_element:null,multiline:!1,autoScale:!1,autoScaleFitRatio:1,font:null,fontWeight:"normal",fontStyle:"normal",underline:!1,lineHeight:1.16,charSpacing:0,size:null,offset:[0,0],rotation:0,scale:0,color:null,opacity:1,color_output:null,styles:null,align:"center",flipX:!1,flipY:!1}),(0,c.A)(r,"mUpdateEvent",new M.B),r.mUpdateEvent.pipe((0,Bn.L)((function(){return(0,xn.H)(r.processUpdateEvent())})),(0,Fn.W)((function(e,t){return t}))).subscribe({next:function(){v.UX.print("Svg Text updated."),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))},error:function(e){v.UX.warn("Failed to update text:",e)}});var u=r.resolveValuable();return u&&(r.mValue.text=u.text,r.mValue.print_ready_file_id=u.print_ready_file_id,r.mValue.media_id=u.media_id,r.mValue.svg_element=u.svg_element,r.mValue.clipping_element=u.clipping_element,r.mValue.multiline=u.multiline,r.mValue.autoScale=u.auto_scale,r.mValue.autoScaleFitRatio=u.auto_scale_fit_ratio,r.mValue.font=Array.isArray(u.available_fonts)&&u.available_fonts.length>0?u.available_fonts[0]:void 0,r.mValue.size=h.N5.isNumeric(u.font_size)?u.font_size:void 0,r.mValue.scale=u.allow_scaling&&h.N5.isNumeric(u.scale)?u.scale:void 0,r.mValue.rotation=u.allow_rotation&&h.N5.isNumeric(u.rotation)?u.rotation:void 0,r.mValue.offset=[u.allow_offset&&h.N5.isNumeric(u.offset_x)?u.offset_x:0,u.allow_offset&&h.N5.isNumeric(u.offset_y)?u.offset_y:0],r.applyTextRestrictions(),r.updateValues(),r.mUpdateEvent.next()),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){var n=this;if("string"==typeof e?this.mValue.text=e:(this.mValue=Hi(Hi({},this.mValue),e),this.mValue.styles=this.fixTextStyles(this.mValue.styles)),this.mValue.text=Vi(this.mValue.text),this.applyTextRestrictions(),"string"==typeof this.mValue.color&&(this.mValue.color_output=kn(this.mValue.color,this.mAttributeData.meta.output_color_format)),this.updateValues(),this.mValue.multiline&&this.isExtendedEditorViewSelected()){var r=Hi({},this.getValue()),i=this.resolveValuable();this.resolveSvgTextureController(i.print_ready_file_id).then((function(e){e.getCurrentRawTextFromObject(i.svg_element,r).then((function(e){n.mValue.text=e,n.updateValues(),n.dispatchToRenderer(t).then((function(){n.broadcast(t)}),(function(e){v.UX.error(e),n.broadcast(t)}))}),(function(e){v.UX.error(e),n.broadcast(t)}))}),(function(e){v.UX.error(e),n.broadcast(t)}))}else this.dispatchToRenderer(t).then((function(){}),(function(e){v.UX.error(e)})),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"compareValue",value:function(e){return e==this.getValue().text}},{key:"getValue",value:function(){if(this.mAttributeData.attribute_values.length>0){var e=this.mAttributeData.attribute_values[0].attribute_value_valuable;e&&(this.mValue.media_id=e.media_id,this.mValue.print_ready_file_id=e.print_ready_file_id,this.mValue.svg_element=e.svg_element,this.mValue.clipping_element=e.clipping_element,this.mValue.multiline=e.multiline,this.mValue.autoScale=e.auto_scale,this.mValue.autoScaleFitRatio=e.auto_scale_fit_ratio)}return this.mValue}},{key:"getValueName",value:function(){if(!this.getValue().text||this.getValue().styles)return this.getValue().text;var e=[];return e.push("".concat(this.getValue().text)),this.mValue.size&&e.push("@size:".concat(this.mValue.size,";")),this.mValue.font&&e.push("@font:".concat(this.mValue.font,";")),e.join(" ")}},{key:"resetValue",value:function(e){this.mValue.text="",delete this.mValue.value,this.broadcast(e)}},{key:"parse",value:function(e,t){e&&this.setValue(e,t)}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"destroy",value:function(){var e,n,r,i,a;this.mUpdateEvent.unsubscribe(),(e=t,n="destroy",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}},{key:"applyTextRestrictions",value:function(){var e,t,n=this.resolveValuable();this.mValue.multiline&&n&&(this.restrictTextLength(this.mValue,n.max_length||0),this.isExtendedEditorViewSelected()&&(this.restrictMaxCharsPerLine(this.mValue,(null===(e=this.mAttributeData.meta)||void 0===e?void 0:e.maxCharactersForEachLine)||0),this.restrictMaxLines(this.mValue,(null===(t=this.mAttributeData.meta)||void 0===t?void 0:t.maxLineBreaks)||0)))}},{key:"restrictTextLength",value:function(e,t){var n,r;if(0!==t){var i=t+(null!==(n=null===(r=e.text.match(/\n/g))||void 0===r?void 0:r.length)&&void 0!==n?n:0);if(e.text.length>i&&(e.text=e.text.slice(0,i),e.styles)){var a=e.text.split("\n");e.styles.length!==a.length&&(e.styles=e.styles.slice(0,a.length));var o=a[a.length-1],s=e.styles[e.styles.length-1];s&&o.length!==s.length&&(e.styles[e.styles.length-1]=s.slice(0,o.length))}}}},{key:"restrictMaxCharsPerLine",value:function(e,t){if(0!==t){for(var n=e.text.split("\n"),r=!1,i=0;i<n.length;i++){var a=n[i];if(!(a.length<=t)&&(r=!0,n[i]=a.slice(0,t),e.styles)){var o=e.styles[i];(null==o?void 0:o.length)>=t&&(e.styles[i]=o.slice(0,t))}}r&&(e.text=n.join("\n"))}}},{key:"restrictMaxLines",value:function(e,t){if(0!==t){var n,r=e.text.split("\n");if(r.length>t)e.text=r.slice(0,t).join("\n"),(null===(n=e.styles)||void 0===n?void 0:n.length)>t&&(e.styles=e.styles.slice(0,t))}}},{key:"isExtendedEditorViewSelected",value:function(){return this.mAttributeData.meta&&"SvgTextEditorView"===this.mAttributeData.meta.render_function}},{key:"dispatchToRenderer",value:(a=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.mUpdateEvent.next();case 1:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"processUpdateEvent",value:(r=(0,n.A)(i().mark((function e(){var t,n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:return"string"==typeof(n=Hi({},this.getValue())).color?n.color=null!==(r=kn(n.color,"hex"))&&void 0!==r?r:"#000000":delete n.color,e.next=7,this.resolveSvgTextureController(t.print_ready_file_id);case 7:return a=e.sent,e.next=10,a.updateText(t.svg_element,n,t);case 10:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}]);var r,a}(Er);function Wi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wi=function(){return!!e})()}(0,c.A)(qi,"TypeRTTI",new le.O("AttributeSvgTextController",Er.TypeRTTI));var Ki=function(e){function t(e,n){var r,i,a,o;if((0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Wi()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mValue",{value:""}),r.mAttributeData.attribute_values.length){var u=r.mAttributeData.attribute_values[0].attribute_value_valuable;u&&u.value&&(r.mValue.value=u.value)}return r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){"string"==typeof e?this.mValue.value=e:this.mValue=Object.assign(this.mValue,e),this.updateValues(),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"compareValue",value:function(e){return e==this.getValue().value}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){return this.getValue().value}},{key:"resetValue",value:function(e){this.mValue.value="",this.broadcast(e)}},{key:"parse",value:function(e,t){e&&void 0!==e.value&&this.setValue(e.value,t)}},{key:"dispatchToRenderer",value:(r=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})}]);var r}(yn);(0,c.A)(Ki,"TypeRTTI",new le.O("AttributeTextInputController",yn.TypeRTTI));__webpack_require__(13609);var Xi=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mMaterialManager",void 0),(0,c.A)(this,"DEBUG",!1),(0,c.A)(this,"requestFrameSubject",new M.B),this.mMaterialManager=t}),[{key:"destroy",value:function(){this.requestFrameSubject.unsubscribe()}}])}(),Yi=__webpack_require__(4946),$i=__webpack_require__(69567);function Zi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zi(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ji(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ji=function(){return!!e})()}var ea=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Ji()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mDiffuseTexture",void 0),(0,c.A)(e,"mNormalTexture",void 0),(0,c.A)(e,"mResourceHandles",{}),(0,c.A)(e,"mDiffuseCanvas",void 0),(0,c.A)(e,"mNormalCanvas",void 0),(0,c.A)(e,"mSymbolFontFace",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"update",value:(a=(0,n.A)(i().mark((function e(t,n,r,a){var o,s,u,c=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.resolveContext(t,n,r),s=a?a.getSceneObjectId():void 0,e.prev=2,this.mSymbolFontFace&&this.mSymbolFontFace.family===o.symbol.font&&this.mSymbolFontFace.url===o.symbol.fileUrl||!o.symbol.font){e.next=8;break}if(this.mSymbolFontFace=$i.N.getInstance().resolveFontFace(o.symbol.font,o.symbol.fileUrl),!this.mSymbolFontFace||this.mSymbolFontFace.loaded||this.mSymbolFontFace.failed){e.next=8;break}return e.next=8,$i.N.getInstance().waitFontFaceLoaded(this.mSymbolFontFace);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),v.UX.warn("Failed to inject font:",e.t0);case 13:return e.prev=13,e.next=16,this.buildTexture(o);case 16:return u=e.sent,t.material_id in this.mResourceHandles&&this.mResourceHandles[t.material_id].getPoolKey()===s||(t.material_id in this.mResourceHandles&&(this.mMaterialManager.disposeResource(this.mResourceHandles[t.material_id]),delete this.mResourceHandles[t.material_id]),this.mResourceHandles[t.material_id]=this.mMaterialManager.makeResource(t.material_id,void 0,s)),e.next=20,this.mMaterialManager.resolveResource(this.mResourceHandles[t.material_id],(function(e){if(e){if(e instanceof En.k||e instanceof Rn.o?(e.setDiffuseMap(u[0]),e instanceof Rn.o&&e.useAlphaFromDiffuseMap(!0)):(e instanceof On.r||e instanceof In._||e instanceof Dn.r)&&(e.setDiffuseMap(u[0]),e.useAlphaFromDiffuseMap(!0)),"carved"===t.engraving||"relief"===t.engraving){var n=t.engraving_scale/100||.002;if(e instanceof Rn.o){var r=new ee.I(n,n);e.setNormalMap(u[1]),e.setNormalScale(r)}else(e instanceof Yi.u||e instanceof Dn.r)&&(e.setBumpMap(u[1]),e.setBumpScale(n))}e.setTransparent(!0),e.getOpacity()<1e-5&&e.setOpacity(1),e.markDirty(),c.requestFrameSubject.next()}}));case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(13),v.UX.error(e.t1);case 25:case"end":return e.stop()}}),e,this,[[2,10],[13,22]])}))),function(e,t,n,r){return a.apply(this,arguments)})},{key:"destroy",value:function(){var e=this;this.mDiffuseTexture&&(this.mMaterialManager.getTextureManager().disposeTexture(this.mDiffuseTexture),this.mDiffuseTexture=null),this.mNormalTexture&&(this.mMaterialManager.getTextureManager().disposeTexture(this.mNormalTexture),this.mNormalTexture=null),this.mDiffuseCanvas=null,this.mNormalCanvas=null,this.mSymbolFontFace&&delete this.mSymbolFontFace,Object.entries(this.mResourceHandles).forEach((function(t){var n=(0,o.A)(t,2)[1];try{e.mMaterialManager.disposeResource(n)}catch(e){}})),this.mResourceHandles={}}},{key:"buildEngraving",value:function(e,t,n,r,i){(0,P.isNullOrUndefined)(this.mNormalTexture)&&(this.mNormalCanvas=document.createElement("canvas"),this.mNormalCanvas.style.display="none",document.body.appendChild(this.mNormalCanvas),this.mNormalTexture=R.K.renderer().getRenderEngine().createTextureCanvas("text2image:normal:v1",this.mNormalCanvas));var a=this.mNormalTexture.getContext();return a.clearRect(0,0,a.canvas.width,a.canvas.height),a.canvas.width=.5*t,a.canvas.height=.5*i.image.height,e.forEach((function(e){if(a.font="".concat(.5*r,"px '").concat(e.font,"'"),a.textAlign=n,a.textBaseline=i.text.baseline,"relief"===i.engraving.type)a.fillStyle="#f3f3f3",a.shadowColor="#181818",a.shadowBlur=2,a.strokeStyle="#181818",a.lineWidth=1,a.strokeText(e.text,.5*e.left,.5*e.top);else a.fillStyle="#181818",a.shadowColor="#bababa",a.shadowBlur=i.engraving.outline,a.strokeStyle="#bababa",a.lineWidth=.5*i.engraving.outline;a.fillText(e.text,.5*e.left,.5*e.top)})),this.mNormalTexture.markDirty(),this.mNormalTexture}},{key:"buildTexture",value:(r=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r=t.textValue,i=t.font.family,a=t.font.size,o=[],s=0;if(!(0,P.isNullOrUndefined)(t.symbol.font)&&t.symbol.font.length>0&&!(0,P.isNullOrUndefined)(t.symbol.list)&&t.symbol.list.length>0)for(var u,c=/(&(.*?);)/gi,l=function(){if(u.index>s){var e=u.index-s;o.push({text:r.substr(s,e),font:i,left:0,top:0,width:0})}var n=u[2],a=t.symbol.list.findIndex((function(e){return e.name===n}));a>=0&&t.symbol.list[a].enabled&&o.push({text:t.symbol.list[a].glyph_tag,font:t.symbol.font,left:0,top:0,width:0}),s=u.index+u[0].length};null!==(u=c.exec(r));)l();if(s<r.length&&o.push({text:r.substr(s,r.length-s),font:i,left:0,top:0,width:0}),t.symbol.left&&t.symbol.left.length>0&&t.symbol.list&&t.symbol.list.length>0){var h=t.symbol.list.findIndex((function(e){return e.name===t.symbol.left}));h>=0&&t.symbol.list[h].enabled&&o.unshift({text:t.symbol.list[h].glyph_tag,font:t.symbol.font,left:0,top:0,width:0})}if(t.symbol.right&&t.symbol.right.length>0&&t.symbol.list&&t.symbol.list.length>0){var f=t.symbol.list.findIndex((function(e){return e.name===t.symbol.right}));f>=0&&t.symbol.list[f].enabled&&o.push({text:t.symbol.list[f].glyph_tag,font:t.symbol.font,left:0,top:0,width:0})}if(!n.mDiffuseTexture){n.mDiffuseCanvas=document.createElement("canvas"),n.mDiffuseCanvas.style.display="none",document.body.appendChild(n.mDiffuseCanvas);var m=t.options.disableAntiAliasing;n.mDiffuseTexture=R.K.renderer().getRenderEngine().createTextureCanvas("text2image:diffuse:v1",n.mDiffuseCanvas,!0,void 0,Cn.qC.ClampToEdge,Cn.qC.ClampToEdge,m?Cn.wm.Nearest:void 0,m?Cn.wm.Nearest:void 0,m?Cn.wm.None:void 0,void 0,void 0,void 0,m?0:void 0)}var p=n.mDiffuseTexture.getContext();p.clearRect(0,0,p.canvas.width,p.canvas.height);var d=1-a,v=t.image.padding+t.image.height*d,y=t.image.height*t.image.widthRatio;p.canvas.width=y,p.canvas.height=t.image.height;var g=Math.max(t.image.height-v,0),b=Math.max(t.image.height-2*t.image.padding,0),A=0,_=0,M=0;M="alphabetic"===t.text.baseline?.5*t.image.height+.5*b:.5*g+.5*v,o.forEach((function(e){p.font="".concat(g,"px '").concat(e.font,"'"),p.textAlign="left",p.textBaseline="middle";var t=p.measureText(e.text);e.width=t.width+0,A+=e.width}));var k="left";switch(t.text.align){case"left":k="left",_=0;break;case"center":k="left",_=.5*y-.5*A;break;case"right":k="right",_=y}var w=_;n.DEBUG&&(p.strokeStyle="#800080",p.strokeRect(10,0,y-20,M),p.strokeStyle="#ff6a00",p.beginPath(),p.moveTo(10,M),p.lineTo(y-10,M),p.lineWidth=1,p.stroke()),o.forEach((function(e){e.top=M,e.left=w,"right"===t.text.align?w-=e.width:w+=e.width})),o.forEach((function(e){t.text.outline>0&&(p.strokeStyle=t.text.outlineColor,p.lineWidth=t.text.outline,p.strokeText(e.text,e.left,e.top)),p.font="".concat(g,"px '").concat(e.font,"'"),p.textAlign=k,p.textBaseline=t.text.baseline,p.fillStyle=t.text.color,p.fillText(e.text,e.left,e.top)})),n.DEBUG&&(p.strokeStyle="#ff0000",p.beginPath(),p.moveTo(0,.5*t.image.height),p.lineTo(y,.5*t.image.height),p.lineWidth=2,p.stroke(),p.strokeStyle="#ff0000",p.strokeRect(0,0,y,t.image.height),p.strokeStyle="#0000ff",p.strokeRect(0,0,y,t.image.padding),p.strokeRect(0,t.image.height-t.image.padding,y,t.image.padding)),n.mDiffuseTexture.markDirty();var T=[];if(T.push(n.mDiffuseTexture),"carved"===t.engraving.type||"relief"===t.engraving.type){var x=n.buildEngraving(o,y,k,g,t);T.push(x)}else T.push(null);return e(T)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"getTextWidth",value:function(e,t,n){var r=this.resolveContext(e,t,n),i=document.createElement("span"),a=document.createElement("style");i.id="xpv-text-measuring",i.textContent=r.textValue,a.textContent="\n            span#xpv-text-measuring {\n                position: fixed;\n                top: 1px;\n                left: 1px;\n                visibility: hidden;\n                padding: 0;\n                border-width: 0;\n                transform: translate(-100%, -100%);\n                white-space: nowrap;\n                font-size: ".concat(16*r.font.size,"px;\n                font-family: '").concat(r.font.family,"';\n            }\n            span#xpv-text-measuring::before,\n            span#xpv-text-measuring::after { content: none; }\n        "),i.appendChild(a),document.body.appendChild(i);var o=i.getBoundingClientRect().width;return document.body.removeChild(i),o}},{key:"resolveContext",value:function(e,t,n){var r={textValue:(0,P.isNullOrUndefined)(t.value)?e.value||"":t.value,image:{height:e.height||512,widthRatio:e.width_ratio||2.5,padding:e.padding_y||e.padding||0},text:{outline:e.outline||0,color:e.color||"#ffffff",outlineColor:e.outline_color||"#ffffff",align:t.position||e.position||"center",transform:e.text_transform||"none",autoResize:e.auto_resize||!1,resizeThreshold:e.resize_threshold||6,baseline:e.text_baseline||"middle"},font:{size:t.size||1,family:t.font||e.available_fonts&&e.available_fonts[0]||"Arial"},symbol:{font:e.symbol_font||"",list:e.symbol_list||[],fileUrl:e.symbol_file_url,left:t.symbol_left||null,right:t.symbol_right||null},options:Qi({disableAntiAliasing:!1},n),engraving:{type:e.engraving||"none",outline:e.engraving_outline||0,scale:e.engraving_scale||1}};return r.textValue=function(e){switch(r.text.transform){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^| )[a-z]/g,(function(e){return e.toUpperCase()}));case"uppercase":return e.toUpperCase();default:return e}}(r.textValue),r.text.autoResize&&(r.font.size*=Math.min(1,r.text.resizeThreshold/r.textValue.length)),r}},{key:"applyTexturesToModel",value:function(e){if(this.mDiffuseCanvas){var t=this.mDiffuseCanvas.toDataURL("image/png");if("PbrMaterial"===e.type?e.diffuse_map=t:e.map=t,this.mNormalCanvas){var n=this.mNormalCanvas.toDataURL("image/jpeg");"PbrMaterial"===e.type?e.normal_map=n:"MeshToonMaterial"!==e.type&&"MeshPhongMaterial"!==e.type&&"MeshPhongMaterialExt"!==e.type&&"MeshStandardMaterial"!==e.type&&"MeshPhysicalMaterial"!==e.type&&"MeshPhysicalMaterialExt"!==e.type||(e.bump_map=n)}}}}]);var r,a}(Xi);function ta(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function na(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ta(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ta(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ra(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ra=function(){return!!e})()}var ia=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,ra()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mDiffuseTexture",void 0),(0,c.A)(e,"mNormalTexture",void 0),(0,c.A)(e,"mResourceHandles",{}),(0,c.A)(e,"mDiffuseCanvas",void 0),(0,c.A)(e,"mNormalCanvas",void 0),(0,c.A)(e,"mTextMetricsCanvas",void 0),(0,c.A)(e,"mTextFontFace",void 0),(0,c.A)(e,"mSymbolFontFace",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"update",value:(a=(0,n.A)(i().mark((function e(t,r,a,o){var s,u,c,l=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=R.K.renderer().getRenderEngine(),u=this.resolveContext(t,r,a),c=o?o.getSceneObjectId():void 0,e.prev=3,t.material_id in this.mResourceHandles&&this.mResourceHandles[t.material_id].getPoolKey()===c||(t.material_id in this.mResourceHandles&&(this.mMaterialManager.disposeResource(this.mResourceHandles[t.material_id]),delete this.mResourceHandles[t.material_id]),this.mResourceHandles[t.material_id]=this.mMaterialManager.makeResource(t.material_id,void 0,c)),e.next=7,this.mMaterialManager.resolveResource(this.mResourceHandles[t.material_id],function(){var e=(0,n.A)(i().mark((function e(n){var r,a,o,c,h;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:if(l.mTextFontFace&&l.mTextFontFace.family===u.font.family||!u.font.family||(l.mTextFontFace=$i.N.getInstance().resolveFontFace(u.font.family)),l.mSymbolFontFace&&l.mSymbolFontFace.family===u.symbol.font&&l.mSymbolFontFace.url===u.symbol.fileUrl||!u.symbol.font||(l.mSymbolFontFace=$i.N.getInstance().resolveFontFace(u.symbol.font,u.symbol.fileUrl)),(!l.mTextFontFace||l.mTextFontFace.loaded||l.mTextFontFace.failed)&&(!l.mSymbolFontFace||l.mSymbolFontFace.loaded||l.mSymbolFontFace.failed)){e.next=22;break}if(r=l.createInvisibleTexture(),n instanceof En.k||n instanceof Rn.o?(n.setDiffuseMap(r),n instanceof Rn.o&&n.useAlphaFromDiffuseMap(!0)):(n instanceof On.r||n instanceof In._||n instanceof Dn.r)&&(n.setDiffuseMap(r),n.useAlphaFromDiffuseMap(!0)),n.setTransparent(!0),n.markDirty(),l.requestFrameSubject.next(),e.prev=10,!l.mSymbolFontFace||l.mSymbolFontFace.loaded||l.mSymbolFontFace.failed){e.next=14;break}return e.next=14,$i.N.getInstance().waitFontFaceLoaded(l.mSymbolFontFace);case 14:if(!l.mTextFontFace||l.mTextFontFace.loaded||l.mTextFontFace.failed){e.next=17;break}return e.next=17,$i.N.getInstance().waitFontFaceLoaded(l.mTextFontFace);case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(10),v.UX.error("Failed to load font:",e.t0);case 22:return e.next=24,l.buildTexture(u);case 24:a=e.sent,n instanceof En.k||n instanceof Rn.o?(n.setDiffuseMap(a[0]),n instanceof Rn.o&&n.useAlphaFromDiffuseMap(!0)):(n instanceof On.r||n instanceof In._||n instanceof Dn.r)&&(n.setDiffuseMap(a[0]),n.useAlphaFromDiffuseMap(!0)),"carved"!==t.engraving&&"relief"!==t.engraving||(o=s.getType().isTypeName("BabylonjsRenderer")?1:100,c=t.engraving_scale/o||.002,n instanceof Rn.o?(h=new ee.I(c,c),n.setNormalMap(a[1]),n.setNormalScale(h)):(n instanceof Yi.u||n instanceof Dn.r)&&(n.setBumpMap(a[1]),n.setBumpScale(c))),n.setTransparent(!0),n.getOpacity()<1e-5&&n.setOpacity(1),n.markDirty(),l.requestFrameSubject.next();case 31:case"end":return e.stop()}}),e,null,[[10,19]])})));return function(t){return e.apply(this,arguments)}}());case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),v.UX.error(e.t0);case 12:case"end":return e.stop()}}),e,this,[[3,9]])}))),function(e,t,n,r){return a.apply(this,arguments)})},{key:"destroy",value:function(){var e=this;this.mDiffuseTexture&&(this.mMaterialManager.getTextureManager().disposeTexture(this.mDiffuseTexture),this.mDiffuseTexture=null),this.mNormalTexture&&(this.mMaterialManager.getTextureManager().disposeTexture(this.mNormalTexture),this.mNormalTexture=null),this.mDiffuseCanvas=null,this.mNormalCanvas=null,this.mTextFontFace&&delete this.mTextFontFace,this.mSymbolFontFace&&delete this.mSymbolFontFace,Object.entries(this.mResourceHandles).forEach((function(t){var n=(0,o.A)(t,2)[1];try{e.mMaterialManager.disposeResource(n)}catch(e){}})),this.mResourceHandles={}}},{key:"buildEngraving",value:function(e,t,n,r,i){(0,P.isNullOrUndefined)(this.mNormalTexture)&&(this.mNormalCanvas=document.createElement("canvas"),this.mNormalCanvas.style.display="none",this.mNormalCanvas.style.letterSpacing="0px",this.mNormalCanvas.style.lineHeight="0px",document.body.appendChild(this.mNormalCanvas),this.mNormalTexture=R.K.renderer().getRenderEngine().createTextureCanvas("text2image:normal:v2",this.mNormalCanvas));var a=this.mNormalTexture.getContext();return a.clearRect(0,0,a.canvas.width,a.canvas.height),a.canvas.width=.5*t,a.canvas.height=.5*i.image.height,e.forEach((function(e){if(a.font="normal normal normal ".concat(.5*r,"px/0px '").concat(e.fontFamily,"'"),a.textAlign=n,a.textBaseline="alphabetic","relief"===i.engraving.type)a.fillStyle="#f3f3f3",a.shadowColor="#181818",a.shadowBlur=2,a.strokeStyle="#181818",a.lineWidth=1,a.strokeText(e.text,.5*e.x,.5*e.y);else a.fillStyle="#181818",a.shadowColor="#bababa",a.shadowBlur=i.engraving.outline,a.strokeStyle="#bababa",a.lineWidth=.5*i.engraving.outline;a.fillText(e.text,.5*e.x,.5*e.y)})),this.mNormalTexture.markDirty(),this.mNormalTexture}},{key:"buildTexture",value:(r=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r=t.textValue,i=t.font.family,a=Math.max(0,t.font.size),o=t.image.height*t.image.widthRatio,s=t.image.height,u=[],c=0;if(!(0,P.isNullOrUndefined)(t.symbol.font)&&t.symbol.font.length>0&&!(0,P.isNullOrUndefined)(t.symbol.list)&&t.symbol.list.length>0)for(var l,h=/(&(.*?);)/gi,f=function(){if(l.index>c){var e=l.index-c;u.push({text:r.substr(c,e),fontFamily:i})}var n=l[2],a=t.symbol.list.findIndex((function(e){return e.name===n}));a>=0&&t.symbol.list[a].enabled&&u.push({text:t.symbol.list[a].glyph_tag,fontFamily:t.symbol.font}),c=l.index+l[0].length};null!==(l=h.exec(r));)f();if(c<r.length&&u.push({text:r.substr(c,r.length-c),fontFamily:i}),!(0,P.isNullOrUndefined)(t.symbol.left)&&t.symbol.left.length>0&&!(0,P.isNullOrUndefined)(t.symbol.list)&&t.symbol.list.length>0){var m=t.symbol.list.findIndex((function(e){return e.name===t.symbol.left}));m>=0&&t.symbol.list[m].enabled&&u.unshift({text:t.symbol.list[m].glyph_tag,fontFamily:t.symbol.font})}if(!(0,P.isNullOrUndefined)(t.symbol.right)&&t.symbol.right.length>0&&!(0,P.isNullOrUndefined)(t.symbol.list)&&t.symbol.list.length>0){var p=t.symbol.list.findIndex((function(e){return e.name===t.symbol.right}));p>=0&&t.symbol.list[p].enabled&&u.push({text:t.symbol.list[p].glyph_tag,fontFamily:t.symbol.font})}if((0,P.isNullOrUndefined)(n.mDiffuseTexture)){n.mDiffuseCanvas=document.createElement("canvas"),n.mDiffuseCanvas.style.display="none",n.mDiffuseCanvas.style.letterSpacing="0px",n.mDiffuseCanvas.style.lineHeight="0px",document.body.appendChild(n.mDiffuseCanvas);var d=t.options.disableAntiAliasing;n.mDiffuseTexture=R.K.renderer().getRenderEngine().createTextureCanvas("text2image:diffuse:v2",n.mDiffuseCanvas,!0,void 0,Cn.qC.ClampToEdge,Cn.qC.ClampToEdge,d?Cn.wm.Nearest:void 0,d?Cn.wm.Nearest:void 0,d?Cn.wm.None:void 0,void 0,void 0,void 0,d?0:void 0)}var v=n.mDiffuseTexture.getContext();v.clearRect(0,0,v.canvas.width,v.canvas.height);var y=Math.max(s-2*t.image.padding_y,0)*a,g=n.resolveFontMetrics(t.font.family);v.canvas.width=o,v.canvas.height=s;var b=0,A=g.height*(y/g.fontSize),_=0,M=0,k=g.baselineHeight*(y/g.fontSize);if(u.forEach((function(e){v.font="normal normal normal ".concat(y,"px/0px '").concat(e.fontFamily,"'"),v.textAlign="left",v.textBaseline="alphabetic";var t=v.measureText(e.text);e.width=t.width+0,e.height=A,b+=e.width})),t.text.autoResize&&"bounding_box"===t.text.autoResizeType){var w=Math.max(0,o-2*t.image.padding_x);if(w<b){var T=w/b;b=w,A*=T,y*=T,k*=T,u.forEach((function(e){e.width*=T,e.height*=T}))}}M="alphabetic"===t.text.baseline?s-t.image.padding_y:.5*s+k;var x="left";switch(t.text.align){case"left":x="left",_=t.image.padding_x;break;case"center":x="left",_=.5*o-.5*b;break;case"right":x="left",_=o-t.image.padding_x-b}var S=_;u.forEach((function(e){e.x=S,e.y=M,S+=e.width})),u.forEach((function(e){if(n.DEBUG){var r=e.x,i="alphabetic"===t.text.baseline?M-e.height:.5*s-.5*e.height;v.strokeStyle="#800080",v.strokeRect(r,i,e.width,e.height),v.strokeStyle="#ffd700",v.beginPath(),v.moveTo(t.image.padding_x,M),v.lineTo(o-t.image.padding_x,M),v.lineWidth=1,v.stroke()}v.font="normal normal normal ".concat(y,"px/0px '").concat(e.fontFamily,"'"),v.textAlign=x,v.textBaseline="alphabetic",t.text.outline>0&&(v.strokeStyle=t.text.outlineColor,v.lineWidth=t.text.outline,v.strokeText(e.text,e.x,e.y)),v.fillStyle=t.text.color,v.fillText(e.text,e.x,e.y)})),n.DEBUG&&(v.strokeStyle="#ff0000",v.beginPath(),v.moveTo(0,.5*s),v.lineTo(o,.5*s),v.lineWidth=2,v.stroke(),v.strokeStyle="#ff0000",v.strokeRect(0,0,o,s),v.strokeStyle="#0000ff",v.strokeRect(t.image.padding_x,0,o-2*t.image.padding_x,t.image.padding_y),v.strokeRect(t.image.padding_x,s-t.image.padding_y,o-2*t.image.padding_x,t.image.padding_y),v.strokeRect(0,0,t.image.padding_x,s),v.strokeRect(o-t.image.padding_x,0,t.image.padding_x,s)),n.mDiffuseTexture.markDirty();var C=[];if(C.push(n.mDiffuseTexture),"carved"===t.engraving.type||"relief"===t.engraving.type){var E=n.buildEngraving(u,o,x,y,t);C.push(E)}else C.push(null);return e(C)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"getTextWidth",value:function(e,t,n){var r=this.resolveContext(e,t,n),i=document.createElement("span"),a=document.createElement("style");i.id="xpv-text-measuring",i.textContent=r.textValue,a.textContent="\n            span#xpv-text-measuring {\n                position: fixed;\n                top: 1px;\n                left: 1px;\n                visibility: hidden;\n                padding: 0;\n                border-width: 0;\n                transform: translate(-100%, -100%);\n                white-space: nowrap;\n                font-size: ".concat(16*r.font.size,"px;\n                font-family: '").concat(r.font.family,"';\n            }\n            span#xpv-text-measuring::before,\n            span#xpv-text-measuring::after { content: none; }\n        "),i.appendChild(a),document.body.appendChild(i);var o=i.getBoundingClientRect().width;return document.body.removeChild(i),o}},{key:"calculateTextMetrics",value:function(e,t,n){var r=n,i=4*t,a=4*t,o={left:0,right:i,top:0,bottom:a};(0,P.isNullOrUndefined)(this.mTextMetricsCanvas)&&(this.mTextMetricsCanvas=document.createElement("canvas"),this.mTextMetricsCanvas.style.display="none",this.mTextMetricsCanvas.style.letterSpacing="normal",this.mTextMetricsCanvas.style.lineHeight="0px",document.body.appendChild(this.mTextMetricsCanvas));var s=this.mTextMetricsCanvas.getContext("2d",{alpha:!1});s.canvas.width=i,s.canvas.height=a,s.fillStyle="#ffffff",s.fillRect(0,0,i,a),s.font="normal normal normal ".concat(t,"px/0px '").concat(e,"'"),s.textAlign="left",s.textBaseline="alphabetic",s.fillStyle="#000000",s.filter="brightness(0)";for(var u=.33*i,c=.5*a+.33*t,l=0;l<r.length;l++)s.fillText(r[l],u,c);for(var h=s.getImageData(0,0,i,a).data,f=i,m=a,p=-1,d=-1,v=!1,y=0;y<a;y++){v=!1;for(var g=0;g<i;g++){var b=y*(4*i)+4*g;h[b]+h[b+1]+h[b+2]===0&&(v=!0,g<f&&(f=g),g>p&&(p=g))}v&&(y<m&&(m=y),y>d&&(d=y))}return o.left=f<i?f:0,o.top=m<a?m:0,o.right=p>0?p+1:i,o.bottom=d>0?d+1:a,{width:o.right-o.left,height:o.bottom-o.top}}},{key:"resolveFontMetrics",value:function(e){if(!t.sFontMetrics.has(e)){var n=t.sFontSize,r=this.calculateTextMetrics(e,n,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.:,;'\"(!?)+-*/=@"),i=this.calculateTextMetrics(e,n,"eo");t.sFontMetrics.set(e,{fontSize:n,width:r.width,height:r.height,baselineHeight:.5*i.height})}return t.sFontMetrics.get(e)}},{key:"resolveContext",value:function(e,t,n){var r={textValue:(0,P.isNullOrUndefined)(t.value)?e.value||"":t.value,image:{height:e.height||512,widthRatio:e.width_ratio||2.5,padding_x:e.padding_x||0,padding_y:e.padding_y||0},text:{outline:e.outline||0,color:e.color||"#ffffff",outlineColor:e.outline_color||"#ffffff",align:t.position||e.position||"center",transform:e.text_transform||"none",autoResize:e.auto_resize||!1,autoResizeType:e.auto_resize_type||"character",resizeThreshold:e.resize_threshold||6,baseline:e.text_baseline||"middle"},font:{size:t.size||1,family:t.font||e.available_fonts&&e.available_fonts[0]||"Arial"},symbol:{font:e.symbol_font||"",list:e.symbol_list||[],fileUrl:e.symbol_file_url,left:t.symbol_left||null,right:t.symbol_right||null},options:na({disableAntiAliasing:!1},n),engraving:{type:e.engraving||"none",outline:e.engraving_outline||0,scale:e.engraving_scale||1}};return r.textValue=function(e){switch(r.text.transform){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^| )[a-z]/g,(function(e){return e.toUpperCase()}));case"uppercase":return e.toUpperCase();default:return e}}(r.textValue),r.text.autoResize&&"character"===r.text.autoResizeType&&(r.font.size*=Math.min(1,r.text.resizeThreshold/r.textValue.length)),r}},{key:"createInvisibleTexture",value:function(){if((0,P.isNullOrUndefined)(t.sTransparentTexture)){var e=document.createElement("canvas");e.style.display="none",e.style.backgroundColor="transparent",e.width=1,e.height=1,document.body.appendChild(e),t.sTransparentTexture=R.K.renderer().getRenderEngine().createTextureCanvas("text2image:transparent:v2",e,!0,void 0,Cn.qC.ClampToEdge,Cn.qC.ClampToEdge),e.getContext("2d",{alpha:!0}).clearRect(0,0,e.width,e.height),t.sTransparentTexture.markDirty()}return t.sTransparentTexture}},{key:"applyTexturesToModel",value:function(e){if(this.mDiffuseCanvas){var t=this.mDiffuseCanvas.toDataURL("image/png");if("PbrMaterial"===e.type?e.diffuse_map=t:e.map=t,this.mNormalCanvas){var n=this.mNormalCanvas.toDataURL("image/jpeg");"PbrMaterial"===e.type?e.normal_map=n:"MeshToonMaterial"!==e.type&&"MeshPhongMaterial"!==e.type&&"MeshPhongMaterialExt"!==e.type&&"MeshStandardMaterial"!==e.type&&"MeshPhysicalMaterial"!==e.type&&"MeshPhysicalMaterialExt"!==e.type||(e.bump_map=n)}}}}]);var r,a}(Xi);(0,c.A)(ia,"sTransparentTexture",void 0),(0,c.A)(ia,"sFontSize",128),(0,c.A)(ia,"sFontMetrics",new Map);var aa=function(){return(0,u.A)((function e(t,n){(0,s.A)(this,e),(0,c.A)(this,"mController",void 0),v.UX.print("TextToImageController: Attribute version:",n.version),2===n.version?this.mController=new ia(t):this.mController=new ea(t)}),[{key:"update",value:(e=(0,n.A)(i().mark((function e(t,n,r,a){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mController.update(t,n,r,a));case 1:case"end":return e.stop()}}),e,this)}))),function(t,n,r,i){return e.apply(this,arguments)})},{key:"destroy",value:function(){this.mController.destroy()}},{key:"getTextWidth",value:function(e,t,n){return this.mController.getTextWidth(e,t,n)}},{key:"requestFrameSubject",value:function(){return this.mController.requestFrameSubject}},{key:"applyTexturesToModel",value:function(e){this.mController.applyTexturesToModel(e)}}]);var e}();function oa(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oa=function(){return!!e})()}var sa=function(e){function t(e,n){var r,i,a,o;(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,oa()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mValue",{value:""}),(0,c.A)(r,"mMeta",void 0),(0,c.A)(r,"mTextToImageEvent",new M.B),(0,c.A)(r,"mTextToImageController",void 0);var u=r.resolveValuable(),l=u?u.value:"";return r.mMeta=r.mAttributeData&&r.mAttributeData.meta||{},r.setValue(l),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"destroy",value:function(){this.mTextToImageEvent.unsubscribe(),this.mTextToImageController&&(this.mTextToImageController.destroy(),delete this.mTextToImageController),delete this.mTextToImageController}},{key:"getResourceController",value:function(){return this.mTextToImageController}},{key:"broadcastAttributeUpdated",value:function(){var e,n,r,i,a;this.setValue(this.getValue()),(e=t,n="broadcastAttributeUpdated",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){"string"!=typeof e&&(this.mValue=Object.assign(this.mValue,e));var n="string"==typeof e?e:e.value;if(null!=(n=Vi(n))){var r=n.length;if(/@size:(\d+\.?\d*);?/.test(n)){var i=n.match(/@size:(\d+\.?\d*)x?;?/),a=i[1];r=r>i.index?i.index:r;var o=parseFloat(a);isNaN(o)||(this.mValue.size=o)}if(/@font:'?"?(.*?)'?"?;?$/.test(n)){var s=n.match(/@font:'?"?(.*?)'?"?;?$/);r=r>s.index?s.index:r;var u=s[1];u.length>1&&(this.mValue.font=u)}r>0&&(r!==n.length&&(r-=1),n=n.slice(0,r)),this.mValue.value=n}this.updateValues(),this.dispatchToRenderer(t).then((function(){}),(function(e){v.UX.error(e)})),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){var e=this.resolveValuable(),t=this.mValue.font||e&&e.available_fonts&&e.available_fonts[0]||"Arial",n=Number.isSafeInteger(this.mValue.size)?"".concat(Number(this.mValue.size).toFixed(2)):"1.00";return(0,h.uI)(this.mValue.value)?"".concat(this.mValue.value," @size:").concat(n,"; @font:").concat(t,";"):""}},{key:"resetValue",value:function(e){this.mValue={value:""},this.broadcast(e)}},{key:"parse",value:function(e,t){e&&void 0!==e.value&&this.setValue(e,t)}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"onMaterialUpdated",value:function(e){var t=this.resolveValuable().material_id;e.materialModelId===t&&this.mAttributeData.visible&&0!==this.mAttributeData.visibility&&3!==this.mAttributeData.visibility&&this.dispatchToRenderer().then((function(){}),(function(e){v.UX.error(e)}))}},{key:"dispatchToRenderer",value:(a=(0,n.A)(i().mark((function e(t){var n,r,a=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:this.mTextToImageController||(r=en.J.getManager(en.n.MaterialManager),this.mTextToImageController=new aa(r,this.mAttributeData),this.mTextToImageController.requestFrameSubject().subscribe((function(){R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))})),this.mTextToImageEvent.pipe((0,Bn.L)((function(){return(0,xn.H)(new Promise((function(e){if(null===n.material_id)return e();var t=JSON.parse(JSON.stringify(n)),r=JSON.parse(JSON.stringify(a.mValue)),i=JSON.parse(JSON.stringify(a.mMeta));a.mTextToImageController.update(t,r,i,a.resolveProductNode()).then((function(){e()}),(function(t){v.UX.warn("Failed to update text to image: ",t),e()}))})))})),(0,Fn.W)((function(e,t){return t}))).subscribe({next:function(){v.UX.print("Text to image updated"),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))},error:function(e){v.UX.warn("Failed to update text to image (pipeline):",e)}})),this.mTextToImageEvent.next();case 5:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"setNextValue",value:(r=(0,n.A)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.getMiddleware()){e.next=4;break}return e.next=3,this.getMiddleware().execute(JSON.parse(JSON.stringify(t)));case 3:t=e.sent;case 4:return e.abrupt("return",this.setValue(t,n));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]);var r,a}(yn);(0,c.A)(sa,"TypeRTTI",new le.O("AttributeTextToImageController",yn.TypeRTTI));var ua=__webpack_require__(58307);function ca(e,t){return void 0===t&&(t=ua.D),e=null!=e?e:la,(0,x.N)((function(n,r){var i,a=!0;n.subscribe((0,S._)(r,(function(n){var o=t(n);!a&&e(i,o)||(a=!1,i=o,r.next(n))})))}))}function la(e,t){return e===t}function ha(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return fa(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function fa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ma(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ma(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ma(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function da(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(da=function(){return!!e})()}function va(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var ya=function(e){function t(e,n){var r,i,a,o;(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,da()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mValue",pa({media_id:0,print_ready_file_id:0,svg_element:"",clipping_element:void 0},t.getDefaultOptions())),(0,c.A)(r,"canvasGroup",""),(0,c.A)(r,"mTextureController",void 0),(0,c.A)(r,"mSvgElementBoundary",void 0),(0,c.A)(r,"mUpdateEvent",new M.B),(0,c.A)(r,"mUpdateSticker",new M.B),(0,c.A)(r,"mPalletizationTextures",{}),(0,c.A)(r,"mPalletizationDirtyFlags",{}),r.canvasGroup=f.V.uuidV4(),r.registerUpdateEvent(),r.registerStickerUpdate();var u=r.resolveValuable();if(u){var l,h,m,p;Array.isArray(u.palletization_colors)&&Ri.sanitizeColors(u);var d=t.getDefaultOptions(),v=d.palletization;if(v.settings.enabled=u.allow_palletization,v.settings.max_colors=null!==(l=u.palletization_max_colors)&&void 0!==l?l:1,v.settings.allowed_colors=(null!==(h=u.palletization_colors)&&void 0!==h?h:[]).slice(0),v.settings.transparency_mode=null!==(m=u.palletization_transparency_mode)&&void 0!==m?m:"opaque",u.external_colors&&(v.settings.allowed_colors=[]),null!==(p=e.meta)&&void 0!==p&&null!==(p=p.sticker)&&void 0!==p&&p.enabled){var y,g=null===(y=e.meta)||void 0===y?void 0:y.sticker,b=g.type,A=g.padding,_=g.alphaThreshold,k=g.distanceThreshold,w=g.curveThreshold,T=g.rdpTolerance;d.sticker_path=pa(pa(pa(pa(pa(pa(pa({},b&&{type:b}),A&&{padding:A}),_&&{alphaThreshold:_}),k&&{distanceThreshold:k}),w&&{curveThreshold:w}),T&&{rdpTolerance:T}),{},{strokeDashArray:[20]})}r.mValue=d,r.updateValues(),r.mUpdateEvent.next({broadcast_options:{emitEvent:!1,rebuild:!0}})}return r.mTextureResolver.subscribe({next:function(e){r.mTextureController=e.controller}}),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"registerUpdateEvent",value:function(){var e=this;this.mUpdateEvent.pipe((0,Bn.L)((function(t){return(0,xn.H)(e.processUpdateEvent(t))})),(0,Fn.W)((function(e,t){return t}))).subscribe({next:function(){v.UX.print("Svg Canvas updated.");var t=e.mValue.canvas.objects.reduce((function(e,t){return e^f.V.checksum(JSON.stringify(t))}),0);t^=f.V.checksum(JSON.stringify(pa(pa({},e.mValue.sticker_path),{},{data:void 0}))),e.mUpdateSticker.next(t),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))},error:function(e){v.UX.warn("Failed to update Svg Canvas (pipeline):",e)}})}},{key:"registerStickerUpdate",value:function(){var e=this;this.mUpdateSticker.pipe(ca(),C(500),(0,Bn.L)((function(){return(0,xn.H)(e.processStickerUpdate())})),(0,Fn.W)((function(e,t){return t}))).subscribe({next:function(){v.UX.print("Svg Canvas updated."),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))},error:function(e){v.UX.warn("Failed to update Svg Canvas (pipeline):",e)}})}},{key:"getType",value:function(){return t.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){var e,t=["id","styles","dirty"],n=[],r=ha(this.mValue.canvas.objects);try{for(r.s();!(e=r.n()).done;){for(var i=e.value,a=[],s=0,u=Object.entries(i);s<u.length;s++){var c=(0,o.A)(u[s],2),l=c[0],h=c[1];t.includes(l)||("fontFamily"===l&&i.multiline||a.push("@".concat(l,":").concat(h,";")))}n.push(a.join(" "))}}catch(e){r.e(e)}finally{r.f()}return n.join("|")}},{key:"parse",value:function(e,t){e&&this.setValue(e,t)}},{key:"serialize",value:function(e){var n=va(t,"serialize",this,3)([e]);return!0===e.calculate_approximations&&n&&this.mTextureController?(this.mSvgElementBoundary||(this.mSvgElementBoundary=this.mTextureController.getBoundariesSync(this.mValue.svg_element,void 0,!0)),this.mSvgElementBoundary?(n.attribute_value.svg_canvas_surface=this.calculateSurfaceCoverage(),n):n):n}},{key:"resetValue",value:function(e){try{this.setValue(t.getDefaultOptions(),e)}finally{this.broadcast(e)}}},{key:"setValue",value:function(e,t){var n=this,r=this.resolveValuable(),i=void 0!==e.type?{canvas:e}:e;i&&(i.canvas&&this.copyValueFromCanvas(i),i.sticker_path&&this.copyValueFromSticker(i),this.validateEmojisInTextObjects(),i.palletization&&this.copyValueFromPalletization(i,r),(i.canvas||i.palletization)&&this.updatePalletizationObjectsFromCanvas(),this.needPalletizationRefreshForExternalColors(r)&&(r.palletization_colors=this.mValue.palletization.settings.allowed_colors.slice(0),v.UX.print("Svg Canvas (palletization): External colors changed. Updating colors and marking all objects dirty."),Object.keys(this.mPalletizationDirtyFlags).forEach((function(e){n.mPalletizationDirtyFlags[e]=!0}))),this.updateValues(),this.dispatchToRenderer(t).then((function(){}),(function(e){v.UX.error(e)})))}},{key:"convertColorsForCanvasObjects",value:function(e){var t,n=ha(e);try{for(n.s();!(t=n.n()).done;){var r,i=t.value;if("string"==typeof i.fill)i.fill=null!==(r=kn(i.fill,"hex"))&&void 0!==r?r:"#FFFFFF"}}catch(e){n.e(e)}finally{n.f()}return e}},{key:"validateEmojisInTextObjects",value:function(){var e=this.mValue.canvas.objects.filter((function(e){return"i-text"===e.type||"textbox"===e.type}));if(Array.isArray(e)){var t,n=ha(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.text&&(r.text=Vi(r.text))}}catch(e){n.e(e)}finally{n.f()}}}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"copyValueFromSticker",value:function(e){var t,n=null!==(t=e.sticker_path)&&void 0!==t?t:{},r=n.type,i=n.data,a=n.distanceThreshold,o=n.curveThreshold,s=n.alphaThreshold,u=n.padding,c=n.rdpTolerance,l=n.backgroundColor,h=n.strokeWidth,f=n.strokeColor,m=n.strokeDashArray;this.mValue.sticker_path=pa(pa(pa(pa(pa(pa(pa(pa(pa(pa(pa(pa({},this.mValue.sticker_path),r&&{type:r}),i&&{data:i}),a&&{distanceThreshold:a}),o&&{curveThreshold:o}),s&&{alphaThreshold:s}),u&&{padding:u}),c&&{rdpTolerance:c}),l&&{backgroundColor:l}),h&&{strokeWidth:h}),f&&{strokeColor:f}),m&&{strokeDashArray:m})}},{key:"copyValueFromCanvas",value:function(e){var t,n,r=this,i=this.resolveValuable();e.canvas.objects=Array.isArray(e.canvas.objects)?e.canvas.objects:[],this.mValue.canvas.type=null!==(t=e.canvas.type)&&void 0!==t?t:"",this.mValue.canvas.version=Number(null!==(n=e.canvas.version)&&void 0!==n?n:1),this.mValue.canvas.objects=e.canvas.objects.map((function(e){var t=JSON.parse(JSON.stringify(e));Object.keys(t).forEach((function(e){t[e]=h.N5.isNumeric(t[e])?Number(t[e]):t[e]}));var n,a=pa({id:f.V.guid(),key:"",type:"",width:0,height:0,scaleX:1,scaleY:1,angle:0,top:0,left:0,opacity:1,flipX:!1,flipY:!1},t);if(a.styles=r.fixTextStyles(a.styles),"i-text"===a.type||"textbox"===a.type){var o;if(a.multiline=(null==i?void 0:i.multiline)||a.multiline,a.multiline){var s,u,c;if(!a.fontSize)a.fontSize=null!==(c=i.default_font_size)&&void 0!==c?c:40;a.fontSize=Math.max(null!==(s=i.min_font_size)&&void 0!==s?s:1,Math.min(null!==(u=i.max_font_size)&&void 0!==u?u:4096,a.fontSize))}!1===(null===(o=r.mAttributeData.meta)||void 0===o||null===(o=o.object_scaling)||void 0===o||null===(o=o.text)||void 0===o?void 0:o.vertical)&&a.scaleY!==a.scaleX&&(a.scaleY=a.scaleX)}"string"==typeof a.fill&&(a.fill_output=null!==(n=kn(a.fill,r.mAttributeData.meta.output_color_format))&&void 0!==n?n:"#FFFFFF");return a}))}},{key:"copyValueFromPalletization",value:function(e,t){var n=this;if(e.palletization){var r=!1;if(e.palletization.settings){"number"==typeof e.palletization.settings.max_colors&&t.external_colors&&this.mValue.palletization.settings.max_colors!==e.palletization.settings.max_colors&&(v.UX.info("Svg Canvas (palletization): Max colors changed! From %d -> %d",this.mValue.palletization.settings.max_colors,e.palletization.settings.max_colors),this.mValue.palletization.settings.max_colors=Number(e.palletization.settings.max_colors),r=!0);var i=!1;Array.isArray(e.palletization.settings.allowed_colors)&&t.external_colors&&(this.mValue.palletization.settings.allowed_colors.splice(0),e.palletization.settings.allowed_colors.forEach((function(e,t){var r,i,a=kn(e.color,"hex");a&&n.mValue.palletization.settings.allowed_colors.push({name:null!==(r=e.name)&&void 0!==r?r:a,color:a,position:Number(null!==(i=e.position)&&void 0!==i?i:t),visible:!1!==e.visible})})),i=!0),(r||i)&&Object.keys(this.mValue.palletization.objects).forEach((function(e){n.mValue.palletization.objects[e].palette_override=[],n.mPalletizationDirtyFlags[e]=!0}))}e.palletization.objects&&(Object.keys(e.palletization.objects).forEach((function(t){var i=e.palletization.objects[t];i?(t in n.mValue.palletization.objects||(n.mValue.palletization.objects[t]={object_id:null,hash:"",palette:[],palette_override:[]}),n.mValue.palletization.objects[t].object_id=i.object_id,i.palette_override&&(n.mValue.palletization.objects[t].palette_override=i.palette_override.slice(0),n.mPalletizationDirtyFlags[t]=!0),r&&i.object_id in n.mPalletizationContexts&&(n.mPalletizationContexts[i.object_id].analyzed=!1)):n.disposePalletizationObject(t)})),Object.keys(this.mValue.palletization.objects).forEach((function(t){t in e.palletization.objects||n.disposePalletizationObject(t)})))}}},{key:"updatePalletizationObjectsFromCanvas",value:function(){var e=this,t=this.getImagesForPalletizationFromCanvas(this.mValue.canvas.objects),n={};Object.keys(this.mValue.palletization.objects).forEach((function(e){n[e]=!1})),t.forEach((function(t){t.id in e.mValue.palletization.objects||(e.mValue.palletization.objects[t.id]={object_id:t.id,hash:"",palette:[],palette_override:[]},e.mPalletizationDirtyFlags[t.id]=!0),t.opacity=1,n[t.id]=!0})),Object.keys(n).filter((function(e){return e})).forEach((function(t){n[t]||e.disposePalletizationObject(t)}))}},{key:"updateValues",value:function(){var e=this;if(this.mAttributeData.attribute_values.length>0){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values[0].id;var t=this.mAttributeData.attribute_values[0].attribute_value_valuable;Array.isArray(t.available_fonts)&&0!==t.available_fonts.length||(t.available_fonts=["Arial","Times New Roman"]),this.mValue.palletization.settings.enabled=t.allow_palletization;var n=!1,r=!1;this.mValue.palletization.settings.enabled&&!t.external_colors&&(this.mValue.palletization.settings.max_colors!==t.palletization_max_colors&&(this.mValue.palletization.settings.max_colors=t.palletization_max_colors,n=!0),this.mValue.palletization.settings.allowed_colors.length!==t.palletization_colors.length&&(r=!0),this.mValue.palletization.settings.allowed_colors=t.palletization_colors.slice(0)),(n||r)&&Object.keys(this.mValue.palletization.objects).forEach((function(t){var r=e.mValue.palletization.objects[t];r.palette_override=[],e.mPalletizationDirtyFlags[t]=!0,n&&r.object_id in e.mPalletizationContexts&&(e.mPalletizationContexts[r.object_id].analyzed=!1)})),this.mValue.media_id=t.media_id||0,this.mValue.print_ready_file_id=t.print_ready_file_id||0,this.mValue.svg_element=t.svg_element}this.mAttributeData.selected_value_value=this.getValue()}},{key:"dispatchToRenderer",value:(d=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.mUpdateEvent.next({broadcast_options:t});case 1:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"calculateSurfaceCoverage",value:function(){var e=this,t=this.mSvgElementBoundary.left,n=this.mSvgElementBoundary.top,r=Math.floor(this.mSvgElementBoundary.width*this.mSvgElementBoundary.scaleX),i=Math.floor(this.mSvgElementBoundary.height*this.mSvgElementBoundary.scaleY),a=(this.mValue.canvas.objects||[]).map((function(t){var n=e.mTextureController.getBoundariesSync(t.id,e.canvasGroup,!0);if(n)switch(n.id=t.id,n.width*=n.scaleX,n.height*=n.scaleY,t.type){case"i-text":case"textbox":case"image":return n;default:return}})).filter((function(e){if(!e)return!1;var a=e.bbox.min.x,o=e.bbox.min.y,s=e.bbox.max.x,u=e.bbox.max.y;if(a>t&&o>n&&s<t+r&&u<n+i)return!0;if(a<t&&s>t+r||o<n&&u>n+i)return!0;var c=e.coords.tl.x>t&&e.coords.tl.x<t+r&&e.coords.tl.y>n&&e.coords.tl.y<n+i,l=e.coords.tr.x>t&&e.coords.tr.x<t+r&&e.coords.tr.y>n&&e.coords.tr.y<n+i,h=e.coords.bl.x>t&&e.coords.bl.x<t+r&&e.coords.bl.y>n&&e.coords.bl.y<n+i,f=e.coords.br.x>t&&e.coords.br.x<t+r&&e.coords.br.y>n&&e.coords.br.y<n+i;if(c||l||h||f)return!0;var m=new ee.I(t,n),p=new ee.I(t+r,n),d=new ee.I(t,n+i),v=new ee.I(t+r,n+i),y=new ee.I(e.coords.tl.x,e.coords.tl.y),g=new ee.I(e.coords.tr.x,e.coords.tr.y),b=new ee.I(e.coords.bl.x,e.coords.bl.y),A=new ee.I(e.coords.br.x,e.coords.br.y),_=Sn.LineLineIntersection(m,p,y,g),M=Sn.LineLineIntersection(m,p,g,A),k=Sn.LineLineIntersection(m,p,A,b),w=Sn.LineLineIntersection(m,p,b,y);if(_||M||k||w)return!0;var T=Sn.LineLineIntersection(v,d,y,g),x=Sn.LineLineIntersection(v,d,g,A),S=Sn.LineLineIntersection(v,d,A,b),C=Sn.LineLineIntersection(v,d,b,y);return!!(T||x||S||C)})),o=r*i,s=0,u=0;a.length>0&&o>0&&(a.map((function(e){return e.minX=e.bbox.min.x<t?t:e.bbox.min.x,e.minY=e.bbox.min.y<n?n:e.bbox.min.y,e.maxX=e.bbox.max.x>t+r?t+r:e.bbox.max.x,e.maxY=e.bbox.max.y>n+i?n+i:e.bbox.max.y,e})).forEach((function(e){s+=(e.maxX-e.minX)*(e.maxY-e.minY)})),u=(s=Math.min(s,o))/o*100);return u}},{key:"setNextValue",value:(p=(0,n.A)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.getMiddleware()){e.next=4;break}return e.next=3,this.getMiddleware().execute(JSON.parse(JSON.stringify(t)));case 3:t=e.sent;case 4:return e.abrupt("return",this.setValue(t,n));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"disposeSvgTexture",value:function(){va(t,"disposeSvgTexture",this,3)([]),this.mTextureController&&delete this.mTextureController}},{key:"processStickerUpdate",value:(m=(0,n.A)(i().mark((function e(){var t,n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(t=this.mValue.sticker_path)&&void 0!==t&&t.type){e.next=2;break}return e.abrupt("return");case 2:return n=this.resolveValuable(),e.next=5,this.resolveSvgTextureController(n.print_ready_file_id);case 5:return r=e.sent,e.next=8,r.generateStickerSvgPath(this.mValue.svg_element,this.canvasGroup,this.mValue.sticker_path);case 8:a=e.sent,this.setValue({sticker_path:{data:null!=a?a:{path:""}}});case 10:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"processUpdateEvent",value:(l=(0,n.A)(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=JSON.parse(JSON.stringify(this.resolveValuable())),r=JSON.parse(JSON.stringify(this.mValue)),e.next=5,this.resolveSvgTextureController(n.print_ready_file_id);case 5:if(a=e.sent,this.mTextureController=a,!n.allow_palletization){e.next=10;break}return e.next=10,this.processPalletization(n,r);case 10:return r.canvas.objects=this.convertColorsForCanvasObjects(r.canvas.objects),e.next=13,a.updateCanvas(this.mValue.svg_element,this.canvasGroup,r,n,this.mPalletizationContexts);case 13:this.broadcast(t.broadcast_options),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),v.UX.error("Error in processUpdateEvent:",e.t0);case 19:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e){return l.apply(this,arguments)})},{key:"processPalletization",value:(a=(0,n.A)(i().mark((function e(t,n){var r,a,o,s=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=n.palletization.objects,a=i().mark((function e(a){var o,u,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r[a],u=n.canvas.objects.find((function(e){return e.id===a}))){e.next=5;break}return s.disposePalletizationObject(a),e.abrupt("return",1);case 5:if(c=!(a in s.mPalletizationDirtyFlags)||s.mPalletizationDirtyFlags[a],u.id in s.mPalletizationTextures||(s.mPalletizationTextures[u.id]=Ri.createTexture("svg-canvas-palletization_".concat(u.id)),c=!0),0===o.palette_override.length&&(c=!0),!c){e.next=12;break}return s.mPalletizationDirtyFlags[a]=!1,e.next=12,s.executePalletization(t,n,u,o);case 12:case"end":return e.stop()}}),e)})),e.t0=i().keys(r);case 3:if((e.t1=e.t0()).done){e.next=10;break}return o=e.t1.value,e.delegateYield(a(o),"t2",6);case 6:if(!e.t2){e.next=8;break}return e.abrupt("continue",3);case 8:e.next=3;break;case 10:case"end":return e.stop()}}),e)}))),function(e,t){return a.apply(this,arguments)})},{key:"executePalletization",value:(r=(0,n.A)(i().mark((function e(t,n,r,a){var o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ri.applyPalletization(this.mPalletizationContexts[r.id],this.mPalletizationTextures[r.id],r.imageSrc,t,n.palletization.settings,a);case 3:o=e.sent,this.mPalletizationContexts[r.id]=o.context,r.id in this.mValue.palletization.objects&&(this.mValue.palletization.objects[r.id].palette=a.palette,this.mValue.palletization.objects[r.id].palette_override=a.palette_override,this.mValue.palletization.objects[r.id].hash=Ri.generateHash(a)),e.next=13;break;case 8:e.prev=8,e.t0=e.catch(0),v.UX.error("Unable to palletize image:",e.t0),delete this.mPalletizationContexts[a.object_id],r.imageSrc="";case 13:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t,n,i){return r.apply(this,arguments)})},{key:"getImagesForPalletizationFromCanvas",value:function(e){var t=this;return e.filter((function(e){return"image"===e.type&&(e.id in t.mValue.palletization.objects||!!e.imageSrc&&(0,h.$D)(e.imageSrc))}))}},{key:"needPalletizationRefreshForExternalColors",value:function(e){return!!e.allow_palletization&&(!!e.external_colors&&(this.mValue.palletization.settings.allowed_colors.length!==e.palletization_colors.length||!this.mValue.palletization.settings.allowed_colors.every((function(t){return e.palletization_colors.some((function(e){return e.color===t.color}))}))))}},{key:"setVisibilityPalletizationColors",value:function(e){var t=this,n=!1,r=this.resolveValuable(),i={};Object.keys(e).forEach((function(t){var n=Ri.sanitizeColor(t,r.palletization_transparency_mode);i[n]=e[t]})),null==r||r.palletization_colors.forEach((function(e){e.visible=!Object.keys(i).includes(e.color)||!i[e.color]})),this.mValue.palletization.settings.allowed_colors.forEach((function(e){e.visible=!Object.keys(i).includes(e.color)||!i[e.color],n=!0})),n&&Object.keys(this.mPalletizationDirtyFlags).forEach((function(e){t.mPalletizationDirtyFlags[e]=!0}));this.processUpdateEvent({broadcast_options:{emitEvent:!1,rebuild:!1}}).then((function(){t.broadcastAttributeUpdated()})).catch((function(e){v.UX.error(e)}))}},{key:"disposePalletizationObject",value:function(e){e in this.mValue.palletization.objects&&(Ri.clearPalettes(this.mValue.palletization.objects[e]),e in this.mPalletizationContexts&&(Ri.destroyContext(this.mPalletizationContexts[e]),delete this.mPalletizationContexts[e]),e in this.mPalletizationTextures&&(this.mPalletizationTextures[e].dispose(),delete this.mPalletizationTextures[e]),delete this.mPalletizationDirtyFlags[e],delete this.mValue.palletization.objects[e])}}],[{key:"getDefaultOptions",value:function(){return{canvas:{objects:[],type:"",version:1},sticker_path:{},palletization:{settings:{enabled:!1,version:1,max_colors:1,transparency_mode:"opaque",allowed_colors:[]},objects:{}}}}}]);var r,a,l,m,p,d}(Er);function ga(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ba(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ga(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ga(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Aa(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Aa=function(){return!!e})()}(0,c.A)(ya,"TypeRTTI",new le.O("AttributeSvgCanvasController",Er.TypeRTTI));var _a,Ma,ka=function(e){function t(e,n){var r,i,a,o;(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Aa()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mValue",{media_id:null,print_ready_file_id:null,svg_element:null,clipping_element:null,primary_color:"",primary_color_output:"",secondary_color:"",secondary_color_output:"",direction:null});var u=r.resolveValuable();return null!=u&&r.setValue({primary_color:u.primary_color,primary_color_output:u.primary_color_output,secondary_color:u.secondary_color,secondary_color_output:u.secondary_color_output,direction:u.direction}),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"getValue",value:function(){if(this.mAttributeData.attribute_values.length>0){var e=this.mAttributeData.attribute_values[0].attribute_value_valuable;null!=e&&(this.mValue.media_id=e.media_id,this.mValue.print_ready_file_id=e.print_ready_file_id,this.mValue.svg_element=e.svg_element,this.mValue.clipping_element=e.clipping_element)}return this.mValue}},{key:"getValueName",value:function(){var e=this.resolveValuable(),t=this.mValue.primary_color||e&&e.primary_color||"",n=this.mValue.secondary_color||e&&e.secondary_color||"",r=this.mValue.direction||e&&e.direction||"";return"primary_color: ".concat(t,", secondary_color: ").concat(n,", direction: ").concat(r,"; ")}},{key:"parse",value:function(e,t){null!=e&&this.setValue(e,t)}},{key:"resetValue",value:function(e){var t=this.resolveValuable();this.mValue.primary_color=t&&t.primary_color||"",this.mValue.primary_color_output=t&&t.primary_color_output||"",this.mValue.secondary_color=t&&t.secondary_color||"",this.mValue.secondary_color_output=t&&t.secondary_color_output||"",this.mValue.direction=t&&t.direction||null,this.mValue.media_id=t&&t.media_id||null,this.mValue.print_ready_file_id=t&&t.print_ready_file_id||null,this.mValue.svg_element=t&&t.svg_element||null,this.mValue.clipping_element=t&&t.clipping_element||null,delete this.mValue.value,this.broadcast(e)}},{key:"setValue",value:function(e,t){var n,r;(this.mValue=ba(ba({},this.mValue),e),"string"==typeof this.mValue.primary_color)&&(this.mValue.primary_color_output=null!==(n=kn(this.mValue.primary_color,this.mAttributeData.meta.output_color_format))&&void 0!==n?n:"");"string"==typeof this.mValue.secondary_color&&(this.mValue.secondary_color_output=null!==(r=kn(this.mValue.secondary_color,this.mAttributeData.meta.output_color_format))&&void 0!==r?r:"");this.updateValues(),this.dispatchToRenderer(t).then((function(){}),(function(e){v.UX.error(e)})),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"dispatchToRenderer",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:return(o=ba({},this.getValue())).primary_color=null!==(n=kn(o.primary_color,"hex"))&&void 0!==n?n:"#000000",o.secondary_color=null!==(r=kn(o.secondary_color,"hex"))&&void 0!==r?r:"#FFFFFF",e.next=8,this.resolveSvgTextureController(a.print_ready_file_id);case 8:return s=e.sent,e.next=11,s.updateGradient(a.svg_element,o);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]);var r}(Er);function wa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ta(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wa(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xa(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xa=function(){return!!e})()}(Ma=_a||(_a={})).en="en",Ma.ar="ar",Ma.fr="fr",Ma.de="de",Ma.hi="hi",Ma.ja="ja",Ma.it="it",Ma.pt="pt",Ma.ru="ru",Ma.es="es",Ma.th="th",Ma.tr="tr",Ma.zh="zh",Ma.ko="ko",Ma.pa="pa";var Sa=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,xa()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"filterProfanityText",value:(a=(0,n.A)(i().mark((function e(n,r){var a,o,s,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.getLocale(),o=Ta({text:n,lang:a,replacesymbol:"*",requestComplete:!0},r),s={success:!0,text:n,found:0,plain_text:n},!(n.length<=2)){e.next=5;break}return e.abrupt("return",s);case 5:return e.prev=5,e.next=8,this.sendRequestFilter(o);case 8:if("complete"!==(u=e.sent).status||!u.data.result.found){e.next=11;break}return e.abrupt("return",Ta(Ta({},s),{},{text:u.data.result.text,found:parseInt(u.data.result.found,10)}));case 11:return e.abrupt("return",s);case 14:return e.prev=14,e.t0=e.catch(5),v.UX.error("Profanity service failed",e.t0),e.abrupt("return",Ta(Ta({},s),{},{success:!1}));case 18:case"end":return e.stop()}}),e,this,[[5,14]])}))),function(e,t){return a.apply(this,arguments)})},{key:"sendRequestFilter",value:(r=(0,n.A)(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,J.k.getInstance().post(et.w.makeApiRoute("services/webpurify:profanity"),t);case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})}],[{key:"getInstance",value:function(){return null===this._instance&&(this._instance=new this),this._instance}},{key:"getLocale",value:function(){var e=J.k.getInstance().getAcceptLanguage();if(!e)return _a.en;var t=e.split("-")[0];return _a[t]||_a.en}}]);var r,a}((0,u.A)((function e(){(0,s.A)(this,e)})));(0,c.A)(Sa,"_instance",null);var Ca=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"next",void 0)}),[{key:"setNext",value:function(e){this.next?this.next.setNext(e):this.next=e}},{key:"execute",value:(e=(0,n.A)(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.handler(t);case 2:if(n=e.sent,this.next){e.next=5;break}return e.abrupt("return",n);case 5:return e.abrupt("return",this.next.execute(n));case 6:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})}]);var e}();function Ea(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ra(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ea(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ea(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ia(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Oa(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Oa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Da(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Da=function(){return!!e})()}var Pa=function(e){function t(e,r){var a,o,u,l;return(0,s.A)(this,t),o=this,u=t,u=(0,oe.A)(u),a=(0,ae.A)(o,Da()?Reflect.construct(u,l||[],(0,oe.A)(o).constructor):u.apply(o,l)),(0,c.A)(a,"aController",void 0),(0,c.A)(a,"aProductAttributeComponent",void 0),(0,c.A)(a,"mModerate$",new M.B),(0,c.A)(a,"mModerateResult$",new M.B),(0,c.A)(a,"mControllerName",void 0),(0,c.A)(a,"mService",void 0),a.aController=e,a.aProductAttributeComponent=r,a.mControllerName=e.getType().getTypeName(),a.setProfanityFilter(e),a.mModerate$.pipe(C(500),Ar(function(){var e=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,Mr.of)(a.resolveModerateText(t)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())).subscribe(function(){var e=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.mModerateResult$.next(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),a}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"setProfanityFilter",value:function(e){var t=e.getAttribute().meta;if(t&&t.filters&&t.filters.profanity){var n=t.filters.profanity;this.mService=this.resolveService(n)}}},{key:"resolveService",value:function(e){var t=Object.entries(e).find((function(e){return!0===e[1]})),n=null;if(!t)return n;if("enable_webpurify"===t[0])n=Sa.getInstance();return n}},{key:"resolveModerateText",value:(f=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this.mControllerName,e.next="AttributeSvgTextController"===e.t0?3:"AttributeTextToImageController"===e.t0?7:"AttributeSvgCanvasController"===e.t0?11:15;break;case 3:return e.next=5,this.getTextFromSvgText(t);case 5:case 9:case 13:return t=e.sent,e.abrupt("break",15);case 7:return e.next=9,this.getTextFromTextToImage(t);case 11:return e.next=13,this.getTextFromSvgCanvas(t);case 15:return e.abrupt("return",t);case 16:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"moderateText",value:(h=(0,n.A)(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={text:t,found:0,plain_text:t},0!==t.length){e.next=3;break}return e.abrupt("return",n);case 3:return e.next=5,this.mService.filterProfanityText(t);case 5:return(r=e.sent).success&&r.found&&(n.text=r.text,n.found=r.found,n.plain_text=r.plain_text),e.abrupt("return",n);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"handler",value:(l=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mService){e.next=2;break}return e.abrupt("return",t);case 2:return this.mModerate$.next(t),e.next=5,this.mModerateResult$.pipe((0,E.s)(1)).toPromise();case 5:return e.next=7,e.sent.toPromise();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"getTextFromSvgCanvas",value:(o=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.objects.filter((function(e){return"i-text"===e.type})),r=!1,a=[],o=Ia(n),e.prev=4,o.s();case 6:if((s=o.n()).done){e.next=15;break}return u=s.value,e.next=10,this.moderateText(u.text);case 10:c=e.sent,u.text=c.text,c.found&&(r=!0,a.push(Ra(Ra({},c),{object_id:u.id})));case 13:e.next=6;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(4),o.e(e.t0);case 20:return e.prev=20,o.f(),e.finish(20);case 23:return r&&this.aController.broadcastAttributeModerated(a),e.abrupt("return",t);case 25:case"end":return e.stop()}}),e,this,[[4,17,20,23]])}))),function(e){return o.apply(this,arguments)})},{key:"getTextFromSvgText",value:(a=(0,n.A)(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=8;break}return e.next=3,this.moderateText(t);case 3:return(n=e.sent).found&&this.aController.broadcastAttributeModerated(n),e.abrupt("return",n.text);case 8:return e.next=10,this.moderateText(t.text);case 10:return r=e.sent,t.text=r.text,r.found&&this.aController.broadcastAttributeModerated(r),e.abrupt("return",t);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getTextFromTextToImage",value:(r=(0,n.A)(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=8;break}return e.next=3,this.moderateText(t);case 3:return(n=e.sent).found&&this.aController.broadcastAttributeModerated(n),e.abrupt("return",n.text);case 8:return e.next=10,this.moderateText(t.value);case 10:return r=e.sent,t.value=r.text,r.found&&this.aController.broadcastAttributeModerated(r),e.abrupt("return",t);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]);var r,a,o,l,h,f}(Ca);function Ba(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ba=function(){return!!e})()}var Fa=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["attributeManager"],r=(0,oe.A)(r),e=(0,ae.A)(n,Ba()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mProductId",void 0),(0,c.A)(e,"mLoaderService",void 0),(0,c.A)(e,"mProductAttributes",[]),(0,c.A)(e,"mAttributeControllers",{}),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"mEventBrokers",[]),(0,c.A)(e,"mMaterialGroupManagerAccessor",null),(0,c.A)(e,"onAttributeChanged",new M.B),(0,c.A)(e,"onAttributeUpdated",new M.B),(0,c.A)(e,"onAttributeModerated",new M.B),(0,c.A)(e,"_handleOptionVisibilityChange",(function(t){t.product_scene_uuid===e.getParentObject().getObjectUUID()&&e._setVisibility(t.attribute_id,t.visible,t)})),(0,c.A)(e,"handleSetValue",(function(t){if("product_id"===t.key)e._setProductId(t.value)})),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this,t=this.getParentObject(),n=t.getValue("product_id");void 0!==n&&this._setProductId(n),this.mSubscriptions.push(this.onAttributeChanged.subscribe((function(e){R.K.eventBus().dispatch(new K.r(Q.E.ProductOptionChanged,e))})),this.onAttributeUpdated.subscribe((function(e){R.K.eventBus().dispatch(new K.r(Q.E.ProductAttributeUpdated,e))})),this.onAttributeModerated.subscribe((function(e){R.K.eventBus().dispatch(new K.r(Q.E.ProductAttributeModerated,e))}))),this.mEventBrokers.push(R.K.messenger().listen(m.P9.TypeRTTI,this._handleOptionVisibilityChange.bind(this)),R.K.messenger().listen(m.A_.TypeRTTI,(function(t){e._getAttributeControllers().forEach((function(e){e.onMaterialUpdated(t)}))}),String(t.getSceneObjectId()))),this.registerMessageHandler(m.fV.TypeRTTI,this.handleSetValue)}},{key:"OnDetached",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mEventBrokers.splice(0).forEach((function(e){return e.unsubscribe()})),this.unregisterMessageHandler(m.fV.TypeRTTI),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mLoaderService&&(this.mLoaderService.error("product options detached"),delete this.mLoaderService),this.mProductAttributes.splice(0),Object.entries(this.mAttributeControllers).forEach((function(e){(0,o.A)(e,2)[1].destroy()}))}},{key:"isAttachable",value:function(e){return e.isDerivedOfTypeName("ProductNode")}},{key:"_loadDependencies",value:function(){return(0,sn.p)([this._depResolveMaterialManager()])}},{key:"_depResolveMaterialManager",value:function(){var e=this,t=this.getParentObject().getComponent("materialGroupManager");return t?t.resolveMaterialGroups().pipe((0,E.s)(1),(0,k.M)((function(t){return e.mMaterialGroupManagerAccessor=t,t}))):(0,un.$)((function(){return new Error("Material group component not found")}))}},{key:"_loadProductAttributes",value:(l=(0,n.A)(i().mark((function e(){var t,n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,y._)(Rt._.getInstance().resolveBootstrapData(this.mProductId));case 2:return t=e.sent,n=t.getAttributes(),(r=JSON.parse(JSON.stringify(It.eE.getItems(n)))).sort((function(e,t){return e.position-t.position})),this.mProductAttributes=r,this._makeAttributeControllers(),e.abrupt("return",r);case 9:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"_getProduct",value:function(){return this.getParentObject()}},{key:"_setProductId",value:function(e){this.mProductId!==e&&(this.mProductId=e,this.mMaterialGroupManagerAccessor=null,this.mLoaderService&&(this.mLoaderService.error("product id has changed"),delete this.mLoaderService))}},{key:"resolveAttributeManager",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return null===this.mProductId||void 0===this.mProductId?(v.UX.warn("trying to load product options with undefined product id"),(0,un.$)((function(){return new Error("undefined product id")}))):(this.mLoaderService&&t&&(this.mLoaderService.error("Disposed"),delete this.mLoaderService),this.mLoaderService||(this.mLoaderService=new L.m(1),this._loadDependencies().pipe(mn((0,n.A)(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e._loadProductAttributes());case 1:case"end":return t.stop()}}),t)})))),(0,E.s)(1)).subscribe({next:function(){e.mLoaderService&&(e.mLoaderService.next(new pn(e)),e.mLoaderService.complete())},error:function(t){e.mLoaderService&&e.mLoaderService.error(t),delete e.mLoaderService}})),this.mLoaderService)}},{key:"_makeAttributeControllers",value:function(){var e=this,t={};Object.keys(this.mAttributeControllers).forEach((function(n){var r=Number(n);t[r]=e.mAttributeControllers[r].serialize({include_keys:!1,discard_hidden:!1,calculate_approximations:!1}),e.mAttributeControllers[r].destroy()})),this.mAttributeControllers={},this.mProductAttributes.forEach((function(n){var r=!0;switch(n.type){case"question":e.mAttributeControllers[n.id]=new yr(n,e);break;case"matgroup":e.mAttributeControllers[n.id]=new Vn(n,e);break;case"color":e.mAttributeControllers[n.id]=new An(n,e);break;case"color_picker":e.mAttributeControllers[n.id]=new Tn(n,e);break;case"image_upload":e.mAttributeControllers[n.id]=new Ln(n,e);break;case"text_input":e.mAttributeControllers[n.id]=new Ki(n,e);break;case"text_to_image":e.mAttributeControllers[n.id]=new sa(n,e),e.mAttributeControllers[n.id].registerMiddleware(new Pa(e.mAttributeControllers[n.id],e));break;case"operable_numbers_input":e.mAttributeControllers[n.id]=new pr(n,e);break;case"svg_element":e.mAttributeControllers[n.id]=new Pr(n,e);break;case"svg_image":e.mAttributeControllers[n.id]=new Pi(n,e);break;case"svg_image_selector":e.mAttributeControllers[n.id]=new ji(n,e);break;case"svg_element_selector":e.mAttributeControllers[n.id]=new jr(n,e);break;case"svg_text":e.mAttributeControllers[n.id]=new qi(n,e),e.mAttributeControllers[n.id].registerMiddleware(new Pa(e.mAttributeControllers[n.id],e));break;case"title":case"header":case"custom":case"step":e.mAttributeControllers[n.id]=new br(n,e);break;case"svg_canvas":e.mAttributeControllers[n.id]=new ya(n,e),e.mAttributeControllers[n.id].registerMiddleware(new Pa(e.mAttributeControllers[n.id],e));break;case"svg_gradient":e.mAttributeControllers[n.id]=new ka(n,e);break;default:r=!1}r&&null!==t[n.id]&&void 0!==t[n.id]&&e.mAttributeControllers[n.id].parse(t[n.id])}))}},{key:"_getMaterialGroupManager",value:function(){return this.mMaterialGroupManagerAccessor}},{key:"_hasAttribute",value:function(e){return!!this.mAttributeControllers[e]}},{key:"_getRawAttributes",value:function(){return this.mProductAttributes}},{key:"_getAttributes",value:function(){var e=[];return this._getAttributeControllers().forEach((function(t){e.push(t.getAttribute())})),e}},{key:"_cloneAttributes",value:function(){return h.N5.deepCloneJSON(this._getAttributes())}},{key:"_getAttribute",value:function(e){var t=this._getAttributeController(e);if(t)return t.getAttribute()}},{key:"_getAttributeByName",value:function(e){var t=this._getAttributeControllerByName(e);if(t)return t.getAttribute()}},{key:"_getAttributeIdByName",value:function(e){return this._getAttributeIdBy("name",e)}},{key:"_getAttributeIdByKey",value:function(e){return this._getAttributeIdBy("key",e)}},{key:"_getAttributeIdBy",value:function(e,t){var n=t.toLowerCase().trim();n=(n=n.replace(/\u202d/g,"")).replace(/\u202c/g,"");var r=this.mProductAttributes.find((function(t){if("string"!=typeof t[e])return!1;var r=t[e].toLowerCase().trim();return(r=(r=r.replace(/\u202d/g,"")).replace(/\u202c/g,""))===n}));return r?r.id:-1}},{key:"_getAttributeControllers",value:function(){var e=this;return Object.keys(this.mAttributeControllers).map((function(t){return e.mAttributeControllers[Number(t)]}))}},{key:"_getAttributeController",value:function(e){if(this._hasAttribute(e))return this.mAttributeControllers[e];v.UX.warn("Attribute id '".concat(e,"' not found@getAttribute"))}},{key:"_getAttributeControllerByName",value:function(e){var t=this._getAttributeIdByName(e);if(t>=0)return this.mAttributeControllers[t]}},{key:"_setValue",value:(a=(0,n.A)(i().mark((function e(t,n,r){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._hasAttribute(t)){e.next=3;break}return v.UX.warn("Attribute id '".concat(t,"' not found@setValue")),e.abrupt("return",void 0);case 3:return e.next=5,this.mAttributeControllers[t].setNextValue(n,r);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return a.apply(this,arguments)})},{key:"_getValue",value:function(e){if(this._hasAttribute(e))return this.mAttributeControllers[e].getValue();v.UX.warn("Attribute id '".concat(e,"' not found@_getValue"))}},{key:"_getValueName",value:function(e){if(this._hasAttribute(e))return this.mAttributeControllers[e].getValueName();v.UX.warn("Attribute id '".concat(e,"' not found@_getValueName"))}},{key:"_resetValue",value:function(e,t){if(this._hasAttribute(e))return this.mAttributeControllers[e].resetValue(t);v.UX.warn("Attribute id '".concat(e,"' not found@_resetValue"))}},{key:"_setValueByName",value:(r=(0,n.A)(i().mark((function e(t,n,r){var a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((a=this._getAttributeIdByName(t))<0)){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this._setValue(a,n,r);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"_getValueByName",value:function(e){var t=this._getAttributeIdByName(e);if(!(t<0))return this._getValue(t)}},{key:"_setValueByKey",value:function(e,t,n){var r=this._getAttributeIdByKey(e);r<0||this.mAttributeControllers[r].setValueByKey(t,n)}},{key:"_getValueByKey",value:function(e){var t=this._getAttributeIdByKey(e);if(!(t<0))return this._getValue(t)}},{key:"_getValueNameByName",value:function(e){var t=this._getAttributeIdByName(e);if(!(t<0))return this._getValueName(t)}},{key:"_resetValueByName",value:function(e,t){var n=this._getAttributeIdByName(e);if(!(n<0))return this._resetValue(n,t)}},{key:"_resetAllValues",value:function(e){var t=this;return Object.keys(this.mAttributeControllers).map((function(n){return t.mAttributeControllers[n].resetValue(e)}))}},{key:"_setVisibility",value:function(e,t,n){this._hasAttribute(e)?this.mAttributeControllers[e].setVisibility(t,n):v.UX.warn("Attribute id '".concat(e,"' not found@_setVisibility"))}},{key:"_setVisibilityByName",value:function(e,t,n){var r=this._getAttributeIdByName(e);r<0||this._setVisibility(r,t,n)}},{key:"_isVisible",value:function(e,t){if(this._hasAttribute(e))return this.mAttributeControllers[e].isVisible(t);v.UX.warn("Attribute id '".concat(e,"' not found@_isVisible"))}},{key:"_buildQueryParams",value:function(e,t){var n=this,r={};return Object.keys(this.mAttributeControllers).forEach((function(i){var a=Number(i),o=n.mAttributeControllers[a].getQueryParam(e,t);Object.assign(r,o)})),r}},{key:"_serialize",value:function(e){var t=[];return this._getAttributeControllers().sort((function(e,t){return e.getAttribute().position-t.getAttribute().position})).forEach((function(n){var r=n.serialize(e);r&&t.push(r)})),t}},{key:"_parse",value:function(e,t){var n=this;e.forEach((function(e){void 0!==e.attribute_id&&n.mAttributeControllers[e.attribute_id]&&n.mAttributeControllers[e.attribute_id].parse(e.attribute_value,t)}))}},{key:"_hashConfiguration",value:function(){var e="";return this._serialize({discard_hidden:!1,include_keys:!1,calculate_approximations:!1}).forEach((function(t){e+="".concat(t.attribute_id,"/").concat(t.attribute_value_name)})),f.V.Md5(e)}}]);var r,a,l}(he.$);(0,c.A)(Fa,"TypeRTTI",new le.O("ProductAttributeManagerComponent",he.$.TypeRTTI));var Na=__webpack_require__(62411),La=(__webpack_require__(16034),__webpack_require__(25509),__webpack_require__(65223),__webpack_require__(43375),__webpack_require__(60321),__webpack_require__(41927),__webpack_require__(11632),__webpack_require__(64377),__webpack_require__(39225),__webpack_require__(66771),__webpack_require__(13972),__webpack_require__(12516),__webpack_require__(99209),__webpack_require__(68931),__webpack_require__(25714),__webpack_require__(52514),__webpack_require__(35694),__webpack_require__(52774),__webpack_require__(49536),__webpack_require__(21926),__webpack_require__(17561),__webpack_require__(16864),__webpack_require__(66197),__webpack_require__(16215),function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mMaterialGroupManager",void 0),this.mMaterialGroupManager=t}),[{key:"onMaterialChanged",get:function(){return this.mMaterialGroupManager.onMaterialChanged}},{key:"onMaterialVisibility",get:function(){return this.mMaterialGroupManager.onMaterialVisibility}},{key:"getGroups",value:function(){return this.mMaterialGroupManager._getGroups()}},{key:"getGroup",value:function(e){return this.mMaterialGroupManager._getGroup(e)}},{key:"getGroupByGroupId",value:function(e){return this.mMaterialGroupManager._getGroupByGroupId(e)}},{key:"getActiveGroupSKU",value:function(e){return this.mMaterialGroupManager._getActiveGroupSKU(e)}},{key:"getActiveRefId",value:function(e){return this.mMaterialGroupManager._getActiveRefId(e)}},{key:"getActiveRefModel",value:function(e){return this.mMaterialGroupManager._getActiveRefModel(e)}},{key:"getActiveMaterial",value:function(e){return this.mMaterialGroupManager._getActiveMaterial(e)}},{key:"setActiveMaterial",value:(l=(0,n.A)(i().mark((function e(t,n,r){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mMaterialGroupManager._setActiveMaterial(t,n,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return l.apply(this,arguments)})},{key:"setActiveMaterialByMaterialId",value:(o=(0,n.A)(i().mark((function e(t,n,r){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mMaterialGroupManager._setActiveMaterialByMaterialId(t,n,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return o.apply(this,arguments)})},{key:"setActiveMaterialBySku",value:(a=(0,n.A)(i().mark((function e(t,n,r){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mMaterialGroupManager._setActiveMaterialBySku(t,n,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return a.apply(this,arguments)})},{key:"setActiveMaterialByName",value:(r=(0,n.A)(i().mark((function e(t,n,r){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mMaterialGroupManager._setActiveMaterialByName(t,n,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"resetActiveMaterial",value:function(e,t){this.mMaterialGroupManager._resetActiveMaterial(e,t)}},{key:"setActiveMaterialByGroupId",value:(t=(0,n.A)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mMaterialGroupManager._setActiveMaterialByGroupId(t,n);case 2:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"resetVisibilityOverwrites",value:function(e,t){this.mMaterialGroupManager._resetVisibilityOverwrites(e,t)}},{key:"resetFolderVisibilityOverwrites",value:function(e,t){this.mMaterialGroupManager._resetFolderVisibilityOverwrites(e,t)}},{key:"setMaterialVisibility",value:function(e,t,n,r,i){this.mMaterialGroupManager._setMaterialVisibility(e,t,n,r,i)}},{key:"setMaterialVisibilityGlobalOverwrite",value:function(e,t){this.mMaterialGroupManager._setMaterialVisibilityGlobalOverwrite(e,t)}},{key:"setMaterialVisibilityByGroupId",value:function(e,t,n,r,i){this.mMaterialGroupManager._setMaterialVisibilityByGroupId(e,t,n,r,i)}},{key:"setMaterialVisibilityByFolderId",value:function(e,t,n,r){this.mMaterialGroupManager._setMaterialVisibilityByFolderId(e,t,n,r)}},{key:"setColorOverwrite",value:function(e,t,n){this.mMaterialGroupManager._setColorOverwrite(e,t,n)}},{key:"setMapOverwrite",value:(e=(0,n.A)(i().mark((function e(t,n,r,a){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mMaterialGroupManager._setMapOverwrite(t,n,r,a);case 2:case"end":return e.stop()}}),e,this)}))),function(t,n,r,i){return e.apply(this,arguments)})},{key:"buildQueryParams",value:function(e){return this.mMaterialGroupManager._buildQueryParams(e)}},{key:"applyOverwritesOnMaterialReference",value:function(e){this.mMaterialGroupManager._applyOverwritesOnMaterialReference(e)}},{key:"getAvailableReferences",value:function(e){return this.mMaterialGroupManager._getAvailableReferences(e)}},{key:"getGroupReferencesByGroupId",value:function(e){return this.mMaterialGroupManager._getGroupReferencesByGroupId(e)}}]);var e,t,r,a,o,l}()),ja=__webpack_require__(85121);function Ua(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Va(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Va(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Va(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var za=function(){function e(){(0,s.A)(this,e),(0,c.A)(this,"mDependencyLoaders",{}),(0,c.A)(this,"mModels",{}),(0,c.A)(this,"mMaterialGroups",{}),(0,c.A)(this,"mMaterialGroupReferences",{}),(0,c.A)(this,"mMaterialReferences",{}),(0,c.A)(this,"mMaterialReferencesByIdSubject",{}),(0,c.A)(this,"mMaterialReferencesByMaterialIdSubject",{}),(0,c.A)(this,"mMaterialReferencesBySkuSubject",{}),(0,c.A)(this,"mMaterialReferencesByNameSubject",{})}return(0,u.A)(e,[{key:"resolveMaterialGroupsByCatalogueId",value:(m=(0,n.A)(i().mark((function e(t){var n,r,a,o,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.finishDependencies(t);case 2:if(t in this.mModels){e.next=4;break}throw new Error("Unable to find data for given product!");case 4:n=this.mModels[t],r=[],a=Ua(n),e.prev=7,a.s();case 9:if((o=a.n()).done){e.next=17;break}if((s=o.value)in this.mMaterialGroups){e.next=14;break}return v.UX.error("MaterialGroupService: Unable to find material group:",s,t),e.abrupt("continue",15);case 14:r.push(this.mMaterialGroups[s]);case 15:e.next=9;break;case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(7),a.e(e.t0);case 22:return e.prev=22,a.f(),e.finish(22);case 25:return e.abrupt("return",r);case 26:case"end":return e.stop()}}),e,this,[[7,19,22,25]])}))),function(e){return m.apply(this,arguments)})},{key:"resolveMaterialReference",value:(f=(0,n.A)(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t in this.mMaterialReferencesByIdSubject)){e.next=4;break}return e.next=3,(0,y._)(this.mMaterialReferencesByIdSubject[t]);case 3:return e.abrupt("return",this.mMaterialReferences[t]);case 4:return this.mMaterialReferencesByIdSubject[t]=new L.m(1),e.next=7,this.finishDependencies();case 7:if(!(t in this.mMaterialReferences)){e.next=10;break}return this.mMaterialReferencesByIdSubject[t].next(!0),e.abrupt("return",this.mMaterialReferences[t]);case 10:return e.prev=10,r="material_reference/".concat(t),e.next=14,J.k.getInstance().get(et.w.makeApiRoute(r));case 14:if(a=e.sent,n=It.eE.getItem(a.data)){e.next=18;break}throw new Error("Material reference not found!");case 18:this.mMaterialReferences[n.id]=n,this.mMaterialGroupReferences[n.material_group_id].find((function(e){return e===n.id}))||this.mMaterialGroupReferences[n.material_group_id].push(n.id),this.mMaterialReferencesByIdSubject[t].next(!0),e.next=27;break;case 23:throw e.prev=23,e.t0=e.catch(10),this.mMaterialReferencesByIdSubject[t].error(e.t0),e.t0;case 27:return e.abrupt("return",n);case 28:case"end":return e.stop()}}),e,this,[[10,23]])}))),function(e){return f.apply(this,arguments)})},{key:"resolveMaterialReferenceByMaterialId",value:(h=(0,n.A)(i().mark((function e(t,n){var r,a,s,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((r="".concat(t,"|").concat(n))in this.mMaterialReferencesByMaterialIdSubject)){e.next=5;break}return e.next=4,(0,y._)(this.mMaterialReferencesByMaterialIdSubject[r]);case 4:return e.abrupt("return",Object.values(this.mMaterialReferences).find((function(e){return e.material_group_id===t&&e.material_id===n})));case 5:return this.mMaterialReferencesByMaterialIdSubject[r]=new L.m(1),e.next=8,this.finishDependencies();case 8:if(!(a=Object.values(this.mMaterialReferences).find((function(e){return e.material_group_id===t&&e.material_id===n})))){e.next=12;break}return this.mMaterialReferencesByMaterialIdSubject[r].next(!0),e.abrupt("return",a);case 12:return e.prev=12,s="material_reference/search?search[material_id]==:".concat(n,"&filter[material_group_id]==:").concat(t),e.next=16,J.k.getInstance().get(et.w.makeApiRoute(s));case 16:if(u=e.sent,c=It.eE.getItems(u.data),l=(0,o.A)(c,1),a=l[0]){e.next=22;break}throw new Error("Material reference not found!");case 22:this.mMaterialReferences[a.id]=a,a.material_group_id in this.mMaterialGroupReferences||(this.mMaterialGroupReferences[a.material_group_id]=[]),this.mMaterialGroupReferences[a.material_group_id].find((function(e){return e===a.id}))||this.mMaterialGroupReferences[a.material_group_id].push(a.id),this.mMaterialReferencesByMaterialIdSubject[r].next(!0),e.next=32;break;case 28:throw e.prev=28,e.t0=e.catch(12),this.mMaterialReferencesByMaterialIdSubject[r].error(e.t0),e.t0;case 32:return e.abrupt("return",a);case 33:case"end":return e.stop()}}),e,this,[[12,28]])}))),function(e,t){return h.apply(this,arguments)})},{key:"resolveMaterialReferenceBySku",value:(l=(0,n.A)(i().mark((function e(t,n){var r,a,s,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((r="".concat(t,"|").concat(n))in this.mMaterialReferencesBySkuSubject)){e.next=5;break}return e.next=4,(0,y._)(this.mMaterialReferencesBySkuSubject[r]);case 4:return e.abrupt("return",Object.values(this.mMaterialReferences).find((function(e){return e.material_group_id===t&&e.sku===n})));case 5:return this.mMaterialReferencesBySkuSubject[r]=new L.m(1),e.next=8,this.finishDependencies();case 8:if(!(a=Object.values(this.mMaterialReferences).find((function(e){return e.material_group_id===t&&e.sku===n})))){e.next=12;break}return this.mMaterialReferencesBySkuSubject[r].next(!0),e.abrupt("return",a);case 12:return e.prev=12,s="material_reference/search?filter[material_group_ref_sku]==:".concat(n,"&filter[material_group_id]==:").concat(t),e.next=16,J.k.getInstance().get(et.w.makeApiRoute(s));case 16:if(u=e.sent,c=It.eE.getItems(u.data),l=(0,o.A)(c,1),a=l[0]){e.next=22;break}throw new Error("Material reference not found!");case 22:this.mMaterialReferences[a.id]=a,a.material_group_id in this.mMaterialGroupReferences||(this.mMaterialGroupReferences[a.material_group_id]=[]),this.mMaterialGroupReferences[a.material_group_id].find((function(e){return e===a.id}))||this.mMaterialGroupReferences[a.material_group_id].push(a.id),this.mMaterialReferencesBySkuSubject[r].next(!0),e.next=32;break;case 28:throw e.prev=28,e.t0=e.catch(12),this.mMaterialReferencesBySkuSubject[r].error(e.t0),e.t0;case 32:return e.abrupt("return",a);case 33:case"end":return e.stop()}}),e,this,[[12,28]])}))),function(e,t){return l.apply(this,arguments)})},{key:"resolveMaterialReferenceByName",value:(a=(0,n.A)(i().mark((function e(t,n){var r,a,s,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((r="".concat(t,"|").concat(n))in this.mMaterialReferencesByNameSubject)){e.next=5;break}return e.next=4,(0,y._)(this.mMaterialReferencesByNameSubject[r]);case 4:return e.abrupt("return",Object.values(this.mMaterialReferences).find((function(e){return e.material_group_id===t&&(e.name===n||e.material_name===n)})));case 5:return this.mMaterialReferencesByNameSubject[r]=new L.m(1),e.next=8,this.finishDependencies();case 8:if(!(a=Object.values(this.mMaterialReferences).find((function(e){return e.material_group_id===t&&(e.name===n||e.material_name===n)})))){e.next=12;break}return this.mMaterialReferencesByNameSubject[r].next(!0),e.abrupt("return",a);case 12:return e.prev=12,s="material_reference/search?search[material_group_ref_name]==:".concat(n,"&search[material.name]==:").concat(n,"&filter[material_group_id]==:").concat(t),e.next=16,J.k.getInstance().get(et.w.makeApiRoute(s));case 16:if(u=e.sent,c=It.eE.getItems(u.data),l=(0,o.A)(c,1),a=l[0]){e.next=22;break}throw new Error("Material reference not found!");case 22:this.mMaterialReferences[a.id]=a,a.material_group_id in this.mMaterialGroupReferences||(this.mMaterialGroupReferences[a.material_group_id]=[]),this.mMaterialGroupReferences[a.material_group_id].find((function(e){return e===a.id}))||this.mMaterialGroupReferences[a.material_group_id].push(a.id),this.mMaterialReferencesByNameSubject[r].next(!0),e.next=32;break;case 28:throw e.prev=28,e.t0=e.catch(12),this.mMaterialReferencesByNameSubject[r].error(e.t0),e.t0;case 32:return e.abrupt("return",a);case 33:case"end":return e.stop()}}),e,this,[[12,28]])}))),function(e,t){return a.apply(this,arguments)})},{key:"getMaterialReferences",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c,l,h,f,m,p,d,v,y=this,g=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=g.length>1&&void 0!==g[1]?g[1]:0,r=g.length>2&&void 0!==g[2]?g[2]:500,a=g.length>3&&void 0!==g[3]?g[3]:"asc",o=g.length>4&&void 0!==g[4]?g[4]:"position",s=Math.max(null!=n?n:0,0),u=Math.max(Math.min(null!=r?r:500,ja.c.maxBunchSize),0),c=new URL("".concat(et.w.apiUrl,"material_reference/search")),l=a||"asc",h=o||"position",c.searchParams.append("filter[material_group_id]","=:".concat(t)),c.searchParams.append("include_total","1"),c.searchParams.append("sort","".concat(h,"|").concat(l)),c.searchParams.append("cursor","".concat(s)),c.searchParams.append("limit","".concat(u)),e.next=16,J.k.getInstance().get(decodeURIComponent(c.toString()),{headers:{Accept:"application/json"}});case 16:f=e.sent,m=f.data.data,p=Ua(m),e.prev=19,v=i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=d.value,y.mMaterialReferences[t.id]=t.attributes,y.mMaterialGroupReferences[t.attributes.material_group_id].find((function(e){return e===t.id}))||y.mMaterialGroupReferences[t.attributes.material_group_id].push(t.id);case 3:case"end":return e.stop()}}),e)})),p.s();case 22:if((d=p.n()).done){e.next=26;break}return e.delegateYield(v(),"t0",24);case 24:e.next=22;break;case 26:e.next=31;break;case 28:e.prev=28,e.t1=e.catch(19),p.e(e.t1);case 31:return e.prev=31,p.f(),e.finish(31);case 34:return e.abrupt("return",f.data);case 35:case"end":return e.stop()}}),e,null,[[19,28,31,34]])}))),function(e){return r.apply(this,arguments)})},{key:"isCatalogueRegistered",value:function(e){return e in this.mDependencyLoaders}},{key:"preloadCatalogue",value:function(e){var t=this;return this.mDependencyLoaders[e]||(this.mDependencyLoaders[e]=new L.m(1),v.UX.print("Material resolving bootstrap data for:",e),Rt._.getInstance().resolveBootstrapData(e).pipe((0,E.s)(1)).subscribe({next:function(n){var r=n.getMaterialsByGroup();t.mModels[e]=r.map((function(e){return e.id}));var i,a=Ua(r);try{for(a.s();!(i=a.n()).done;){var o=i.value;o.id in t.mMaterialGroups||(t.mMaterialGroups[o.id]=o);var s,u=[],c=Ua(o.defaults);try{for(c.s();!(s=c.n()).done;){var l=s.value;u.push(l)}}catch(e){c.e(e)}finally{c.f()}var h,f=Ua(o.materials.data);try{var m=function(){var e=h.value;if(u.find((function(t){return t.id===e.id})))return 1;u.push(e.attributes)};for(f.s();!(h=f.n()).done;)m()}catch(e){f.e(e)}finally{f.f()}t.mMaterialGroupReferences[o.id]=u.map((function(e){return e.id}));for(var p=0,d=u;p<d.length;p++){var y=d[p];y.id in t.mMaterialReferences||(t.mMaterialReferences[y.id]=y)}}}catch(e){a.e(e)}finally{a.f()}v.UX.print("Bootstrap material groups preloaded:",r),t.mDependencyLoaders[e].next(!0),t.mDependencyLoaders[e].complete()},error:function(n){v.UX.warn("Bootstrap material pre load failed:",n),t.mDependencyLoaders[e].error(n),delete t.mDependencyLoaders[e]}})),this.mDependencyLoaders[e]}},{key:"resetCache",value:function(){for(var e in this.disposeCacheLoader(),this.mModels={},this.mMaterialGroups={},this.mMaterialGroupReferences={},this.mMaterialReferences={},this.mMaterialReferencesByIdSubject)this.mMaterialReferencesByIdSubject[e].error("disposed"),delete this.mMaterialReferencesByIdSubject[e];for(var t in this.mMaterialReferencesByMaterialIdSubject)this.mMaterialReferencesByMaterialIdSubject[t].error("disposed"),delete this.mMaterialReferencesByMaterialIdSubject[t];for(var n in this.mMaterialReferencesBySkuSubject)this.mMaterialReferencesBySkuSubject[n].error("disposed"),delete this.mMaterialReferencesBySkuSubject[n];for(var r in this.mMaterialReferencesByNameSubject)this.mMaterialReferencesByNameSubject[r].error("disposed"),delete this.mMaterialReferencesByNameSubject[r];return this}},{key:"finishDependencies",value:(t=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===t||t in this.mDependencyLoaders){e.next=3;break}return e.next=3,(0,y._)(this.preloadCatalogue(t));case 3:return e.abrupt("return",new Promise((function(e,t){var r=Object.keys(n.mDependencyLoaders).map((function(e){return n.mDependencyLoaders[e].pipe((0,Fn.W)((function(){return(0,Mr.of)([])})))}));if(0===r.length)return e(!0);(0,sn.p)(r).pipe((0,cn.T)((function(e){return e.every((function(e){return e}))}))).subscribe({next:function(t){e(t)},error:function(e){t(e)}})})));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"disposeCacheLoader",value:function(){var e=this;Object.keys(this.mDependencyLoaders).forEach((function(t){e.mDependencyLoaders[t].error("disposed")})),this.mDependencyLoaders={}}}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}]);var t,r,a,l,h,f,m}();(0,c.A)(za,"sInstance",void 0);var Ha=9999;function Ga(){return-++Ha}function qa(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Wa(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Wa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Ka=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"onMaterialChanged",new M.B),(0,c.A)(this,"onMaterialVisibility",new M.B),(0,c.A)(this,"mProductId",void 0),(0,c.A)(this,"mLoaderService",void 0),(0,c.A)(this,"mMaterialGroups",[]),(0,c.A)(this,"mMaterialGroupReferences",{}),(0,c.A)(this,"mMaterialReferences",{}),(0,c.A)(this,"mSelectedMaterialReferences",{}),(0,c.A)(this,"mColorOverwrites",{}),(0,c.A)(this,"mMapOverwrites",{}),(0,c.A)(this,"mVisibilityOverwrites",{}),(0,c.A)(this,"mVisibilityFolderOverwrites",{}),(0,c.A)(this,"mGlobalVisibilityOverwrite",{})}),[{key:"dispose",value:function(){this.mMaterialGroups.splice(0),this.mColorOverwrites={},this.mMapOverwrites={},this.mVisibilityOverwrites={},this.mVisibilityFolderOverwrites={},this.mLoaderService&&(this.mLoaderService.error("product options detached"),delete this.mLoaderService)}},{key:"_setProductId",value:function(e){this.mProductId=e,this.mLoaderService&&(this.mLoaderService.error("product id has changed"),delete this.mLoaderService)}},{key:"resolveMaterialGroups",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return void 0===this.mProductId?(v.UX.warn("Trying to load product options with undefined product id"),(0,un.$)((function(){return new Error("Product not found!")}))):(this.mLoaderService&&t&&(this.mLoaderService.error("Disposed"),delete this.mLoaderService),this.mLoaderService||(this.mLoaderService=new L.m(1),za.getInstance().resolveMaterialGroupsByCatalogueId(this.mProductId).then((function(t){var n;e.mMaterialGroups.splice(0),(n=e.mMaterialGroups).push.apply(n,(0,a.A)(t));var r,i=qa(e.mMaterialGroups);try{for(i.s();!(r=i.n()).done;){var s=r.value;e.mMaterialGroupReferences[s.id]=new Set;var u=(0,o.A)(s.defaults,1)[0],c=null!=u?u:s.materials.data.map((function(e){return e.attributes}))[0];if(c){e.mSelectedMaterialReferences[s.id]=c.id,c.default_selected=!0;var l,h=qa(s.materials.data);try{for(h.s();!(l=h.n()).done;){var f=l.value;e.mMaterialReferences[f.id]=structuredClone(f.attributes),e.mMaterialGroupReferences[s.id].add(f.id)}}catch(e){h.e(e)}finally{h.f()}var m,p=qa(s.defaults);try{for(p.s();!(m=p.n()).done;){var d=m.value;d.id in e.mMaterialReferences||(e.mMaterialReferences[d.id]=structuredClone(d),e.mMaterialGroupReferences[s.id].add(d.id))}}catch(e){p.e(e)}finally{p.f()}}}}catch(e){i.e(e)}finally{i.f()}v.UX.print("Material groups loaded:",e.mMaterialGroups),e.beforeResolve(),e.mLoaderService&&(e.mLoaderService.next(new La(e)),e.mLoaderService.complete())}),(function(t){e.mLoaderService&&e.mLoaderService.error(t),delete e.mLoaderService}))),this.mLoaderService)}},{key:"_getGroups",value:function(){return this.mMaterialGroups}},{key:"_getGroup",value:function(e){return this.mMaterialGroups.find((function(t){return t.id===e}))}},{key:"_getGroupByGroupId",value:function(e){return this.mMaterialGroups.find((function(t){return t.group_id===e}))}},{key:"_getActiveGroupSKU",value:function(e){var t,n;if(!(e in this.mSelectedMaterialReferences))return null;var r=this.mSelectedMaterialReferences[e];return r&&r in this.mMaterialReferences&&null!==(t=null===(n=this.mMaterialReferences[r])||void 0===n?void 0:n.sku)&&void 0!==t?t:null}},{key:"_getActiveRefId",value:function(e){return this.mSelectedMaterialReferences[e]}},{key:"_getActiveRefModel",value:function(e){var t=this.mSelectedMaterialReferences[e];if(t)return this.mMaterialReferences[t]}},{key:"_getActiveMaterial",value:function(e){var t,n=this.mSelectedMaterialReferences[e];if(n)return null===(t=this.mMaterialReferences[n])||void 0===t?void 0:t.material_id}},{key:"_setActiveMaterial",value:(_=(0,n.A)(i().mark((function e(t,n){var r,a,o,s=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=!(s.length>2&&void 0!==s[2])||s[2],a=this.mMaterialGroups.find((function(e){return e.id===t}))){e.next=4;break}return e.abrupt("return");case 4:return e.prev=4,e.next=7,this.resolveMaterialReference(n);case 7:if(o=e.sent){e.next=10;break}throw new Error("Unable to find material reference by id: ".concat(n));case 10:this.applyActiveMaterial(a,o,r),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(4),v.UX.error(e.t0);case 16:case"end":return e.stop()}}),e,this,[[4,13]])}))),function(e,t){return _.apply(this,arguments)})},{key:"upsertClientMaterialReference",value:function(e,t){for(var n=0,r=Object.entries(this.mMaterialReferences);n<r.length;n++){var i=(0,o.A)(r[n],2)[1];if(i.material_id===t&&i.material_group_id===e&&this.isClientId(i.id))return i}var a={id:Ga(),material_id:t,material_group_id:e,default_selected:!1};return this.mMaterialReferences[a.id]=a,this.mMaterialGroupReferences[e].add(a.id),a}},{key:"_setActiveMaterialByMaterialId",value:(A=(0,n.A)(i().mark((function e(t,n){var r,a,o,s=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=!(s.length>2&&void 0!==s[2])||s[2],a=this.mMaterialGroups.find((function(e){return e.id===t}))){e.next=4;break}return e.abrupt("return");case 4:return e.prev=4,e.next=7,this.resolveMaterialReferenceByMaterialId(t,n,!0);case 7:(o=e.sent)||(o=this.upsertClientMaterialReference(t,n)),this.applyActiveMaterial(a,o,r),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(4),v.UX.error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[4,12]])}))),function(e,t){return A.apply(this,arguments)})},{key:"_setActiveMaterialBySku",value:(b=(0,n.A)(i().mark((function e(t,n){var r,a,o,s=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=!(s.length>2&&void 0!==s[2])||s[2],a=this.mMaterialGroups.find((function(e){return e.id===t}))){e.next=4;break}return e.abrupt("return");case 4:return e.prev=4,e.next=7,this.resolveMaterialReferenceBySku(t,n);case 7:if(o=e.sent){e.next=10;break}throw new Error("Unable to find material reference by sku: ".concat(n));case 10:this.applyActiveMaterial(a,o,r),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(4),v.UX.error(e.t0);case 16:case"end":return e.stop()}}),e,this,[[4,13]])}))),function(e,t){return b.apply(this,arguments)})},{key:"_setActiveMaterialByName",value:(g=(0,n.A)(i().mark((function e(t,n){var r,a,o,s=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=!(s.length>2&&void 0!==s[2])||s[2],a=this.mMaterialGroups.find((function(e){return e.id===t}))){e.next=4;break}return e.abrupt("return");case 4:return e.prev=4,e.next=7,this.resolveMaterialReferenceByName(t,n);case 7:if(o=e.sent){e.next=10;break}throw new Error("Unable to find material reference by material name: ".concat(n));case 10:this.applyActiveMaterial(a,o,r),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(4),v.UX.error(e.t0);case 16:case"end":return e.stop()}}),e,this,[[4,13]])}))),function(e,t){return g.apply(this,arguments)})},{key:"_resetActiveMaterial",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.mMaterialGroups.find((function(t){return t.id===e}));if(r){var i=Array.from(this.mMaterialGroupReferences[e].values()).map((function(e){return t.mMaterialReferences[e]})).find((function(e){return e.default_selected}));i&&(this.mSelectedMaterialReferences[e]=i.id,n&&this.onMaterialChanged.next({id:r.id,group:r.group_id,ref_id:i.id,material_id:i.material_id}))}}},{key:"_setActiveMaterialByGroupId",value:(y=(0,n.A)(i().mark((function e(t,n){var r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.mMaterialGroups.find((function(e){return e.group_id===t}))){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this._setActiveMaterial(r.id,n);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"_resetVisibilityOverwrites",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this.mMaterialGroups.find((function(t){return t.id===e}));if(n&&n.id in this.mVisibilityOverwrites)for(var r in this.mVisibilityOverwrites[n.id])t.includes(Number(r))||delete this.mVisibilityOverwrites[n.id][r]}},{key:"_resetFolderVisibilityOverwrites",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this.mMaterialGroups.find((function(t){return t.id===e}));if(n&&n.id in this.mVisibilityFolderOverwrites)for(var r in this.mVisibilityFolderOverwrites[n.id])t.includes(Number(r))||delete this.mVisibilityFolderOverwrites[n.id][r]}},{key:"_setMaterialVisibility",value:function(e,t,n){var r=this,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=this.mMaterialGroups.find((function(t){return t.id===e}));o&&(this.mVisibilityOverwrites[o.id]||(this.mVisibilityOverwrites[o.id]={}),a&&(this.mVisibilityOverwrites[o.id][t]=n?1:0),this.applyMaterialVisibility(o.id,t).then((function(e){var a;i&&r.onMaterialVisibility.next({id:o.id,group:o.group_id,ref_id:null!==(a=null==e?void 0:e.id)&&void 0!==a?a:t,visible:n})})).catch((function(e){return v.UX.error(e)})))}},{key:"_setMaterialVisibilityGlobalOverwrite",value:function(e,t){this.mGlobalVisibilityOverwrite[e]=t?1:0}},{key:"_setMaterialVisibilityByGroupId",value:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=this.mMaterialGroups.find((function(t){return t.group_id===e}));a&&this._setMaterialVisibility(a.id,t,n,r,i)}},{key:"_setMaterialVisibilityByFolderId",value:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=this.mMaterialGroups.find((function(t){return t.id===e}));if(i){this.mVisibilityFolderOverwrites[i.id]||(this.mVisibilityFolderOverwrites[i.id]={}),this.mVisibilityFolderOverwrites[i.id][t]=n?1:0;var a=this.applyMaterialVisibilityByFolderId(i.id,t);if(i.id in this.mVisibilityOverwrites){var o,s=qa(a);try{for(s.s();!(o=s.n()).done;){var u=o.value;u.id in this.mVisibilityOverwrites[i.id]&&delete this.mVisibilityOverwrites[i.id][u.id]}}catch(e){s.e(e)}finally{s.f()}}if(r){var c,l=qa(a);try{for(l.s();!(c=l.n()).done;){var h=c.value;this.onMaterialVisibility.next({id:i.id,group:i.group_id,ref_id:h.id,visible:n})}}catch(e){l.e(e)}finally{l.f()}}}}},{key:"_setColorOverwrite",value:function(e,t,n){return this.mColorOverwrites[e]=t,this.applyColorOverwrites(e,n)}},{key:"_setMapOverwrite",value:(d=(0,n.A)(i().mark((function e(t,n,r,a){var o=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){if(!n)return i("Incorrect type!");o.mMapOverwrites[t]||(o.mMapOverwrites[t]=[]);var s=o.mMapOverwrites[t].findIndex((function(e){return e.type===n}));if((null==r||r<0)&&o.mMapOverwrites[t][s])s>=0&&(o.mMapOverwrites[t][s].textureId=null);else try{s>=0?o.mMapOverwrites[t][s].textureId=r:o.mMapOverwrites[t].push({type:n,textureId:r})}catch(e){}o.applyMapOverwrites(t,a).then((function(){return e()}),(function(e){return i(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e,t,n,r){return d.apply(this,arguments)})},{key:"_buildQueryParams",value:function(){var e,t={},n=qa(this.mMaterialGroups);try{for(n.s();!(e=n.n()).done;){var r=e.value;h.N5.isNumeric(this.mSelectedMaterialReferences[r.id])&&this.mSelectedMaterialReferences[r.id]>=0&&(t["".concat(r.id)]="".concat(this.mSelectedMaterialReferences[r.id]))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"_getGroupReferencesByGroupId",value:function(e){var t=this.mMaterialGroups.find((function(t){return t.group_id===e}));if(t)return t.materials.data.map((function(e){return e.attributes}))}},{key:"_applyOverwritesOnMaterialReference",value:function(e){var t=this;e.id in this.mMaterialReferences||(this.mMaterialReferences[e.id]=structuredClone(e),this.mMaterialGroupReferences[e.material_group_id].add(e.id));var r=en.J.getManager(en.n.MaterialManager);e.material_group_id in this.mColorOverwrites&&r.setColorOverwrite(e.material_id,this.mColorOverwrites[e.material_group_id]),e.material_group_id in this.mMapOverwrites&&new Promise((function(a,o){var s=[],u=t.mMapOverwrites[e.material_group_id];Array.isArray(u)&&(u.forEach((function(t){s.push((0,n.A)(i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",r.setMapOverwrite(e.material_id,t.type,t.textureId));case 1:case"end":return n.stop()}}),n)}))))})),l.N.executeInOrder(s,(function(e,t){e.length>0?a():o(t.length>0?t[0]:"Nothing to apply")})))})).catch((function(e){v.UX.warn(e)})),e.material_group_id in this.mGlobalVisibilityOverwrite&&(e.visible=this.mGlobalVisibilityOverwrite[e.material_group_id]),e.material_group_id in this.mVisibilityOverwrites&&e.id in this.mVisibilityOverwrites[e.material_group_id]?e.visible=this.mVisibilityOverwrites[e.material_group_id][e.id]:e.material_group_id in this.mVisibilityFolderOverwrites&&(-1 in this.mVisibilityFolderOverwrites[e.material_group_id]?e.visible=this.mVisibilityFolderOverwrites[e.material_group_id][-1]:e.material_folder_id in this.mVisibilityFolderOverwrites[e.material_group_id]&&(e.visible=this.mVisibilityFolderOverwrites[e.material_group_id][e.material_folder_id]))}},{key:"_getAvailableReferences",value:function(e){var t=this,n=this.mMaterialGroups.find((function(t){return t.id===e}));return n&&n.id in this.mMaterialGroupReferences?Array.from(this.mMaterialGroupReferences[n.id].values()).map((function(e){return t.mMaterialReferences[e]})).filter((function(e){return e})):[]}},{key:"beforeResolve",value:function(e){var t=this;if(void 0!==e?(this.applyColorOverwrites(e),this.applyMapOverwrites(e).catch((function(e){return v.UX.warn(e)}))):(Object.keys(this.mColorOverwrites).forEach((function(e){var n=Number(e);t.applyColorOverwrites(n)})),Object.keys(this.mMapOverwrites).forEach((function(e){var n=Number(e);t.applyMapOverwrites(n).catch((function(e){return v.UX.warn(e)}))}))),void 0!==e&&e in this.mGlobalVisibilityOverwrite){var n,r=qa(Array.from(this.mMaterialGroupReferences[e].values()).map((function(e){return t.mMaterialReferences[e]})).filter((function(e){return e})));try{for(r.s();!(n=r.n()).done;){n.value.visible=this.mGlobalVisibilityOverwrite[e]}}catch(e){r.e(e)}finally{r.f()}}void 0!==e?e in this.mVisibilityOverwrites&&Object.keys(this.mVisibilityOverwrites[e]).forEach((function(n){t.applyMaterialVisibility(e,Number(n)).catch((function(e){return v.UX.error(e)}))})):Object.keys(this.mVisibilityOverwrites).forEach((function(e){var n=Number(e);Object.keys(t.mVisibilityOverwrites[e]).forEach((function(e){t.applyMaterialVisibility(n,Number(e)).catch((function(e){return v.UX.error(e)}))}))})),void 0!==e?e in this.mVisibilityFolderOverwrites&&Object.keys(this.mVisibilityFolderOverwrites[e]).forEach((function(n){t.applyMaterialVisibilityByFolderId(e,Number(n))})):Object.keys(this.mVisibilityFolderOverwrites).forEach((function(e){var n=Number(e);Object.keys(t.mVisibilityFolderOverwrites[n]).forEach((function(e){t.applyMaterialVisibilityByFolderId(n,Number(e))}))}))}},{key:"isClientId",value:function(e){return h.N5.isNumeric(e)&&Number(e)<0}},{key:"applyActiveMaterial",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];(this.isClientId(t.id)||this.mMaterialGroupReferences[e.id].has(t.id))&&(this.mSelectedMaterialReferences[e.id]=t.id,n&&this.onMaterialChanged.next({id:e.id,group:e.group_id,ref_id:t.id,material_id:t.material_id}))}},{key:"applyColorOverwrites",value:function(e,t){var n=this,r=this.mMaterialGroups.find((function(t){return t.id===e}));if(r&&e in this.mColorOverwrites){var i=en.J.getManager(en.n.MaterialManager);Array.from(this.mMaterialGroupReferences[r.id].values()).map((function(e){return n.mMaterialReferences[e]})).filter((function(e){return e})).forEach((function(r){i.setColorOverwrite(r.material_id,n.mColorOverwrites[e],t)}))}}},{key:"applyMapOverwrites",value:(p=(0,n.A)(i().mark((function e(t,r){var a=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var s=a.mMaterialGroups.find((function(e){return e.id===t}));if(!s)return o("Unable to apply map overwrite: Group not found.");var u=en.J.getManager(en.n.MaterialManager),c=[];Array.from(a.mMaterialGroupReferences[s.id].values()).map((function(e){return a.mMaterialReferences[e]})).filter((function(e){return e})).forEach((function(e){var o=a.mMapOverwrites[t];Array.isArray(o)&&o.forEach((function(t){c.push((0,n.A)(i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",u.setMapOverwrite(e.material_id,t.type,t.textureId,r));case 1:case"end":return n.stop()}}),n)}))))}))})),l.N.executeInOrder(c,(function(t,n){t.length>0?e():o(n.length>0?n[0]:"Nothing to apply")}))})));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return p.apply(this,arguments)})},{key:"applyMaterialVisibility",value:(m=(0,n.A)(i().mark((function e(t,n){var r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.mVisibilityOverwrites[t][n],e.prev=1,e.next=4,this.resolveMaterialReference(n,!0);case 4:if(a=e.sent){e.next=7;break}return e.abrupt("return",void 0);case 7:if(t in this.mVisibilityOverwrites&&a.id in this.mVisibilityOverwrites[t]){e.next=9;break}return e.abrupt("return",a);case 9:a.visible=r,e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),v.UX.error(e.t0);case 15:return e.abrupt("return",a);case 16:case"end":return e.stop()}}),e,this,[[1,12]])}))),function(e,t){return m.apply(this,arguments)})},{key:"applyMaterialVisibilityByFolderId",value:function(e,t){var n=this.mVisibilityFolderOverwrites[e][t],r=[];for(var i in this.mMaterialReferences){var a=this.mMaterialReferences[i];a.material_group_id!==e||-1!==t&&a.material_folder_id!==t||(e in this.mVisibilityOverwrites&&a.id in this.mVisibilityOverwrites[e]?a.visible=this.mVisibilityOverwrites[e][a.id]:a.visible=n,r.push(a))}return r}},{key:"resolveMaterialReference",value:(f=(0,n.A)(i().mark((function e(t){var n,r,a=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]&&a[1],t in this.mMaterialReferences&&(r=this.mMaterialReferences[t]),r||n){e.next=12;break}return e.next=5,za.getInstance().resolveMaterialReference(t);case 5:if(r=e.sent){e.next=8;break}throw new Error("Unable to resolve material reference using id: '".concat(t,"'!"));case 8:r=structuredClone(r),this.mMaterialReferences[r.id]=r,this.mMaterialGroupReferences[r.material_group_id].add(r.id),this.beforeResolve(r.material_group_id);case 12:return e.abrupt("return",r);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"resolveMaterialReferenceByMaterialId",value:(r=(0,n.A)(i().mark((function e(t,n){var r,a,o=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>2&&void 0!==o[2]&&o[2],(a=Object.values(this.mMaterialReferences).find((function(e){return e.material_group_id===t&&e.material_id===n})))||r){e.next=12;break}return e.next=5,za.getInstance().resolveMaterialReferenceByMaterialId(t,n);case 5:if(a=e.sent){e.next=8;break}throw new Error("Unable to resolve material reference using material id: '".concat(n,"'!"));case 8:a=structuredClone(a),this.mMaterialReferences[a.id]=a,this.mMaterialGroupReferences[a.material_group_id].add(a.id),this.beforeResolve(a.material_group_id);case 12:return e.abrupt("return",a);case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"resolveMaterialReferenceBySku",value:(t=(0,n.A)(i().mark((function e(t,n){var r,a,o=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>2&&void 0!==o[2]&&o[2],(a=Object.values(this.mMaterialReferences).find((function(e){return e.material_group_id===t&&e.sku===n})))||r){e.next=12;break}return e.next=5,za.getInstance().resolveMaterialReferenceBySku(t,n);case 5:if(a=e.sent){e.next=8;break}throw new Error("Unable to resolve material reference by sku: '".concat(n,"'!"));case 8:a=structuredClone(a),this.mMaterialReferences[a.id]=a,this.mMaterialGroupReferences[a.material_group_id].add(a.id),this.beforeResolve(a.material_group_id);case 12:return e.abrupt("return",a);case 13:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"resolveMaterialReferenceByName",value:(e=(0,n.A)(i().mark((function e(t,n){var r,a,o=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>2&&void 0!==o[2]&&o[2],(a=Object.values(this.mMaterialReferences).find((function(e){return e.material_group_id===t&&(e.name===n||e.material_name===n)})))||r){e.next=12;break}return e.next=5,za.getInstance().resolveMaterialReferenceByName(t,n);case 5:if(a=e.sent){e.next=8;break}throw new Error("Unable to resolve material reference by name: '".concat(n,"'!"));case 8:a=structuredClone(a),this.mMaterialReferences[a.id]=a,this.mMaterialGroupReferences[a.material_group_id].add(a.id),this.beforeResolve(a.material_group_id);case 12:return e.abrupt("return",a);case 13:case"end":return e.stop()}}),e,this)}))),function(t,n){return e.apply(this,arguments)})}]);var e,t,r,f,m,p,d,y,g,b,A,_}();function Xa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ya(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xa(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($a=function(){return!!e})()}var Za=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["materialGroupManager"],r=(0,oe.A)(r),e=(0,ae.A)(n,$a()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mMaterialGroupManagerService",void 0),(0,c.A)(e,"mSubscriptions",[]),e.mMaterialGroupManagerService=new Ka,e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"isAttachable",value:function(e){return e.isDerivedOfTypeName("ProductNode")}},{key:"OnAttached",value:function(){var e=this.getParentObject(),t=e.productId;void 0!==t&&this.mMaterialGroupManagerService._setProductId(t),this.registerMessageHandler(m.fV.TypeRTTI,this.handleSetValue.bind(this)),this.mSubscriptions.push(this.mMaterialGroupManagerService.onMaterialChanged.subscribe({next:function(t){R.K.eventBus().dispatch(new K.r(Q.E.ProductMaterialChanged,Ya({product_uuid:e.getObjectUUID(),product_scene_id:e.getSceneObjectId()},t)))}}),this.mMaterialGroupManagerService.onMaterialVisibility.subscribe({next:function(t){R.K.eventBus().dispatch(new K.r(Q.E.ProductMaterialVisibility,Ya({product_uuid:e.getObjectUUID(),product_scene_id:e.getSceneObjectId()},t)))}}))}},{key:"OnDetached",value:function(){this.mMaterialGroupManagerService.dispose(),this.unregisterMessageHandler(m.fV.TypeRTTI),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"handleSetValue",value:function(e){if("product_id"===e.key){var t=(0,h.yA)(e.value);this.mMaterialGroupManagerService._setProductId(t)}}},{key:"resolveMaterialGroups",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.mMaterialGroupManagerService.resolveMaterialGroups(e)}},{key:"serialize",value:(r=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,y._)(this.resolveMaterialGroups());case 2:return t=e.sent,e.abrupt("return",t.getGroups().map((function(e){return{group:e,activeRefModel:t.getActiveRefModel(e.id)}})).filter((function(e){return e.activeRefModel})).map((function(e){var t=e.group,n=e.activeRefModel,r=structuredClone(t);return r.selected_reference_id=n.id,r.selected_reference=structuredClone(n),delete r.defaults,delete r.materials,r})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}]);var r}(he.$);(0,c.A)(Za,"TypeRTTI",new le.O("MaterialGroupManagerComponent",he.$.TypeRTTI));var Qa=__webpack_require__(65638);function Ja(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return eo(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eo(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function eo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var to=function(){function e(){(0,s.A)(this,e)}return(0,u.A)(e,null,[{key:"exportEsd",value:(f=(0,n.A)(i().mark((function t(n){var r,a,o,s,u,c,l,f,m,p,d,g,b,A,_,M,k,w,T,x,S,C,E,I,O,D,P=this;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.findProductNode()){t.next=3;break}throw new Error("Could not find product node");case 3:a=R.K.sceneManager(),o=e.exportSceneTransform(a,R.K.settingsManager()),s=e.exportSceneCameras(a),u=s.cameras,c=s.main_camera_id,l=e.exportSceneLights(a),f=R.K.sceneManager().findNodesOfType(kt.i.TypeRTTI),m=R.K.sceneManager().getRootProductNode(),p=[],d=Ja(f),t.prev=13,d.s();case 15:if((g=d.n()).done){t.next=33;break}return b=g.value,t.next=19,(0,y._)(Rt._.getInstance().resolveBootstrapData(b.productId));case 19:return A=t.sent,t.next=22,(0,y._)(b.onConfigurableNodeReady);case 22:return _=t.sent,M=b.getObjectUUID(),k=_.getObjectUUID(),t.next=27,_.resolveSceneOffsetManager();case 27:w=t.sent,T=w.getOffsets(),b.getObjectUUID()===r.getObjectUUID()&&null!=n&&(M=n,k=n),p.push({productUuid:M,productNode:b,configurableUuid:k,configurableNode:_,offsetGroups:T,bootstrap:A});case 31:t.next=15;break;case 33:t.next=38;break;case 35:t.prev=35,t.t0=t.catch(13),d.e(t.t0);case 38:return t.prev=38,d.f(),t.finish(38);case 41:x=[],S=[],C=[],E=[],I=i().mark((function t(){var n,r,a,o,s,u,c,l,f,d,g,b,A,_,M,k,w,T,R,I,B,F,N,L,j,U,V,z,H,G,q,W,K,X,Y,$,Z,Q,J,ee,te,re,ae,oe,se,ue,ce,le,he;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=D[O],r=n.productNode,a=n.bootstrap,o=n.configurableNode,s=p.find((function(e){return e.productNode.getObjectUUID()===r.getObjectUUID()})),u=r.findParentOfType(kt.i.TypeRTTI),c=null,u&&(c=p.find((function(e){return e.productNode.getObjectUUID()===u.getObjectUUID()}))),l=s.productUuid===m.getObjectUUID(),f=l?s.configurableUuid:s.productUuid,d=r.productId,o){t.next=11;break}return v.UX.error("Failed to get configurable node"),t.abrupt("return",1);case 11:return g=It.eE.getItems(a.getMaterials()),b=It.eE.getItems(a.getMedia()),A={},g.forEach((function(e){A[e.id]=JSON.parse(JSON.stringify(e))})),_={},b.forEach((function(e){_[e.id]=e})),M=r.getComponents(Fa.TypeRTTI)[0],k=M._getAttributeControllers(),w=[],T=r.getComponents(Za.TypeRTTI)[0],t.next=23,(0,y._)(T.resolveMaterialGroups());case 23:R=t.sent,I=R.getGroups(),B=Ja(I),t.prev=26,B.s();case 28:if((F=B.n()).done){t.next=38;break}if(N=F.value,L=R.getActiveMaterial(N.id),!Number.isFinite(L)||L in A){t.next=36;break}return t.next=34,Qa.m.getInstance().resolveModel(L);case 34:j=t.sent,A[L]=JSON.parse(JSON.stringify(j));case 36:t.next=28;break;case 38:t.next=43;break;case 40:t.prev=40,t.t0=t.catch(26),B.e(t.t0);case 43:return t.prev=43,B.f(),t.finish(43);case 46:U=Ja(k),t.prev=47,z=i().mark((function e(){var t,n,r,a,o,s,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((t=V.value)instanceof sa)){e.next=10;break}if(n=t.resolveValuable(),null!=(r=null==n?void 0:n.material_id)&&A[r]){e.next=6;break}return e.abrupt("return",0);case 6:t.getResourceController().applyTexturesToModel(A[r]),e.next=30;break;case 10:if(!(t instanceof Ln)){e.next=20;break}if(a=t.resolveValuable(),null!=(o=null==a?void 0:a.material_id)&&A[o]){e.next=15;break}return e.abrupt("return",0);case 15:return s=t.getResourceController(),e.next=18,null==s?void 0:s.applyTexturesToModel(A[o]);case 18:e.next=30;break;case 20:if(!(t instanceof Er)){e.next=30;break}if(u=t.resolveValuable(),c=null==u?void 0:u.print_ready_file_id,null!=(l=t.getMediaId())&&null!=c){e.next=26;break}return e.abrupt("return",0);case 26:if(!w.find((function(e){return e.media_id===l}))){e.next=29;break}return e.abrupt("return",0);case 29:w.push({media_id:l,print_ready_file_id:c,controller:t});case 30:case"end":return e.stop()}}),e)})),U.s();case 50:if((V=U.n()).done){t.next=57;break}return t.delegateYield(z(),"t1",52);case 52:if(0!==t.t1){t.next=55;break}return t.abrupt("continue",55);case 55:t.next=50;break;case 57:t.next=62;break;case 59:t.prev=59,t.t2=t.catch(47),U.e(t.t2);case 62:return t.prev=62,U.f(),t.finish(62);case 65:H=0,G=w;case 66:if(!(H<G.length)){t.next=75;break}return q=G[H],t.next=70,q.controller.resolveSvgTextureController(q.print_ready_file_id);case 70:W=t.sent,_[q.media_id]=W.getSvgCanvasAsBase64()||"";case 72:H++,t.next=66;break;case 75:K=[],X=o.getComponent("buildConfigurable"),Y=X.getBatches(),$=Ja(Y),t.prev=79,Q=i().mark((function t(){var n,r,a,o,u,c,l,h,f,m,p,d;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Z.value,o=e.exportAttachment(a.getOffsetGroups(),s.offsetGroups),-1===E.findIndex((function(e){return e.id===o.id}))&&E.push(o),u=a.getMaterialId(),c=en.J.getManager(en.n.MaterialManager),t.next=7,c.resolveResource(a.getMaterial());case 7:if(l=t.sent,h=c.findResourceWithHandle(a.getMaterial()),S.some((function(e){return void 0!==e.id&&e.id===u}))||!l||!h){t.next=22;break}if(!P.isMaterialPbr(A[u])){t.next=18;break}return t.next=14,e.exportMaterialPbr(l,A[u],h,_);case 14:f=t.sent,S.push(f),t.next=22;break;case 18:return t.next=20,e.exportMaterial(l,A[u],h,_);case 20:m=t.sent,S.push(m);case 22:(p=a.getGeometrySource())&&!C.some((function(e){return e.id===p}))&&(d="drc",p&&(p.endsWith("drc")?d="drc":p.endsWith("ebm")&&(d="ebm")),C.push({id:p,data:"".concat(et.w.cacheUrl).concat(p),compression:d})),K.push({id:"".concat(o.id,"_").concat(p,"_").concat(u),attachment_id:o.id,geometry_id:p,material_id:u,visible:null===(n=!(null!==(r=A[u])&&void 0!==r&&null!==(r=r.name)&&void 0!==r&&r.includes("disable_ar_e")))||void 0===n||n});case 25:case"end":return t.stop()}}),t)})),$.s();case 82:if((Z=$.n()).done){t.next=86;break}return t.delegateYield(Q(),"t3",84);case 84:t.next=82;break;case 86:t.next=91;break;case 88:t.prev=88,t.t4=t.catch(79),$.e(t.t4);case 91:return t.prev=91,$.f(),t.finish(91);case 94:J="root_".concat(f),-1===E.findIndex((function(e){return e.id===J}))&&(te=null!==(ee=r.getParent())&&void 0!==ee&&ee.isTypeOf(Na.t.TypeRTTI)?r.getParent():r,re=te.transform.position,ae=te.transform.rotation,oe=(new ne.P).setFromEuler(ae),se=te.transform.scale,ue=(new ie.k).compose(re,oe,se),E.push({id:J,name:(0,h.uI)(r.name)?r.name:"attachment_".concat(J),visible:!0,matrix:ue.toArray(),position:re.toArray(),quaternion:oe.toArray(),rotation:ae.toArray(),scale:se.toArray()})),c&&(le=void 0===u.findParentOfType(kt.i.TypeRTTI),(he=p.find((function(e){return e.productUuid===c.productUuid})))&&(ce=le?he.configurableUuid:he.productUuid)),x.push({id:f,catalogue_id:d,parent_id:ce,data:K,attachment_id:J});case 98:case"end":return t.stop()}}),t,null,[[26,40,43,46],[47,59,62,65],[79,88,91,94]])})),O=0,D=p;case 47:if(!(O<D.length)){t.next=54;break}return t.delegateYield(I(),"t1",49);case 49:if(!t.t1){t.next=51;break}return t.abrupt("continue",51);case 51:O++,t.next=47;break;case 54:return t.abrupt("return",{version:1,scene:o,products:x,materials:S,geometries:C,attachments:E,main_camera_id:c,cameras:u,lights:l});case 55:case"end":return t.stop()}}),t,null,[[13,35,38,41]])}))),function(e){return f.apply(this,arguments)})},{key:"exportSceneTransform",value:function(e,t){var n=e.getScene();if(!n)return{position:te.P.Zero().toArray(),rotation:(new re.O).toArray(),quaternion:ne.P.identity().toArray(),scale:te.P.One().toArray(),matrix:(new ie.k).identity().toArray()};var r=t.getSettings().getSceneSettings().esd_scene_scale,i=n.transform.scale.clone().multiplyScalar(r),a=(new ie.k).makeScale(r,r,r);n.transform.updateMatrix(!0);var o=n.transform.matrix.clone().multiply(a);return{position:n.transform.position.toArray(),rotation:n.transform.rotation.toArray(),quaternion:n.transform.quaternion.toArray(),scale:i.toArray(),matrix:o.toArray()}}},{key:"exportSceneCameras",value:function(t){var n,r=t.findNodesOfType(We.TypeRTTI),i=t.findNodesOfType(We.TypeRTTI,(function(e){return e.isCameraActive()})),a=(0,o.A)(i,1)[0],s=a?e.exportSceneCamera(a):void 0,u=[],c=Ja(r);try{for(c.s();!(n=c.n()).done;){var l=n.value;u.push(e.exportSceneCamera(l))}}catch(e){c.e(e)}finally{c.f()}return{cameras:u,main_camera_id:s?s.id:-1}}},{key:"exportSceneCamera",value:function(e){var t={id:e.id,type:"Camera",matrix:e.transform.matrix.toArray(),position:e.transform.position.toArray(),rotation:e.transform.rotation.toArray(),quaternion:e.transform.quaternion.toArray(),scale:e.transform.scale.toArray(),aspect:e.getValue("aspect_ratio"),far:e.far,near:e.near,zoom:e.getValue("zoom")};if(e instanceof Bt){var n=t;n.type="PerspectiveCamera",n.fov=e.getValue("fov")}return t}},{key:"exportSceneLights",value:function(e){var t,n=[],r=Ja(e.findNodesOfType(jt.TypeRTTI));try{for(r.s();!(t=r.n()).done;){var i=t.value,a={id:i.getSceneObjectId(),type:i.getType().getTypeName(),position:i.transform.position.toArray(),color:i.color.getHex(),intensity:i.intensity,cast_shadow:i.castShadow};switch(i.getType().getTypeName()){case Jt.TypeRTTI.getTypeName():var o=a;o.type="SpotLight",o.distance=i.distance,o.angle=i.angle,o.penumbra=i.penumbra,o.decay=i.decay,o.target=i.target.toArray();break;case Gt.TypeRTTI.getTypeName():var s=a;s.type="DirectionalLight",s.target=i.target.toArray();break;case Kt.TypeRTTI.getTypeName():var u=a;u.type="HemisphereLight",u.ground_color=i.groundColor.getHex();break;case $t.TypeRTTI.getTypeName():var c=a;c.type="PointLight",c.distance=i.distance,c.decay=i.decay;break;case Vt.TypeRTTI.getTypeName():a.type="AmbientLight"}n.push(a)}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"exportMaterial",value:(l=(0,n.A)(i().mark((function t(n,r,a,o){var s,u,l,h,f,m,p,d,v;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s={id:r.id,physical:!1,name:r.name,type:r.type,alpha_test:r.alpha_test,blending:r.blending,depth_test:r.depth_test,depth_write:r.depth_write,fog:r.fog,lights:r.lights,opacity:r.opacity,premultiplied_alpha:r.premultiplied_alpha,shading:r.shading,side:r.side,transparent:r.transparent,ssrl:r.ssrl,render_order:r.render_order},!this.isBaseMaterial(r)){t.next=17;break}return l=n,(u=s).ao_map_intensity=r.ao_map_intensity,u.diffuse=l.getDiffuseColor().getHex(),u.light_map_intensity=r.light_map_intensity,u.texture_sx=r.texture_sx,u.texture_sy=r.texture_sy,u.refraction_ratio=r.refraction_ratio,u.wireframe=r.wireframe,u.wireframe_line_width=r.wireframe_line_width,t.next=14,e.applyTextures(u,r,["alpha_map","ao_map","env_map","light_map","map"],o);case 14:if(!a){t.next=17;break}return t.next=17,e.applyMapOverwrite(u,a,(0,c.A)((0,c.A)((0,c.A)((0,c.A)((0,c.A)({},nn.$.ALPHA,"alpha_map"),nn.$.AO,"ao_map"),nn.$.ENVIRONMENT,"env_map"),nn.$.LIGHTMAP,"light_map"),nn.$.DIFFUSE,"map"),o);case 17:if(!this.isStandardMaterial(r)){t.next=30;break}return(h=s).emissive=r.emissive,h.emissive_map_intensity=r.emissive_map_intensity,h.bump_scale=r.bump_scale,h.displacement_scale=r.displacement_scale,h.displacement_bias=r.displacement_bias,h.normal_scale=r.normal_scale,t.next=27,e.applyTextures(h,r,["emissive_map","bump_map","displacement_map","normal_map"],o);case 27:if(!a){t.next=30;break}return t.next=30,e.applyMapOverwrite(h,a,(0,c.A)((0,c.A)((0,c.A)((0,c.A)({},nn.$.EMISSIVE,"emissive_map"),nn.$.BUMP,"bump_map"),nn.$.DISPLACEMENT,"displacement_map"),nn.$.NORMAL,"normal_map"),o);case 30:if(this.hasMaterialReflectivity(r)&&(s.reflectivity=r.reflectivity),!this.isMaterialStandardPhysical(r)){t.next=42;break}return(f=s).physical=!0,f.metalness=r.metalness,f.roughness=r.roughness,f.env_map_intensity=r.env_map_intensity,t.next=39,e.applyTextures(f,r,["metalness_map","roughness_map"],o);case 39:if(!a){t.next=42;break}return t.next=42,e.applyMapOverwrite(f,a,(0,c.A)((0,c.A)({},nn.$.METALNESS,"metalness_map"),nn.$.ROUGHNESS,"roughness_map"),o);case 42:if(!this.isMaterialBasicPhong(r)){t.next=48;break}return(m=s).physical=!1,m.combine=r.combine,t.next=48,e.applyTextures(m,r,["specular_map"],o);case 48:return this.isMaterialPhysical(r)&&((p=s).clear_coat=r.clear_coat,p.clear_coat_roughness=r.clear_coat_roughness),this.isMaterialPhong(r)&&((d=s).shininess=r.shininess,d.specular=r.specular),this.isMaterialExtended(r)&&((v=s).enable_fresnel_diff=r.enable_fresnel_diff,v.fresnel_diff_bias=r.fresnel_diff_bias,v.fresnel_diff_scale=r.fresnel_diff_scale,v.fresnel_diff_power=r.fresnel_diff_power,v.fresnel_diff_color_left=r.fresnel_diff_color_left,v.enable_fresnel_env=r.enable_fresnel_env,v.fresnel_env_bias=r.fresnel_env_bias,v.fresnel_env_scale=r.fresnel_env_scale,v.fresnel_env_power=r.fresnel_env_power),this.isMaterialPhongExt(r)&&(s.env_map_scale=r.env_map_scale),t.abrupt("return",s);case 53:case"end":return t.stop()}}),t,this)}))),function(e,t,n,r){return l.apply(this,arguments)})},{key:"exportMaterialPbr",value:(a=(0,n.A)(i().mark((function t(n,r,a,o){var s,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=JSON.parse(JSON.stringify(r)),u=n,s.brdf_configuration=s.brdf_configuration||on.getDefaultPBRMaterialBRDFConfiguration(),s.detail_map_configuration=s.detail_map_configuration||on.getDefaultPBRMaterialDetailMapConfiguration(),s.clear_coat_configuration=s.clear_coat_configuration||on.getDefaultPBRMaterialClearCoatConfiguration(),s.sheen_configuration=s.sheen_configuration||on.getDefaultPBRMaterialSheenConfiguration(),s.anisotropic_configuration=s.anisotropic_configuration||on.getDefaultPBRMaterialAnisotropicConfiguration(),s.sub_surface_configuration=s.sub_surface_configuration||on.getDefaultPBRMaterialSubSurfaceConfiguration(),s.iridescence_configuration=s.iridescence_configuration||on.getDefaultPBRMaterialIridescenceConfiguration(),s.flags=s.flags||on.getDefaultPBRMaterialFlagsConfiguration(),s.diffuse_color=u.getDiffuseColor().getHex(),s.ambient_color=u.getAmbientColor().getHex(),s.emissive_color=u.getEmissiveColor().getHex(),s.reflection_color=u.getReflectionColor().getHex(),s.specular_color=u.getSpecularColor().getHex(),s.metallic_reflectance_color=u.getMetallicReflectanceColor().getHex(),s.clear_coat_configuration.tint_color=u.getClearCoatConfiguration().tintColor.getHex(),s.sheen_configuration.color=u.getSheenConfiguration().color.getHex(),s.sub_surface_configuration.tint_color=u.getSubSurfaceConfiguration().tintColor.getHex(),s.sub_surface_configuration.tint_color=u.getSubSurfaceConfiguration().diffusionDistance.getHex(),t.next=22,e.applyTextures(s,r,["diffuse_map","alpha_map","normal_map","ao_map","emissive_map","environment_brdf_map","light_map","reflection_map","specular_map","reflectance_map","micro_surface_map","metalness_map","metallic_reflectance_map","detail_map_configuration.map","clear_coat_configuration.map","clear_coat_configuration.roughness_map","clear_coat_configuration.bump_map","clear_coat_configuration.tint_map","sheen_configuration.roughness_map","anisotropic_configuration.map","sub_surface_configuration.thickness_map","sub_surface_configuration.refraction_map","sub_surface_configuration.refraction_intensity_map","sub_surface_configuration.translucency_intensity_map","iridescence_configuration.map","iridescence_configuration.thickness_map"],o);case 22:if(!a){t.next=25;break}return t.next=25,e.applyMapOverwrite(s,a,(0,c.A)((0,c.A)((0,c.A)((0,c.A)((0,c.A)((0,c.A)({},nn.$.DIFFUSE,"diffuse_map"),nn.$.ALPHA,"alpha_map"),nn.$.NORMAL,"normal_map"),nn.$.AO,"ao_map"),nn.$.EMISSIVE,"emissive_map"),nn.$.LIGHTMAP,"light_map"),o);case 25:return t.abrupt("return",s);case 26:case"end":return t.stop()}}),t)}))),function(e,t,n,r){return a.apply(this,arguments)})},{key:"exportAttachment",value:function(e,t){var n=new ie.k;e.forEach((function(e){var r=t.findIndex((function(t){return t.id===e}));if(-1!==r){var i=t[r],a=new te.P;Object.keys(i.levels||[]).forEach((function(e){var t=Number(e);i.levels&&i.levels[t]&&a.add(i.levels[t])}));var o=te.P.Zero(),s=ne.P.identity(),u=te.P.One();i.matrix&&(new ie.k).set(i.matrix[0],i.matrix[1],i.matrix[2],i.matrix[3],i.matrix[4],i.matrix[5],i.matrix[6],i.matrix[7],i.matrix[8],i.matrix[9],i.matrix[10],i.matrix[11],i.matrix[12],i.matrix[13],i.matrix[14],i.matrix[15]).decompose(o,s,u);var c=new ie.k,l=(new ie.k).makeTranslation(o.x,o.y,o.z);c.multiply(l);var h=(new ie.k).makeRotationFromQuaternion(s.multiply(i.rotation));c.multiply(h);var f=(new ie.k).makeScale(u.x,u.y,u.z);c.multiply(f);var m=(new ie.k).makeTranslation(a.x,a.y,a.z);c.premultiply(m),n.multiply(c)}}));var r=e.join("/"),i=r.length>0?r:"default_attachment",a=te.P.Zero(),o=ne.P.identity(),s=te.P.One();n.decompose(a,o,s);var u=(new re.O).setFromQuaternion(o);return{id:i,name:i,visible:!0,matrix:n.toArray(),position:a.toArray(),quaternion:o.toArray(),rotation:u.toArray(),scale:s.toArray()}}},{key:"findProductNode",value:function(e){var t,n=h.N5.resolveInt(e),r=h.N5.resolveUuid(e);return void 0===r&&void 0===n?R.K.sceneManager().getRootProductNode():(R.K.sceneManager().findNodesOfType(kt.i.TypeRTTI).every((function(e){return r&&e.getObjectUUID()===r?(t=e,!1):!(!r&&e.getSceneObjectId()===n)||(t=e,!1)})),t)}},{key:"applyTextures",value:(r=(0,n.A)(i().mark((function e(t,n,r,a){var o,s,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=Ja(r),e.prev=1,o.s();case 3:if((s=o.n()).done){e.next=22;break}if(u=s.value,null!=(c=(0,h.GI)(n,u))){e.next=8;break}return e.abrupt("continue",20);case 8:if("string"!=typeof c){e.next=12;break}(0,h.Gi)(t,u,c),e.next=20;break;case 12:if((l=a[c])||"number"!=typeof c){e.next=17;break}return e.next=16,tn.u.getInstance().resolveModel(c);case 16:l=e.sent;case 17:if(l){e.next=19;break}return e.abrupt("continue",20);case 19:"string"==typeof l?(0,h.Gi)(t,u,l):(0,h.Gi)(t,u,l.lod0_url);case 20:e.next=3;break;case 22:e.next=27;break;case 24:e.prev=24,e.t0=e.catch(1),o.e(e.t0);case 27:return e.prev=27,o.f(),e.finish(27);case 30:case"end":return e.stop()}}),e,null,[[1,24,27,30]])}))),function(e,t,n,i){return r.apply(this,arguments)})},{key:"applyMapOverwrite",value:(t=(0,n.A)(i().mark((function e(t,n,r,a){var o,s,u,c,l,h;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=en.J.getManager(en.n.TextureManager),s=Ja(n.getMapOverwrites()),e.prev=2,s.s();case 4:if((u=s.n()).done){e.next=24;break}if(c=u.value,r[c.type]&&c.handle){e.next=8;break}return e.abrupt("continue",22);case 8:if(void 0!==(l=o.findResourceWithHandle(c.handle)).getId()){e.next=11;break}return e.abrupt("continue",22);case 11:if(h=void 0,!(l.getId()in a)){e.next=16;break}h=a[l.getId()],e.next=19;break;case 16:return e.next=18,tn.u.getInstance().resolveModel(l.getId());case 18:h=e.sent;case 19:if(h){e.next=21;break}return e.abrupt("continue",22);case 21:t[r[c.type]]="string"==typeof h?h:h.lod0_url;case 22:e.next=4;break;case 24:e.next=29;break;case 26:e.prev=26,e.t0=e.catch(2),s.e(e.t0);case 29:return e.prev=29,s.f(),e.finish(29);case 32:case"end":return e.stop()}}),e,null,[[2,26,29,32]])}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"isBaseMaterial",value:function(e){return/(Standard|Physical|Basic|Phong)/i.test(e.type)}},{key:"isStandardMaterial",value:function(e){return/(Standard|Physical|Phong)/i.test(e.type)}},{key:"hasMaterialReflectivity",value:function(e){return/(Basic|Physical|Phong)/i.test(e.type)}},{key:"isMaterialBasicPhong",value:function(e){return/(Basic|Phong)/i.test(e.type)}},{key:"isMaterialStandardPhysical",value:function(e){return/(Standard|Physical)/i.test(e.type)}},{key:"isMaterialPhysical",value:function(e){return/(Physical)/i.test(e.type)}},{key:"isMaterialPhong",value:function(e){return/(Phong)/i.test(e.type)}},{key:"isMaterialExtended",value:function(e){return/(PhongExt|PhysicalExt)/i.test(e.type)}},{key:"isMaterialPhongExt",value:function(e){return/(PhongExt)/i.test(e.type)}},{key:"isMaterialPbr",value:function(e){return"PbrMaterial"===e.type}}]);var t,r,a,l,f}(),no=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),null,[{key:"resolveWebArFiles",value:function(e,t){var n=e.find((function(e){var n=e.substr(e.lastIndexOf(".")+1);return"usdz"===t?"usdz"===n:"gltf"!==t||("gltf"===n||"glb"===n)}));if((0,P.isNullOrUndefined)(n))throw"File not found.";return n}},{key:"requestNewArFile",value:(e=(0,n.A)(i().mark((function e(t,n,r,a){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){J.k.getInstance().post("".concat(et.w.apiUrl,"ar/request"),{esd:r,hash:n,catalogue_id:t,format:a}).then((function(t){if("complete"===t.data.status)e(t.data.files);else if("in_progress"===t.data.status)var r=setInterval((function(){J.k.getInstance().get("".concat(et.w.apiUrl,"ar/check/").concat(n)).then((function(t){return"complete"===t.data.status?(clearInterval(r),e(t.data.files)):"not_processing"===t.data.status||"failed"===t.data.status?(clearInterval(r),i()):void 0}),(function(e){return clearInterval(r),i(e)}))}),1e3);else i()}),(function(e){i(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(t,n,r,i){return e.apply(this,arguments)})}]);var e}();function ro(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ro=function(){return!!e})()}var io=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["toolbar-webar-component"],r=(0,oe.A)(r),e=(0,ae.A)(n,ro()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mController",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"OnAttached",value:function(){var e,n,r,i,a,o=this;(e=t,n="OnAttached",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.mController=this.getParentObject(),this.registerMessageHandler(m.q0.TypeRTTI,(function(){var e=o.getParentObject();e.getValue("busy")||(e.setValue("busy",!0),o.action().then((function(t){e.setValue("busy",!1),Array.isArray(t)&&e.setValue("arqr",t)}),(function(t){v.UX.error(t),e.setValue("busy",!1),o.mController.onError.next("Could not load AR file.")})))}))}},{key:"OnDetached",value:function(){this.unregisterMessageHandler(m.q0.TypeRTTI)}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(xt.TypeRTTI)}},{key:"action",value:(a=(0,n.A)(i().mark((function e(){var t,r,a,o,s,u,c,l,h,m,p,d=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(0,H.Pf)(),r=(0,wt.GZ)()&&t===Et.U.iOS?window.open("","_blank"):null,v.UX.print("Try to retrieve AR file..."),a=R.K.sceneManager().findNodesOfType(kt.i.TypeRTTI),o=a.find((function(e){return null===e.getValue("parent_id")}))){e.next=7;break}return e.abrupt("return");case 7:return s=o.productId,v.UX.print("AR file for product:",s),u=a.map(function(){var e=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",d.getHashFromProduct(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.t0=f.V,e.next=13,Promise.all(u);case 13:return e.t1=e.sent.join(""),c=e.t0.Md5.call(e.t0,e.t1),l=(0,H.xl)()||(0,H.un)()?"usdz":"gltf",e.next=18,to.exportEsd();case 18:return h=e.sent,e.next=21,no.requestNewArFile(s,c,h,l);case 21:if(m=e.sent,!(0,H.xl)()){e.next=24;break}return e.abrupt("return",m);case 24:p=no.resolveWebArFiles(m,l),this.openLink(p,t,r);case 26:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"getHashFromProduct",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,s,u,c,l,h,m,p,d,v,g,b,A,_,M,k,w;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.getComponent("attributeManager"),r=t.getComponent("catalogueSettings"),a=t.getComponent("materialGroupManager"),e.next=5,Promise.all([(0,y._)(n.resolveAttributeManager()),(0,y._)(r.resolveSettings()),(0,y._)(a.resolveMaterialGroups())]);case 5:return s=e.sent,u=(0,o.A)(s,3),c=u[0],l=u[1],h=u[2],m=t.productId,p=c.serialize({discard_hidden:!1,include_keys:!1,calculate_approximations:!1}),d=f.V.Md5(JSON.stringify(p)),v=h.buildQueryParams(!1),g=(0,H.Fr)()?N.RB.Mobile:N.RB.Desktop,b=l.getSceneDeviceSettings(g),A=parseInt(b.compression,10),_=Object.keys(v).map((function(e){return"".concat(e,":").concat(v[e])})).join("/"),M=l.getGraphRevId(),k=l.getSceneRevId(),w="".concat(m,"/").concat(M,"/").concat(k,"/").concat(A,"/").concat(d,"/").concat(_,"/"),e.abrupt("return",f.V.Md5(w));case 22:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"openLink",value:function(e,t,n){var r="";if(t===Et.U.Android){v.UX.print("Opening AR file for Android.");r="".concat("intent://arvr.google.com/scene-viewer/1.1","?file=").concat(encodeURIComponent(e),"&mode=").concat("ar_preferred","&enable_vertical_placement=").concat("true","&resizable=").concat("true","#Intent;scheme=").concat("https",";package=").concat("com.google.android.googlequicksearchbox;action=android.intent.action.VIEW",";S.browser_fallback_url=").concat("https://developers.google.com/ar",";end;")}else{if(t!==Et.U.iOS)return v.UX.print("Can not open AR file as device is unknown."),void(n&&n.close());v.UX.print("Opening AR file for iOS."),r=e}if(v.UX.print("Url to webar file: ".concat(r)),n)n.location.href=r;else{var i=document.createElement("a"),a=document.createElement("img");i.appendChild(a),i.href=r,i.style.display="none",t===Et.U.iOS&&(i.rel="ar"),document.body.appendChild(i),i.click(),i.remove()}}},{key:"getType",value:function(){return t.TypeRTTI}}]);var r,a}(Ze);function ao(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ao=function(){return!!e})()}(0,c.A)(io,"TypeRTTI",new le.O("WebArComponent",Ze.TypeRTTI));var oo=function(e){function t(){var e,n,r,i,a;(0,s.A)(this,t),r=this,i=t,a=[{name:"trial",enabled:!0,position:Qe.BOTTOM_LEFT,icon:'\n                <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Laag_1" x="0px" y="0px" viewBox="0 0 722.8 354.3" style="enable-background:new 0 0 722.8 354.3;" xml:space="preserve">\n                    <style type="text/css">\n                        .st0{fill:#FF4B00;}\n                    </style>\n                    <g>\n                        <path class="st0" d="M161,74.7L72.2,126v102.5l88.8,51.3l88.8-51.3V126L161,74.7z M161,248.6l-24.4-14.1l24.4-14.1l24.4,14.1   L161,248.6z M222.7,186.5l-22.8,13.2v26.5l-8.4,4.8L164,215.1v-9.2l14.2-8.2v-7h-34.5v7l14.3,8.2v9.2L130.5,231l-8.4-4.8v-26.5   l-22.8-13.2v-44.9l38.9-22.4l22.9,13.2l22.8-13.2l38.9,22.4V186.5z"></path>\n                        <polygon class="st0" points="178.2,173.2 189.8,173.2 206,163.9 206,161.7 178.2,161.7  "></polygon>\n                        <polygon class="st0" points="116,163.9 132.1,173.2 143.7,173.2 143.7,161.7 116,161.7  "></polygon>\n                        <polygon points="359.7,168.4 359.7,183 309.7,183 309.7,214.1 368.1,214.1 368.1,228.5 292.6,228.5 292.6,126.1 366.7,126.1    366.7,140.6 309.7,140.6 309.7,168.4  "></polygon>\n                        <polygon points="392.7,155.3 409.4,181.1 409.6,181.1 426.3,155.3 443.3,155.3 418.7,191.1 446,228.5 428.5,228.5 409.6,201    409.4,201 390.7,228.5 373.1,228.5 400.5,191.1 375.7,155.3  "></polygon>\n                        <path d="M523.5,192c0,24.1-13.9,38.7-32.5,38.7c-11.5,0-18.6-5.4-22.5-10.9h-0.3v33.7H453v-98.1h15.2v8.6h0.3   c3.9-5.2,11-10.6,22.5-10.6C509.6,153.3,523.5,167.9,523.5,192 M508.3,192c0-14.3-7-26.4-20.2-26.4c-12.2,0-19.8,10-19.8,26.4   s7.6,26.4,19.8,26.4C501.3,218.4,508.3,206.4,508.3,192"></path>\n                        <path d="M533.3,135c0-5.2,4.3-7.9,8.5-7.9c4.5,0,8.6,2.7,8.6,7.9s-4.2,8-8.6,8C537.6,143,533.3,140.1,533.3,135 M549.3,228.6h-15   v-73.2h15V228.6z"></path>\n                        <polygon points="573.5,155.3 591.9,212.6 592.1,212.6 610.5,155.3 626.5,155.3 600.5,228.5 583.5,228.5 557.5,155.3  "></polygon>\n                        <path d="M633.6,135c0-5.2,4.3-7.9,8.5-7.9c4.4,0,8.6,2.7,8.6,7.9s-4.2,8-8.6,8C637.9,143,633.6,140.1,633.6,135 M649.6,228.6h-15   v-73.2h15V228.6z"></path>\n                    </g>\n                </svg>\n            ',protect_mutation:!0}],i=(0,oe.A)(i);var o=null===(e=(n=(0,ae.A)(r,ao()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a))).mSettings.getProductPresentationSettings())||void 0===e?void 0:e.show_branding,u=n.mSettings.isModuleEnabled("trial"),c=o||u;return n.setValue("enabled",c),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(it);(0,c.A)(oo,"TypeRTTI",new le.O("TrialToolbarItemController",it.TypeRTTI));var so=__webpack_require__(95580);function uo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(uo=function(){return!!e})()}var co=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["toolbar-trial-component"],r=(0,oe.A)(r),e=(0,ae.A)(n,uo()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mController",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"OnAttached",value:function(){var e,r,a,o,s,u=this;(e=t,r="OnAttached",a=this,o=3,s=(0,se.A)((0,oe.A)(1&o?e.prototype:e),r,a),2&o&&"function"==typeof s?function(e){return s.apply(a,e)}:s)([]),this.mController=this.getParentObject(),this.registerMessageHandler(so.q.TypeRTTI,(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u.action();case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),v.UX.error(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])}))))}},{key:"OnDetached",value:function(){}},{key:"action",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){return window.open("https://www.expivi.com/"),e()})));case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(oo.TypeRTTI)}},{key:"getType",value:function(){return t.TypeRTTI}}]);var r}(Ze);(0,c.A)(co,"TypeRTTI",new le.O("TrialToolbarComponent",Ze.TypeRTTI));var lo=function(){function e(){(0,s.A)(this,e)}return(0,u.A)(e,[{key:"createObject",value:function(t){for(var n=this,r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];var o=null;if(t in e.mFactories){var s=e.mFactories[t],u=(0,P.isUndefined)(s.view)?s:s.view,c=s.components||[],l=s.children||[];o=(0,P.isUndefined)(i)?new u:Ye(u,i),c.forEach((function(e){o.addComponent(new e)})),l.forEach((function(e){var t=n.createObject.apply(n,[e].concat(i));t.parent=o,o.children.push(t)}))}return o}}])}();(0,c.A)(lo,"mFactories",{web_ar:{view:xt,components:[io]},fullscreen:{view:ot,components:[lt]},social:{view:ft,components:[pt],children:["social_facebook","social_whatsapp"]},social_facebook:{view:vt,components:[gt]},social_whatsapp:{view:At,components:[Mt]},trial:{view:oo,components:[co]}});var ho=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mViewRenderCanvas",void 0),(0,c.A)(this,"mFactory",void 0),(0,c.A)(this,"mItems",[]),this.mViewRenderCanvas=t,this.mFactory=new lo}),[{key:"init",value:function(){this.mItems.push(this.mFactory.createObject("trial"),this.mFactory.createObject("social"),this.mFactory.createObject("web_ar"),this.mFactory.createObject("fullscreen",this.mViewRenderCanvas))}},{key:"dispose",value:function(){this.mItems.splice(0)}},{key:"getItems",value:function(){return this.mItems}}])}();function fo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fo=function(){return!!e})()}var mo=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,fo()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mViewContainer",void 0),(0,c.A)(n,"mViewerComponent",void 0),(0,c.A)(n,"mControllers",new Array),(0,c.A)(n,"mInitialized",!1),n.mViewerComponent=e,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"setViewContainer",value:function(e){this.mViewContainer=e}},{key:"getViewComponent",value:function(){return this.mViewerComponent}},{key:"getViewContainer",value:function(){return this.mViewContainer}},{key:"initialize",value:function(){var e=this;this.mControllers.forEach((function(t){e.addComponent(t)})),this.mInitialized=!0}},{key:"dispose",value:function(){this.removeAllComponents(),this.mInitialized=!1}},{key:"resize",value:function(e,t){this.dispatchMessage(new m.jb(e,t))}},{key:"mouseDown",value:function(e){this.dispatchMessage(new m.lF("down",e))}},{key:"mouseUp",value:function(e){this.dispatchMessage(new m.lF("up",e))}},{key:"mouseMove",value:function(e){this.dispatchMessage(new m.lF("move",e))}},{key:"mouseLeave",value:function(e){this.dispatchMessage(new m.lF("out",e))}},{key:"mouseDbClick",value:function(e){this.dispatchMessage(new m.lF("dbclick",e))}},{key:"dragStart",value:function(e){this.dispatchMessage(new m.A0("start",e.position,e.dragData))}},{key:"dragMove",value:function(e){this.dispatchMessage(new m.A0("move",e.position,e.dragData))}},{key:"dragEnd",value:function(e){this.dispatchMessage(new m.A0("leave",e.position,e.dragData))}},{key:"dropItem",value:function(e){this.dispatchMessage(new m.A0("drop",e.position,e.dragData))}},{key:"update",value:function(e){this.dispatchMessage(new m.W2(e))}},{key:"addController",value:function(e){this.mControllers.push(e),this.mInitialized&&this.addComponent(e)}}])}(nt.b);(0,c.A)(mo,"TypeRTTI",new le.O("ViewportRenderer",nt.b.TypeRTTI));var po=function(){return(0,u.A)((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,s.A)(this,e),(0,c.A)(this,"mParentContainer",void 0),(0,c.A)(this,"mViewLayerOptions",void 0),(0,c.A)(this,"mLayerContainer",void 0),(0,c.A)(this,"mLayerIndex",void 0),(0,c.A)(this,"mInitialized",!1),(0,c.A)(this,"mIsAttached",!1),this.mLayerIndex=t,this.mViewLayerOptions=n}),[{key:"init",value:function(){this.mLayerContainer=this.createContainer(),this.mLayerContainer&&(this.mLayerContainer.style.zIndex="".concat(this.getLayerIndex())),this.mInitialized=!0}},{key:"destroyContainer",value:function(){this.detach()}},{key:"attach",value:function(){this.mIsAttached||(this.mLayerContainer&&this.mParentContainer.appendChild(this.mLayerContainer),this.mIsAttached=!0)}},{key:"detach",value:function(){this.mIsAttached&&(this.mParentContainer.removeChild(this.mLayerContainer),this.mIsAttached=!1)}},{key:"destroy",value:function(){this.destroyContainer(),this.mLayerContainer&&delete this.mLayerContainer}},{key:"setParentContainer",value:function(e){this.mParentContainer=e}},{key:"getLayerContainer",value:function(){return this.mLayerContainer}},{key:"getLayerIndex",value:function(){return this.mLayerIndex}},{key:"isLayerAttached",value:function(){return this.mIsAttached}},{key:"isLayerInitialized",value:function(){return this.mInitialized}}])}();function vo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vo=function(){return!!e})()}function yo(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var go=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,vo()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mLoadingIcon",void 0),(0,c.A)(r,"mArQrContainer",void 0),(0,c.A)(r,"mToolbar",void 0),(0,c.A)(r,"mGlobalStyleElement",void 0),(0,c.A)(r,"mItems",{}),(0,c.A)(r,"mSubscriptions",[]),(0,c.A)(r,"mEnabled",!0),r.mToolbar=n.toolbar,Object.keys(Qe).forEach((function(e){r.mItems[e]=[]})),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"createContainer",value:function(){this.initializeGlobalStyle();var e=document.createElement("div");return e.classList.add("xpv__viewer_toolbar_container"),this.mLoadingIcon=this.getLoadingIcon(),this.mArQrContainer=this.getArQrContainer(),this.mParentContainer.appendChild(this.mLoadingIcon),this.mParentContainer.appendChild(this.mArQrContainer),e}},{key:"destroyContainer",value:function(){this.mLoadingIcon&&(this.mLoadingIcon.remove(),delete this.mLoadingIcon),this.mArQrContainer&&(this.mArQrContainer.remove(),delete this.mArQrContainer),this.mGlobalStyleElement.remove(),delete this.mGlobalStyleElement,yo(t,"destroyContainer",this,3)([])}},{key:"init",value:function(){var e=this;yo(t,"init",this,3)([]),this.mToolbar.getItems().filter((function(e){return!0===e.getValue("enabled")})).forEach((function(t){var n=t.getChildren();n.length>0?e.mLayerContainer.appendChild(e.createGroup(t,n)):e.mLayerContainer.appendChild(e.createToolbarElement(t))}))}},{key:"createToolbarElement",value:function(e,t){var n=this.createItemButton(e,t);return e.getValue("protect_mutation")&&this.setProtectMutation(e),n}},{key:"getLoadingIcon",value:function(){var e=document.createElement("div");return e.innerHTML='\n            <div id="xpv-toolbar-loader" hidden>\n                <div id="xpv-toolbar-loader-icon"></div>\n                <div id="xpv-toolbar-loader-message">Loading...</div>\n            </div>\n        ',e.firstElementChild}},{key:"getArQrContainer",value:function(){var e=document.createElement("div");e.innerHTML='\n            <div id="xpv-toolbar-ar-qr" hidden>\n                <div id="xpv-toolbar-ar-qr-code"></div>\n                <div id="xpv-toolbar-ar-qr-message">\n                    Scan this code with a compatible\n                    <br>\n                    Android/iOS device\n                </div>\n            </div>\n        ';var t=e.firstElementChild;return t.addEventListener("click",(function(){t.hidden=!0})),t}},{key:"listenToStateChange",value:function(e){var t=this,n=e.onStateChange.subscribe({next:function(e){t.itemStateChange(e)},error:function(e){v.UX.error("Toolbar state failed: ",e)}});this.mSubscriptions.push(n)}},{key:"getButtonIcon",value:function(e){var t=e.getValue("icon");if(t){var n=document.createElement("div");n.innerHTML=t;var r=n.firstElementChild;return r.classList.add("xpv-toolbar-item-icon"),r}var i=e.getValue("image_source"),a=document.createElement("img");return a.src=i,a.alt="",a}},{key:"getButtonIconInverted",value:function(e){var t=e.getValue("icon_inverted");if(!t)return null;var n=document.createElement("div");n.innerHTML=t;var r=n.firstElementChild;return r.classList.add("xpv-toolbar-item-icon-inverted"),r}},{key:"createItemButton",value:function(e,t){var n=this;e.onError.subscribe({next:function(e){null!==e&&e.length>0&&alert(e)},error:function(){}});var r=document.createElement("button"),i=e.getValue("name");if(i&&(r.id="xpv-toolbar-item-".concat(i)),r.type="button",!t){var a=e.getValue("position"),o=this.getClassNameFromPosition(a);r.classList.add(o)}var s=this.getButtonIcon(e);r.appendChild(s);var u=this.getButtonIconInverted(e);return u&&r.appendChild(u),r.addEventListener("click",(function(t){n.mEnabled&&e.getValue("enabled")&&e.dispatchMessageToComponents(new m.q0(t))})),this.listenToStateChange(e),r}},{key:"getClassNameFromPosition",value:function(e){switch(e){case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right";case"BOTTOM_LEFT":return"bottom-left";default:return"bottom-right"}}},{key:"createGroup",value:function(e,t){var n=this,r=document.createElement("div");r.classList.add("xpv__viewer_toolbar_group_container");var i=document.createElement("div");i.classList.add("xpv__viewer_toolbar_group");var a=document.createElement("div"),o=this.createToolbarElement(e),s=e.getValue("position"),u=this.getClassNameFromPosition(s);r.classList.add(u);var c=!1,l=!1;return t.filter((function(e){return!0===e.getValue("enabled")})).forEach((function(t){var r=n.createToolbarElement(t,e);if("social"===t.getSetting("name")){var i=t.getSetting("scope");r.classList.add(i)}!0===t.getSetting("mobile")&&(r.classList.add("mobile-enabled"),c=!0),!0===t.getSetting("desktop")&&(r.classList.add("desktop-enabled"),l=!0),a.appendChild(r)})),c||(o.classList.add("mobile-disabled"),i.classList.add("mobile-disabled")),l||(o.classList.add("desktop-disabled"),i.classList.add("desktop-disabled")),"social"===e.getSetting("name")&&o.classList.add("expand_social_channels"),i.appendChild(a),r.appendChild(o),r.appendChild(i),o.addEventListener("click",(function(){r.classList.toggle("open")})),r}},{key:"destroy",value:function(){for(var e in this.mItems)this.mItems[e].splice(0).forEach((function(e){e.item&&e.item.remove(),e.group&&e.group.remove()}));this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),yo(t,"destroy",this,3)([])}},{key:"enable",value:function(){this.mEnabled=!0,this.mLayerContainer.hidden=!1}},{key:"disable",value:function(){this.mEnabled=!1,this.mLayerContainer.hidden=!0}},{key:"itemStateChange",value:function(e){switch(e.name){case"busy":if(!0===e.value){var t=this.mLoadingIcon.querySelector("#xpv-toolbar-loader-icon"),n=this.mLoadingIcon.querySelector("#xpv-toolbar-loader-message"),r=e.message,i=void 0===r?"":r,a=e.icon,o=void 0===a?"":a;t&&(t.innerHTML="string"==typeof o?o:o.innerHTML),n&&(n.textContent=i),this.mLoadingIcon.hidden=!1}else this.mLoadingIcon.hidden=!0;break;case"sharing":e.value&&R.K.eventBus().dispatch(new K.r(Q.E.Shared,e.value));break;case"arqr":if(!0===e.value){var s=this.mArQrContainer.querySelector("#xpv-toolbar-ar-qr-code");s&&e.icon&&e.icon instanceof HTMLElement&&(s.innerHTML="",s.append(e.icon)),this.mArQrContainer.hidden=!1,R.K.eventBus().dispatch(new K.r(Q.E.QrWebAr,{enabled:e.value,icon:e.icon}))}else this.mArQrContainer.hidden=!0;break;case"inverted":var u=this.mLayerContainer.querySelector("#xpv-toolbar-item-".concat(e.item.getValue("name")));if(!u)return;u.classList.toggle("xpv-toolbar-item-inverted",e.value)}}},{key:"setProtectMutation",value:function(e){var t=this,n=e.getValue("name"),r=function(){var r=t.mLayerContainer.querySelector("#xpv-toolbar-item-".concat(n));r&&r.remove(),t.mLayerContainer.prepend(t.createToolbarElement(e))},i=new MutationObserver((function(e){e.forEach((function(e){if(e.target instanceof HTMLElement&&e.target.closest("#xpv-toolbar-item-".concat(n)))return i.disconnect(),void r();e.removedNodes.forEach((function(e){e instanceof HTMLElement&&("svg"!==e.tagName&&e.id!=="xpv-toolbar-item-".concat(n)||(i.disconnect(),r()))}))}))}));i.observe(this.mLayerContainer,{subtree:!0,childList:!0,attributes:!0})}},{key:"initializeGlobalStyle",value:function(){this.mGlobalStyleElement=p.createElement("style"),document.getElementsByTagName("head")[0].appendChild(this.mGlobalStyleElement),p.setAttribute(this.mGlobalStyleElement,"type","text/css"),p.setHtml(this.mGlobalStyleElement,'.xpv__viewer_toolbar_container .mobile-enabled,\n            .xpv__viewer_toolbar_container .desktop-enabled {\n                display: none;\n            }\n\n            @media screen and (max-width: 768px){\n                .xpv__viewer_toolbar_container .mobile-disabled {\n                    display: none;\n                }\n                .xpv__viewer_toolbar_container .mobile-enabled {\n                    display: block;\n                }\n            }\n\n            @media screen and (min-width: 769px){\n                .xpv__viewer_toolbar_container .desktop-disabled {\n                    display: none;\n                }\n                .xpv__viewer_toolbar_container .desktop-enabled {\n                    display: block;\n                }\n            }\n\n            /*\n                The toolbar is one big flex container. It orders the elements like so:\n\n                 ______________________\n                | 1                  2 |\n                |                      |\n                |                      |\n                |          3           |\n                |      [::after]       |\n                |                      |\n                | 4                  5 |\n                |______________________|\n\n                The ::after element is there purely to force the flex-wrap. The elements\n                get positioned properly using the .top-left, .top-right, .bottom-left and\n                .bottom-right classes (exactly one of those is required).\n            */\n\n            .xpv__viewer_toolbar_container::after {\n                content: "";\n                order: 3;\n                display: block;\n                width: 100%;\n            }\n\n            .xpv__viewer_toolbar_container {\n                display: flex;\n                flex-flow: row wrap;\n                align-items: flex-end;\n                position: absolute;\n                top: 0;\n                left: 0;\n                width: 100%;\n                height: 100%;\n                pointer-events: none;\n                opacity: 0;\n                transition: opacity 1s 4.5s;\n            }\n\n            .xpv__viewer_toolbar_container > * {\n                pointer-events: all;\n            }\n\n            /*\n                Set the position for each corner\n            */\n\n            .xpv__viewer_toolbar_container .top-left {\n                order: 1;\n                align-self: flex-start;\n            }\n            .xpv__viewer_toolbar_container .top-right {\n                order: 2;\n                align-self: flex-start;\n            }\n            .xpv__viewer_toolbar_container .bottom-left {\n                order: 4;\n                align-self: flex-end;\n            }\n            .xpv__viewer_toolbar_container .bottom-right {\n                order: 5;\n                align-self: flex-end;\n            }\n\n            /*\n                Force the items to justify correctly,\n                i.e. force the right side to the right and the left side to the left\n            */\n\n            .xpv__viewer_toolbar_container .top-right { margin-left: auto; }\n            .xpv__viewer_toolbar_container .top-right ~ .top-right { margin-left: 6px; }\n\n            .xpv__viewer_toolbar_container .bottom-right { margin-left: auto; }\n            .xpv__viewer_toolbar_container .bottom-right ~ .bottom-right { margin-left: 6px; }\n\n            .xpv__viewer_toolbar_container button {\n                height: 48px;\n                padding: 6px;\n                margin: 6px;\n                position: relative;\n                color: inherit;\n                background-color: rgba(224, 224, 224, 0.4);\n                border-radius: 30px;\n                border: none;\n                outline: none;\n                cursor: pointer;\n                transition: .3s;\n            }\n\n            .xpv__viewer_toolbar_container button > svg,\n            .xpv__viewer_toolbar_container button > img {\n                height: 100%;\n            }\n\n            .xpv__viewer_toolbar_container button:hover,\n            .xpv__viewer_toolbar_container button:focus {\n                background-color: rgba(175, 175, 175, .4);\n            }\n\n            .xpv__viewer_toolbar_container button:active {\n                background-color: rgba(155, 155, 155, .5);\n            }\n\n            /*\n                Toolbar should appear when hovering the viewer\n            */\n\n            :hover ~ .xpv__viewer_toolbar_container,\n            .interacted > .xpv__viewer_toolbar_container,\n            .xpv__viewer_toolbar_container:hover {\n                opacity: 1;\n                transition: opacity 0s 0s;\n            }\n\n            .xpv__viewer_toolbar_container:focus-within {\n                opacity: 1;\n                transition: opacity 0s 0s;\n            }\n\n            .xpv__viewer_toolbar_group_container {\n                position: relative;\n            }\n\n            .xpv__viewer_toolbar_group_container:not(.open) .xpv__viewer_toolbar_group {\n                opacity: 0;\n                pointer-events: none;\n                transform: scale(0.9, .85);\n            }\n\n            .xpv__viewer_toolbar_group {\n                position: absolute;\n                top: 0;\n                background-color: rgb(238, 238, 238);\n                border-radius: 30px;\n                transition: .3s;\n            }\n\n            .xpv__viewer_toolbar_group > div {\n                display: flex;\n                flex-direction: row;\n            }\n\n            .xpv__viewer_toolbar_group::before {\n                content: "";\n                display: block;\n                width: 30px;\n                height: 30px;\n                position: absolute;\n                top: 50%;\n                transform: translateY(-50%) rotate(45deg);\n                background-color: inherit;\n            }\n\n            .xpv__viewer_toolbar_group_container.top-left .xpv__viewer_toolbar_group {\n                left: calc(100% + 12px);\n                transform-origin: -12px 50%;\n            }\n            .xpv__viewer_toolbar_group_container.top-right .xpv__viewer_toolbar_group {\n                right: calc(100% + 12px);\n                transform-origin: calc(100% + 12px) 50%;\n            }\n            .xpv__viewer_toolbar_group_container.bottom-left .xpv__viewer_toolbar_group,\n            .xpv__viewer_toolbar_group_container.bottom-right .xpv__viewer_toolbar_group {\n                top: auto;\n                bottom: calc(100% + 12px);\n                transform-origin: 50% calc(100% + 12px);\n            }\n            .xpv__viewer_toolbar_group_container.bottom-left .xpv__viewer_toolbar_group {\n                left: 0;\n            }\n            .xpv__viewer_toolbar_group_container.bottom-right .xpv__viewer_toolbar_group {\n                right: 0;\n            }\n\n            .xpv__viewer_toolbar_group_container.top-left .xpv__viewer_toolbar_group::before {\n                left: -2px;\n            }\n            .xpv__viewer_toolbar_group_container.top-right .xpv__viewer_toolbar_group::before {\n                right: -2px;\n            }\n\n            .xpv__viewer_toolbar_group_container.bottom-left .xpv__viewer_toolbar_group::before {\n                top: 75%;\n                left: 15px;\n            }\n            .xpv__viewer_toolbar_group_container.bottom-right .xpv__viewer_toolbar_group::before {\n                top: 75%;\n                right: 15px;\n            }\n\n            #xpv-toolbar-loader {\n                display: flex;\n                flex-direction: column;\n                align-items: center;\n                padding: 12px 18px;\n                position: absolute;\n                top: 50%;\n                left: 50%;\n                transform: translate(-50%, -50%);\n                color: white;\n                background-color: rgb(0, 0, 0, 0.4);\n                border-radius: 12px;\n                z-index: 4;\n            }\n\n            #xpv-toolbar-loader[hidden] { display: none; }\n\n            #xpv-toolbar-loader-icon { height: 60px; }\n            #xpv-toolbar-loader-icon > * { height: 100%; }\n\n            #xpv-toolbar-loader-message {\n                font: 20px / 1.5 Arial, sans-serif;\n            }\n\n            #xpv-toolbar-ar-qr {\n                display: flex;\n                flex-direction: column;\n                align-items: center;\n                justify-content: center;\n                padding: 18px;\n                position: absolute;\n                top: 0;\n                left: 0;\n                width: 100%;\n                height: 100%;\n                color: white;\n                background-color: rgb(0, 0, 0, 0.4);\n                cursor: pointer;\n                z-index: 4;\n            }\n\n            #xpv-toolbar-ar-qr[hidden] { display: none; }\n\n            #xpv-toolbar-ar-qr-code { margin-bottom: 8px; }\n            #xpv-toolbar-ar-qr-message {\n                text-align: center;\n                font: 20px / 1.3 Arial, sans-serif;\n            }\n\n            .xpv-toolbar-item-icon {\n                display: inline-block;\n            }\n            .xpv-toolbar-item-icon-inverted {\n                display: none;\n            }\n\n            .xpv-toolbar-item-inverted .xpv-toolbar-item-icon {\n                display: none;\n            }\n            .xpv-toolbar-item-inverted .xpv-toolbar-item-icon-inverted {\n                display: inline-block;\n            }')}}])}(po);function bo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bo=function(){return!!e})()}var Ao=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,bo()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getViewportRenderer",value:function(){return this.getParentObject()}},{key:"isAttachable",value:function(e){return e.isTypeName("ViewportRenderer")}}])}(he.$);(0,c.A)(Ao,"TypeRTTI",new le.O("ViewportController",he.$.TypeRTTI));var _o,Mo,ko=__webpack_require__(85434),wo=__webpack_require__(44152),To=__webpack_require__(7909),xo=__webpack_require__(52669);(Mo=_o||(_o={}))[Mo.Linear=0]="Linear",Mo[Mo.EaseIn=1]="EaseIn",Mo[Mo.EaseOut=2]="EaseOut",Mo[Mo.EaseInOut=3]="EaseInOut",Mo[Mo.Brezier=4]="Brezier",Mo[Mo.Parametric=5]="Parametric";var So,Co,Eo=__webpack_require__(8870);(Co=So||(So={}))[Co.Default=0]="Default",Co[Co.Parent=1]="Parent",Co[Co.Always=2]="Always",Co[Co.OnlySelf=3]="OnlySelf";var Ro,Io,Oo=__webpack_require__(54538);function Do(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Do=function(){return!!e})()}(Io=Ro||(Ro={}))[Io.color=0]="color",Io[Io.equirect=1]="equirect",Io[Io.image=2]="image",Io[Io.skybox=3]="skybox",Io[Io.transparent=4]="transparent",Io[Io.environment=5]="environment",Io[Io.LAST_INDEX=6]="LAST_INDEX";var Po=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Do()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"equalsBackgroundType",value:function(e){var t=e;return"function"==typeof t.getBackgroundType&&t.getBackgroundType()===this.getBackgroundType()}}])}(Oo.E);function Bo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bo=function(){return!!e})()}var Fo=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Bo()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return Oo.n.background}},{key:"getBackgroundType",value:function(){return Ro.transparent}},{key:"equals",value:function(e){return this.equalsBackgroundType(e)}}])}(Po);function No(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(No=function(){return!!e})()}var Lo=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,No()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mColor",new Ft.v),n.mColor.copy(e||new Ft.v),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return Oo.n.background}},{key:"getBackgroundType",value:function(){return Ro.color}},{key:"equals",value:function(e){return this.equalsBackgroundType(e)&&e.getColor().equals(this.mColor)}},{key:"getColor",value:function(){return this.mColor}},{key:"setColor",value:function(e){this.mColor.copy(e)}}])}(Po);function jo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jo=function(){return!!e})()}var Uo=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,jo()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mMediaId",void 0),n.mMediaId=e,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return Oo.n.background}},{key:"getBackgroundType",value:function(){return Ro.image}},{key:"equals",value:function(e){return this.equalsBackgroundType(e)&&e.getMediaId()===this.getMediaId()}},{key:"getMediaId",value:function(){return this.mMediaId}},{key:"setMediaId",value:function(e){this.mMediaId=e}}])}(Po);function Vo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vo=function(){return!!e})()}var zo=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,Vo()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mMediaIds",void 0),n.mMediaIds=e,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return Oo.n.background}},{key:"getBackgroundType",value:function(){return Ro.skybox}},{key:"equals",value:function(e){if(!this.equalsBackgroundType(e))return!1;var t=this.getMediaIds(),n=e.getMediaIds();return n.length===t.length&&n.every((function(e,n){return e===t[n]}))}},{key:"getMediaIds",value:function(){return this.mMediaIds}},{key:"setMediaId",value:function(e){this.mMediaIds=e}}])}(Po);function Ho(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Go(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ho(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ho(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qo=[{id:"adams_place_bridge",name:"Adams Place Bridge",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/adams_place_bridge/adams_place_bridge.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/adams_place_bridge/adams_place_bridge_4k_environment.env")},{id:"brown_photostudio_02",name:"Brown Photostudio 02",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/brown_photostudio_02/brown_photostudio_02.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/brown_photostudio_02/brown_photostudio_02_4k_environment.env")},{id:"dancing_hall",name:"Dancing Hall",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/dancing_hall/dancing_hall.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/dancing_hall/dancing_hall_4k_environment.env")},{id:"je_gray_02",name:"J&E Gray 02",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/je_gray_02/je_gray_02.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/je_gray_02/je_gray_02_4k_environment.env")},{id:"modern_buildings_2",name:"Modern Buildings 2",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/modern_buildings_2/modern_buildings_2.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/modern_buildings_2/modern_buildings_2_4k_environment.env")},{id:"phalzer_forest_01",name:"Phalzer Forest 01",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/phalzer_forest_01/phalzer_forest_01.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/phalzer_forest_01/phalzer_forest_01_4k_environment.env")},{id:"rainforest_trail",name:"Rainforest Trail",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/rainforest_trail/rainforest_trail.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/rainforest_trail/rainforest_trail_4k_environment.env")},{id:"studio_small_09",name:"Studio Small 09",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/studio_small_09/studio_small_09.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/studio_small_09/studio_small_09_4k_environment.env")},{id:"acoustical_shell",name:"Acoustical Shell",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/acoustical_shell/acoustical_shell.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/acoustical_shell/acoustical_shell_4k_environment.env")},{id:"basement_boxing_ring",name:"Basement Boxing Ring",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/basement_boxing_ring/basement_boxing_ring.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/basement_boxing_ring/basement_boxing_ring_4k_environment.env")},{id:"blocky_photo_studio",name:"Blocky Photo Studio",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/blocky_photo_studio/blocky_photo_studio.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/blocky_photo_studio/blocky_photo_studio_4k_environment.env")},{id:"blue_photo_studio",name:"Blue Photo Studio",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/blue_photo_studio/blue_photo_studio.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/blue_photo_studio/blue_photo_studio_4k_environment.env")},{id:"canary_wharf",name:"Canary Wharf",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/canary_wharf/canary_wharf.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/canary_wharf/canary_wharf_4k_environment.env")},{id:"cyclorama_hard_light",name:"Cyclorama Hard Light",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/cyclorama_hard_light/cyclorama_hard_light.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/cyclorama_hard_light/cyclorama_hard_light_4k_environment.env")},{id:"kiara_1_dawn",name:"Kiara 1 Dawn",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/kiara_1_dawn/kiara_1_dawn.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/kiara_1_dawn/kiara_1_dawn_4k_environment.env")},{id:"leadenhall_market",name:"Leadenhall Market",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/leadenhall_market/leadenhall_market.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/leadenhall_market/leadenhall_market_4k_environment.env")},{id:"lilienstein",name:"Lilienstein",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/lilienstein/lilienstein.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/lilienstein/lilienstein_4k_environment.env")},{id:"piazza_san_marco",name:"Piazza San Marco",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/piazza_san_marco/piazza_san_marco.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/piazza_san_marco/piazza_san_marco_4k_environment.env")},{id:"royal_esplanade",name:"Royal Esplanade",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/royal_esplanade/royal_esplanade.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/royal_esplanade/royal_esplanade_4k_environment.env")},{id:"shanghai_bund",name:"Shanghai Bund",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/shanghai_bund/shanghai_bund.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/shanghai_bund/shanghai_bund_4k_environment.env")},{id:"small_cathedral_02",name:"Small Cathedral 02",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/small_cathedral_02/small_cathedral_02.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/small_cathedral_02/small_cathedral_02_4k_environment.env")},{id:"small_empty_room_1",name:"Small Empty Room 1",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/small_empty_room_1/small_empty_room_1.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/small_empty_room_1/small_empty_room_1_4k_environment.env")},{id:"small_empty_room_3",name:"Small Empty Room 3",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/small_empty_room_3/small_empty_room_3.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/small_empty_room_3/small_empty_room_3_4k_environment.env")},{id:"small_empty_room_4",name:"Small Empty Room 4",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/small_empty_room_4/small_empty_room_4.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/small_empty_room_4/small_empty_room_4_4k_environment.env")},{id:"studio_small_08",name:"Studio Small 08",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/studio_small_08/studio_small_08.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/studio_small_08/studio_small_08_4k_environment.env")},{id:"venice_sunrise",name:"Venice Sunrise",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/venice_sunrise/venice_sunrise.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/venice_sunrise/venice_sunrise_4k_environment.env")},{id:"venice_sunset",name:"Venice Sunset",type:"system",thumbnail:"".concat(et.w.assetsUrl,"system/textures/hdri/venice_sunset/venice_sunset.png"),environment:"".concat(et.w.assetsUrl,"system/textures/hdri/venice_sunset/venice_sunset_4k_environment.env")}],Wo=qo.map((function(e){return e.environment=(0,h.bk)(e.environment),e})).reduce((function(e,t){return Go(Go({},e),{},(0,c.A)({},t.id,t))}),{});function Ko(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ko=function(){return!!e})()}var Xo=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,Ko()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mEnvironment",void 0),n.mEnvironment=e,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return Oo.n.environment}},{key:"equals",value:function(e){var t,n,r;if(e.getType()!==this.getType())return!1;var i=e.getEnvironment();return(null==i?void 0:i.type)===(null===(t=this.mEnvironment)||void 0===t?void 0:t.type)&&(null==i?void 0:i.environment)===(null===(n=this.mEnvironment)||void 0===n?void 0:n.environment)&&(null==i?void 0:i.media_id)===(null===(r=this.mEnvironment)||void 0===r?void 0:r.media_id)}},{key:"getEnvironment",value:function(){return this.mEnvironment}}])}(Oo.E);function Yo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yo=function(){return!!e})()}var $o=function(e){function t(e,n,r){var i,a,o,u,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return(0,s.A)(this,t),a=this,o=t,o=(0,oe.A)(o),i=(0,ae.A)(a,Yo()?Reflect.construct(o,u||[],(0,oe.A)(a).constructor):o.apply(a,u)),(0,c.A)(i,"mEnvironment",void 0),(0,c.A)(i,"mScale",void 0),(0,c.A)(i,"mBlur",void 0),(0,c.A)(i,"mIntensity",void 0),(0,c.A)(i,"mRotation",void 0),i.mScale=e,i.mBlur=n,i.mEnvironment=r,i.mIntensity=l,i.mRotation=h,i}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return Oo.n.background}},{key:"getEnvironmentType",value:function(){var e,t;return null!==(e=null===(t=this.mEnvironment)||void 0===t?void 0:t.type)&&void 0!==e?e:"system"}},{key:"getBackgroundType",value:function(){return Ro.environment}},{key:"equals",value:function(e){var t,n,r,i,a=e;return this.equalsBackgroundType(e)&&a.getEnvironmentType()===this.getEnvironmentType()&&a.getScale()===this.mScale&&a.getBlur()===this.mBlur&&a.getIntensity()===this.mIntensity&&a.getRotation()===this.mRotation&&(null===(t=a.getEnvironment())||void 0===t?void 0:t.environment)===(null===(n=this.getEnvironment())||void 0===n?void 0:n.environment)&&(null===(r=a.getEnvironment())||void 0===r?void 0:r.media_id)===(null===(i=this.getEnvironment())||void 0===i?void 0:i.media_id)}},{key:"getScale",value:function(){return this.mScale}},{key:"getBlur",value:function(){return this.mBlur}},{key:"getEnvironment",value:function(){return this.mEnvironment}},{key:"getIntensity",value:function(){return this.mIntensity}},{key:"getRotation",value:function(){return this.mRotation}}])}(Po);function Zo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zo=function(){return!!e})()}var Qo=function(e){function t(){var e,n,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return(0,s.A)(this,t),n=this,r=t,r=(0,oe.A)(r),e=(0,ae.A)(n,Zo()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mIntensity",void 0),e.mIntensity=a,e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return Oo.n.environment_intensity}},{key:"equals",value:function(e){return e.getType()===this.getType()&&e.getIntensity()===this.mIntensity}},{key:"getIntensity",value:function(){return this.mIntensity}}])}(Oo.E);function Jo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jo=function(){return!!e})()}var es=function(e){function t(){var e,n,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return(0,s.A)(this,t),n=this,r=t,r=(0,oe.A)(r),e=(0,ae.A)(n,Jo()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mRotation",void 0),e.mRotation=a,e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return Oo.n.environment_rotation}},{key:"equals",value:function(e){return e.getType()===this.getType()&&e.getRotation()===this.mRotation}},{key:"getRotation",value:function(){return this.mRotation}}])}(Oo.E);function ts(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ns(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ts(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ts(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rs(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rs=function(){return!!e})()}function is(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var as,os,ss=function(e){function t(e){var n,r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e],a=(0,oe.A)(a),r=(0,ae.A)(i,rs()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mViewId",void 0),(0,c.A)(r,"mViewVisibilityType",So.Default),(0,c.A)(r,"mMenuNavigation",!0),(0,c.A)(r,"mBgType","none"),(0,c.A)(r,"mTextureIds",void 0),(0,c.A)(r,"mColor",Ft.v.White()),(0,c.A)(r,"mProductSettings",{}),(0,c.A)(r,"mViewSettings",{}),(0,c.A)(r,"mLightSettings",{}),(0,c.A)(r,"mEnvironmentSettings",void 0),(0,c.A)(r,"mUxSettings",{}),(0,c.A)(r,"mAssetSettings",{}),r.mName="ViewNode",r.mViewId=f.V.guid(),r.mTextureIds=[null,null,null,null,null,null],r.mEnvironmentSettings={type:"system",intensity:1,rotation_y:0,scale:99,blur:.2,environment_id:null===(n=qo[0])||void 0===n?void 0:n.id,media_id:void 0},r.mViewSettings={automatic_camera:!1},r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){var n=Object.assign(is(t,"serialize",this,3)([e]),{type:"view"});return n.properties=Object.assign(n.properties,{view_id:this.mViewId,view_visibility:this.mViewVisibilityType,menu_navigation:this.mMenuNavigation,bg_type:this.mBgType,skycube_tex_0:this.mTextureIds[0],skycube_tex_1:this.mTextureIds[1],skycube_tex_2:this.mTextureIds[2],skycube_tex_3:this.mTextureIds[3],skycube_tex_4:this.mTextureIds[4],skycube_tex_5:this.mTextureIds[5],color:this.mColor.getHexString(),product_settings:this.mProductSettings,view_settings:this.mViewSettings,light_settings:this.mLightSettings,environment_settings:this.mEnvironmentSettings,ux_settings:this.mUxSettings,asset_settings:this.mAssetSettings}),n}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"view_id":return this.mViewId=n,!0;case"view_visibility":return this.mViewVisibilityType=+n,!0;case"menu_navigation":return this.mMenuNavigation=(0,h.Hn)(n),!0;case"bg_type":return this.mBgType=n,!0;case"skycube_tex_0":return this.mTextureIds[0]=(0,h.kf)(n)?parseInt(n,10):null,!0;case"skycube_tex_1":return this.mTextureIds[1]=(0,h.kf)(n)?parseInt(n,10):null,!0;case"skycube_tex_2":return this.mTextureIds[2]=(0,h.kf)(n)?parseInt(n,10):null,!0;case"skycube_tex_3":return this.mTextureIds[3]=(0,h.kf)(n)?parseInt(n,10):null,!0;case"skycube_tex_4":return this.mTextureIds[4]=(0,h.kf)(n)?parseInt(n,10):null,!0;case"skycube_tex_5":return this.mTextureIds[5]=(0,h.kf)(n)?parseInt(n,10):null,!0;case"skybox_env_scale":return this.mEnvironmentSettings.scale=Number(n),!0;case"skybox_env_blur":return this.mEnvironmentSettings.blur=Number(n),!0;case"skybox_env_intensity":return this.mEnvironmentSettings.intensity=Number(n),!0;case"skybox_env_rotation":return this.mEnvironmentSettings.rotation_y=Number(n),!0;case"color":return this.mColor.set(n),!0;case"product_settings":return this.mProductSettings=ns(ns({},this.mProductSettings),n),!0;case"view_settings":return this.mViewSettings=ns(ns({},this.mViewSettings),n),!0;case"light_settings":return this.mLightSettings=ns(ns({},this.mLightSettings),n),!0;case"environment_settings":return this.mEnvironmentSettings=ns(ns({},this.mEnvironmentSettings),n),!0;case"ux_settings":return this.mUxSettings=ns(ns({},this.mUxSettings),n),!0;case"asset_settings":return this.mAssetSettings=ns(ns({},this.mAssetSettings),n),!0}return is(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=is(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"view_id":return this.mViewId;case"view_visibility":return this.mViewVisibilityType;case"menu_navigation":return this.mMenuNavigation;case"bg_type":return this.mBgType;case"skycube_tex_0":return this.mTextureIds[0];case"skycube_tex_1":return this.mTextureIds[1];case"skycube_tex_2":return this.mTextureIds[2];case"skycube_tex_3":return this.mTextureIds[3];case"skycube_tex_4":return this.mTextureIds[4];case"skycube_tex_5":return this.mTextureIds[5];case"skybox_env_scale":return this.mEnvironmentSettings.scale;case"skybox_env_blur":return this.mEnvironmentSettings.blur;case"skybox_env_intensity":return this.mEnvironmentSettings.intensity;case"skybox_env_rotation":return this.mEnvironmentSettings.rotation_y;case"color":return this.mColor;case"product_settings":return this.mProductSettings;case"view_settings":return this.mViewSettings;case"light_settings":return this.mLightSettings;case"environment_settings":return this.mEnvironmentSettings;case"ux_settings":return this.mUxSettings;case"asset_settings":return this.mAssetSettings}return null}},{key:"onBeforeParseCreate",value:function(e){var n=this.findParentOfType(kt.i.TypeRTTI);if("product"===e&&n&&n.isBundled())return!1;var r=R.K.sceneManager().getScene().getChildrenDerivedTypeOf(kt.i.TypeRTTI),i=n&&r.length>0&&r[0].getSceneObjectId()===n.getSceneObjectId();return!("product"!==e&&!i)&&is(t,"onBeforeParseCreate",this,3)([e])}},{key:"getViewId",value:function(){return this.mViewId}},{key:"getVisibilityType",value:function(){return this.mViewVisibilityType}},{key:"setVisibilityType",value:function(e){this.mViewVisibilityType=e}},{key:"getVisibilityMenu",value:function(){return this.mMenuNavigation}},{key:"setVisibleMenu",value:function(e){this.mMenuNavigation=e}},{key:"getParentProductSceneObjectId",value:function(){var e=this.findParentOfType(kt.i.TypeRTTI);if(e)return e.getSceneObjectId()}},{key:"isParentViewVisible",value:function(){for(var e=this.getParent();e;){if(e.isDerivedTypeOf(t.TypeRTTI))return e.isViewVisible();e=e.getParent()}return!1}},{key:"descendingViewActive",value:function(){var e=new Array;this.mChildren.forEach((function(t){t.isDerivedTypeOf(kt.i.TypeRTTI)||e.push(t)}));for(var n,r=R.K.sceneManager().getActiveView().getViewId(),i=function(){var n=e.shift();if(n.isDerivedTypeOf(Eo.Z.TypeRTTI)){if(n.isDerivedTypeOf(t.TypeRTTI)&&n.getViewId()===r)return{v:!0};n.getChildren().forEach((function(t){n.isDerivedTypeOf(kt.i.TypeRTTI)||e.push(t)}))}};e.length>0;)if(n=i())return n.v;return!1}},{key:"isViewVisible",value:function(){var e=R.K.sceneManager().getActiveView();if(!e)return!1;var t=this.getParentProductSceneObjectId(),n=e.getParentProductSceneObjectId();if(void 0===t||void 0===n||t!==n)return!1;var r=e.getViewId()===this.getViewId(),i=!1;switch(this.getVisibilityType()){case So.Default:i=r||this.descendingViewActive();break;case So.Parent:i=r||this.descendingViewActive()||this.isParentViewVisible();break;case So.Always:i=!0;break;case So.OnlySelf:i=r}return i}},{key:"isAutomaticCameraInScene",value:function(){var e;return null!==(e=this.mViewSettings.automatic_camera)&&void 0!==e&&e}},{key:"setAutomaticCameraInScene",value:function(e){this.mViewSettings.automatic_camera=e}},{key:"enableBackgroundState",value:function(e){switch(this.mBgType){case"transparent":e.pushSceneState(new Fo);break;case"color":e.pushSceneState(new Lo(this.mColor));break;case"image":if(!(0,h.kf)(this.mTextureIds[0]))return;e.pushSceneState(new Uo(this.mTextureIds[0]));break;case"cube":for(var t=[],n=0;n<this.mTextureIds.length;n++){if(!(0,h.kf)(this.mTextureIds[n]))return;t.push(this.mTextureIds[n])}e.pushSceneState(new zo(t));break;case"environment":var r,i;if(!(i="system"===(null!==(r=this.mEnvironmentSettings.type)&&void 0!==r?r:"system")?null==Wo?void 0:Wo[this.mEnvironmentSettings.environment_id]:{id:"".concat(this.mEnvironmentSettings.media_id),name:"".concat(this.mEnvironmentSettings.media_id),type:"upload",media_id:this.mEnvironmentSettings.media_id}))return;e.pushSceneState(new $o(this.mEnvironmentSettings.scale,this.mEnvironmentSettings.blur,i,this.mEnvironmentSettings.intensity,this.mEnvironmentSettings.rotation_y))}}},{key:"enableEnvironmentState",value:function(e){var t,n;(n="system"===(null!==(t=this.mEnvironmentSettings.type)&&void 0!==t?t:"system")?null==Wo?void 0:Wo[this.mEnvironmentSettings.environment_id]:{id:"".concat(this.mEnvironmentSettings.media_id),name:"".concat(this.mEnvironmentSettings.media_id),type:"upload",media_id:this.mEnvironmentSettings.media_id})&&(e.pushSceneState(new Xo(n)),e.pushSceneState(new Qo(this.mEnvironmentSettings.intensity)),e.pushSceneState(new es(this.mEnvironmentSettings.rotation_y)))}},{key:"draw",value:function(e,n){if(this.isViewVisible()){var r=R.K.sceneManager().getActiveView();(null==r?void 0:r.getViewId())===this.getViewId()&&(this.enableEnvironmentState(e),this.enableBackgroundState(e)),is(t,"draw",this,3)([e,n])}}}])}(Eo.Z);(0,c.A)(ss,"TypeRTTI",new le.O("ViewNode",Eo.Z.TypeRTTI)),(os=as||(as={}))[os.DEFAULT=0]="DEFAULT",os[os.SEQUENCE=1]="SEQUENCE";var us=function(){return(0,u.A)((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:as.DEFAULT,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];(0,s.A)(this,e),(0,c.A)(this,"mAnimations",void 0),(0,c.A)(this,"mDelay",void 0),(0,c.A)(this,"mAutoStart",void 0),(0,c.A)(this,"mSequence",void 0),(0,c.A)(this,"mRepeatCount",void 0),(0,c.A)(this,"mStarted",void 0),(0,c.A)(this,"mFinished",void 0),(0,c.A)(this,"mDelayTimer",void 0),(0,c.A)(this,"mRepeat",void 0),this.mAnimations=t,this.mSequence=n,this.mDelay=r,this.mRepeatCount=i,this.mAutoStart=a,this.mStarted=this.mAutoStart,this.mAutoStart&&this.start()}),[{key:"update",value:function(e){if(this.mStarted&&!this.mFinished)if(this.mDelayTimer<this.mDelay)this.mDelayTimer+=e;else{switch(this.mSequence){case as.DEFAULT:this.mAnimations.forEach((function(t){t.isFinished()||t.update(e)}));break;case as.SEQUENCE:var t=this.mAnimations.filter((function(e){return!e.isFinished()}));t.length>0&&t[0].update(e)}!this.mAnimations.some((function(e){return!e.isFinished()}))&&(this.mRepeat>=this.mRepeatCount?this.mFinished=!0:(this.mRepeat+=1,this.mAnimations.forEach((function(e){return e.start()}))))}}},{key:"start",value:function(){this.mStarted=!0,this.mFinished=!1,this.mDelayTimer=0,this.mRepeat=0}},{key:"finish",value:function(){this.mFinished=!0,this.mAnimations.forEach((function(e){e.isFinished()||e.finish()}))}},{key:"isFinished",value:function(){return this.mFinished}}])}(),cs=__webpack_require__(1208),ls=__webpack_require__(67791),hs=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mBrokerSubscriptions",[]),(0,c.A)(this,"mOnRendererIdle",void 0),(0,c.A)(this,"mOnEngineIdle",void 0),(0,c.A)(this,"mSceneIdle",!0),(0,c.A)(this,"mRendererIdle",!0),(0,c.A)(this,"mAttached",!1),(0,c.A)(this,"mDetached$",void 0)}),[{key:"attach",value:function(){this.mAttached=!0,this.mOnEngineIdle=new M.B,this.mOnRendererIdle=new M.B,this.mDetached$=new M.B,this.observeRenderer(),this.observeScene()}},{key:"detach",value:function(){this.mAttached&&(this.mBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mOnEngineIdle.complete(),this.mOnRendererIdle.complete(),this.mDetached$.next(),this.mDetached$.complete())}},{key:"observeRenderer",value:function(){var e=this;this.mBrokerSubscriptions.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.RendererBuildStarted),(function(){return e.mOnRendererIdle.next(!1)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.RendererBuildFinished),(function(){return e.mOnRendererIdle.next(!0)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.RendererBuildIdle),(function(){return e.mOnRendererIdle.next(!0)}))),this.onRendererIdle.pipe(ca((function(t,n){return e.mRendererIdle===t&&e.mRendererIdle===n&&t===n}))).subscribe({next:function(t){e.mRendererIdle=t,e.dispatchEngineIdle()}})}},{key:"observeScene",value:function(){var e=this;this.onSceneManagerIdle.pipe(ca(),(0,k.M)((function(){return R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))}))).subscribe((function(t){e.mSceneIdle=t,e.mRendererIdle=!1,e.dispatchEngineIdle()}))}},{key:"dispatchEngineIdle",value:function(){this.mOnEngineIdle.next(this.mSceneIdle&&this.mRendererIdle)}},{key:"onRendererIdle",get:function(){return this.mOnRendererIdle.pipe((0,ls.Q)(this.mDetached$))}},{key:"onSceneManagerIdle",get:function(){return R.K.sceneManager().onSceneIdle.pipe((0,ls.Q)(this.mDetached$))}},{key:"onEngineIdle",get:function(){if(!this.mAttached)throw new Error("EngineProgressObserver is not attached");return this.mOnEngineIdle.pipe((0,ls.Q)(this.mDetached$))}}])}(),fs=__webpack_require__(31635),ms=__webpack_require__(88483),ps=__webpack_require__(24151),ds=__webpack_require__(57516),vs=__webpack_require__(82100),ys=__webpack_require__(66450);function gs(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,vs.lI)(e),r=(0,vs.ms)(e),i=(0,ps.D)(e),a=i.args,o=i.keys;if(0===a.length)return(0,xn.H)([],n);var s=new ms.c(bs(a,n,o?function(e){return(0,ys.e)(o,e)}:ua.D));return r?s.pipe((0,ds.I)(r)):s}function bs(e,t,n){return void 0===n&&(n=ua.D),function(r){As(t,(function(){for(var i=e.length,a=new Array(i),o=i,s=i,u=function(i){As(t,(function(){var u=(0,xn.H)(e[i],t),c=!1;u.subscribe((0,S._)(r,(function(e){a[i]=e,c||(c=!0,s--),s||r.next(n(a.slice()))}),(function(){--o||r.complete()})))}),r)},c=0;c<i;c++)u(c)}),r)}}function As(e,t,n){e?(0,hn.N)(n,e,t):t()}var _s=Array.isArray;var Ms=__webpack_require__(81485);function ks(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,vs.ms)(e);return n?(0,Ms.F)(ks.apply(void 0,(0,fs.fX)([],(0,fs.zs)(e))),(0,ds.I)(n)):(0,x.N)((function(t,n){bs((0,fs.fX)([t],(0,fs.zs)(function(e){return 1===e.length&&_s(e[0])?e[0]:e}(e))))(n)}))}function ws(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ws=function(){return!!e})()}var Ts=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["viewport-camera-selector"],r=(0,oe.A)(r),e=(0,ae.A)(n,ws()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"mActiveCamera",void 0),(0,c.A)(e,"mCameras",[]),(0,c.A)(e,"mStartup",!0),(0,c.A)(e,"mAnimator",void 0),(0,c.A)(e,"mEngineProgressObserver",void 0),(0,c.A)(e,"mOnMoveToCameraIdMessage",void 0),e.mEngineProgressObserver=new hs,e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this.mSubscriptions.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.NodeAdded),(function(t){var n=t.getData();n instanceof We&&n.isCameraPartOfScene()&&(e.mCameras.push(n),e.syncCameras())})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.NodeRemoved),(function(t){var n=t.getData();if(n instanceof We){var r=e.mCameras.findIndex((function(e){return n.getSceneObjectId()===e.getSceneObjectId()}));r>=0&&(e.mCameras.splice(r,1),e.syncCameras())}}))),this.registerMessageHandler(m.W2.TypeRTTI,(function(t){e.animate(t.delta),e.mStartup&&e.syncCameras()})),this.mEngineProgressObserver.attach(),this.mOnMoveToCameraIdMessage=new M.B,this.observeMoveToCameraId(),this.registerMessageHandler(ko.E.TypeRTTI,(function(t){t.skipRenderAwaiting?e.moveToCameraById(t.camId,t.animate,t.openView):e.mOnMoveToCameraIdMessage.next(t)})),this.registerMessageHandler(wo.y.TypeRTTI,(function(t){e.moveToViewById(t.viewId)})),this.registerMessageHandler(To.k.TypeRTTI,(function(t){e.moveToPoint(t.origin,t.dir,t.action,t.delta,t.forceUpdate)})),this.registerMessageHandler(xo.u.TypeRTTI,(function(t){e.setCameraToObject(t.targetObject,t.fitPosition,t.animate)}))}},{key:"OnDetached",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.unregisterMessageHandler(m.W2.TypeRTTI),this.unregisterMessageHandler(ko.E.TypeRTTI),this.unregisterMessageHandler(wo.y.TypeRTTI),this.unregisterMessageHandler(To.k.TypeRTTI),this.unregisterMessageHandler(xo.u.TypeRTTI),this.mCameras.splice(0),this.mEngineProgressObserver.detach(),this.mOnMoveToCameraIdMessage.complete()}},{key:"observeMoveToCameraId",value:function(){var e=this;this.mOnMoveToCameraIdMessage.pipe(Ar((function(t){return(0,Mr.of)(t).pipe(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ks.apply(void 0,(0,fs.fX)([],(0,fs.zs)(e)))}([e.mEngineProgressObserver.onEngineIdle.pipe((0,w.p)((function(e){return e})),(0,E.s)(1))]))})),(0,cn.T)((function(e){return(0,o.A)(e,1)[0]}))).subscribe((function(t){e.moveToCameraById(t.camId,t.animate,t.openView)}))}},{key:"syncCameras",value:function(){if(this.mStartup&&0!==this.mCameras.length){var e=R.K.sceneManager().getActiveView();if(e){var t=e.isAutomaticCameraInScene()?this.mCameras.findIndex((function(e){return e.autoFocus!==me.NONE})):this.mCameras.findIndex((function(e){return e.autoFocus===me.NONE}));if(!(t<0)){var n=this.mCameras[t];e.isAutomaticCameraInScene()&&null!=n&&n.autoFocusNeedsUpdate&&!n.updateAutoFocus()||(this.mStartup=!1,this.moveToCameraByIndex(t,!0,!1))}}}}},{key:"moveToViewById",value:function(e){var t=this,n=R.K.sceneManager().getRootProductNode(),r=R.K.sceneManager().findNodesOfType(ss.TypeRTTI,(function(t){return!(t.findParentOfType(kt.i.TypeRTTI).getSceneObjectId()!==n.getSceneObjectId())&&t.getSceneObjectId()===e}));if(0!==r.length){var i=r[0];v.UX.print("Move to view id:",e,"(".concat(i.name,")"));for(var a=i.findRootOfType(ss.TypeRTTI),o=[a=a||i,i],s=i.getParent();s&&s.getSceneObjectId()!==a.getSceneObjectId();)s.isDerivedTypeOf(ss.TypeRTTI)&&o.push(s),s=s.getParent();var u=R.K.sceneManager().findNodesOfType(We.TypeRTTI,(function(e){if(!e.isCameraPartOfScene())return!1;var t=e.findParentOfType(ss.TypeRTTI);return!!o.find((function(e){return e.getSceneObjectId()===t.getSceneObjectId()}))}),a);if(u.length>0){this.mActiveCamera&&!!u.find((function(e){return e.getSceneObjectId()===t.mActiveCamera.getSceneObjectId()}))||(v.UX.print("Activating first camera in view node",e,"(".concat(i.name,")")),this.setActiveCamera(u[0],!0,_o.EaseIn))}else{var c=this.mActiveCamera?this.mActiveCamera:R.K.sceneManager().createObject("camera_perspective"),l=R.K.sceneManager().createObject("camera_perspective");l.parse(c.serialize(!0,!0),c.getSyncHash()),l.name+="#copy",v.UX.print("Cloning and activating active camera in view node as none are present",e,"(".concat(i.name,")")),R.K.sceneManager().addNode(l,i,!1),this.setActiveCamera(l,!0,_o.EaseIn)}R.K.sceneManager().setActiveView(i)}else v.UX.error("View node not found.",e)}},{key:"moveToCameraById",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_o.EaseIn;v.UX.print("Move to camera id:",e);var i=this.mCameras.findIndex((function(t){return t.getSceneObjectId()===e}));i>=0&&this.moveToCameraByIndex(i,t,n,r)}},{key:"moveToCameraByIndex",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_o.EaseIn,i=this.mCameras[e],a=n?i.findParentOfType(ss.TypeRTTI):void 0,o=R.K.sceneManager().getActiveView();o&&a&&o.getViewId()!==a.getViewId()?(R.K.sceneManager().setActiveView(a),this.setActiveCamera(i,!0,r)):this.setActiveCamera(i,t,r)}},{key:"setCameraToObject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G.FIT_OBJECT_FRONT,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];arguments.length>3&&void 0!==arguments[3]||_o.EaseIn;if(e){var r=R.K.renderer().getRenderEngine().getSceneBoundingBox(),i=new te.P;r.getCenter(i);var a=new te.P;r.getSize(a);var o=a.x>a.z?a.x:a.z,s=a.z>a.y?a.z:a.y,u=a.x>a.y?a.x:a.y;v.UX.print("Fit object product radius:",o,s,u);var c=.001,l=1e3,h=0,f=0,p=0;if(this.mActiveCamera instanceof Bt){var d=this.mActiveCamera.fov;h=s/2/Math.tan(Math.PI*d/360),f=o/2/Math.tan(Math.PI*d/360),p=u/2/Math.tan(Math.PI*d/360);var y=Math.max(h,f,p),g=Math.max(a.x,a.y,a.z);c=Math.max(.001,.1*(y-g)),l=4*(g+y)}v.UX.print("Fit object near/far:",c,l);var b=i.clone();switch(t){case G.FIT_OBJECT_FRONT:b.add(new te.P(0,.5*a.y,1.5*p));break;case G.FIT_OBJECT_BACK:b.add(new te.P(0,.5*a.y,-1.5*p));break;case G.FIT_OBJECT_LEFT:b.add(new te.P(1.5*h,.5*a.y,0));break;case G.FIT_OBJECT_RIGHT:b.add(new te.P(-1.5*h,.5*a.y,0));break;case G.FIT_OBJECT_TOP:b.add(new te.P(0,1.5*f,0));break;case G.FIT_OBJECT_BOTTOM:b.add(new te.P(0,-1.5*f,0));break;default:b.add(new te.P(0,.5*a.y,1.5*p))}this.mActiveCamera.updateMatrixWorld();var A=this.mActiveCamera.transform.position.clone();if(n){this.mActiveCamera.updateMatrixWorld();var _=cs.c.EaseIn;this.mAnimator=new us([new cs.X(this.mActiveCamera.transform.position,A,b,1,_),new cs.X(this.mActiveCamera.target,this.mActiveCamera.target.clone(),i,1,_)]),this.applyCameraValues(c,l,45)}else this.mActiveCamera.transform.position.copy(b),this.mActiveCamera.target.copy(i),this.applyCameraValues(c,l,45),this.mActiveCamera.updateMatrixLocal(),this.mActiveCamera.updateMatrixWorld(),this.mActiveCamera.markNeedsRenderUpdate(),R.K.messenger().send(new m.EI),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))}}},{key:"setActiveCamera",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_o.EaseIn;if(v.UX.print("Activate camera:",e.getSceneObjectId(),"(".concat(e.name,")"),t,n),!this.mActiveCamera){var r=R.K.sceneManager().getActiveCamera();return this.mActiveCamera=e,void(r&&r.getSceneObjectId()!==e.getSceneObjectId()&&(r.setCameraActive(!1),this.mActiveCamera.setCameraActive(!0),this.mActiveCamera.setValue("is_animating",!1)))}var i=new te.P;this.mActiveCamera.transform.getWorldPosition(i);var a=(new te.P).copy(e.initialTransform.position),o=this.mActiveCamera.initialTarget.clone(),s=e.initialTarget.clone(),u=cs.c.Linear;this.mAnimator&&(this.mAnimator.finish(),this.mActiveCamera.transform.updateMatrix(),delete this.mAnimator),this.mAnimator=new us([new cs.X(e.transform.position,i,a,1,u),new cs.X(e.target,o,s,1,u)]),this.mActiveCamera.setCameraActive(!1),e.setCameraActive(!0),this.mActiveCamera.setValue("is_animating",!1),e.setValue("is_animating",!0),this.mActiveCamera=e,t||(this.mAnimator.finish(),this.applyCameraValues(this.mActiveCamera.near,this.mActiveCamera.far,this.mActiveCamera instanceof Bt?this.mActiveCamera.fov:void 0),this.mActiveCamera.updateMatrixWorld(),this.mActiveCamera.markNeedsRenderUpdate(),this.mActiveCamera.setValue("is_animating",!1),R.K.messenger().send(new m.EI),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))),this.mActiveCamera.updateProjectionMatrix()}},{key:"applyCameraValues",value:function(e,t,n){this.mActiveCamera.near=e,this.mActiveCamera.far=t,n&&this.mActiveCamera instanceof Bt&&(this.mActiveCamera.fov=n),this.mActiveCamera.updateProjectionMatrix()}},{key:"moveToPoint",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;arguments.length>5&&void 0!==arguments[5]||_o.EaseIn;v.UX.print("Camera move to point:",e,t);var i=(new te.P).copy(e),a=(new ne.P).setFromEuler((new re.O).setFromVector3(t)),o=cs.c.EaseIn;this.mAnimator=new us([new cs.X(this.mActiveCamera.transform.position,this.mActiveCamera.transform.position.clone(),i.clone(),1,o),new cs.X(this.mActiveCamera.transform.quaternion,this.mActiveCamera.transform.quaternion.clone(),a.clone(),1,o)],as.DEFAULT),r>=1&&(this.mAnimator.finish(),this.mActiveCamera.setValue("is_animating",!1))}},{key:"animate",value:function(e){this.mAnimator&&(this.mActiveCamera.setValue("is_animating",!0),this.mAnimator.update(e),this.mActiveCamera.updateMatrixLocal(),this.mActiveCamera.updateMatrixWorld(),this.mActiveCamera.markNeedsRenderUpdate(),this.mAnimator.isFinished()&&(delete this.mAnimator,this.mActiveCamera.setValue("is_animating",!1)),R.K.messenger().send(new m.EI),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)))}}])}(Ao);(0,c.A)(Ts,"TypeRTTI",new le.O("ViewportControllerCameraSelector",Ao.TypeRTTI));var xs=__webpack_require__(49184),Ss=__webpack_require__(39697);function Cs(e,t,n){void 0===t&&(t=T.E);var r=(0,Ss.O)(e,t);return(0,xs.n)((function(){return r}),n)}function Es(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Es=function(){return!!e})()}var Rs=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["droppable"],r=(0,oe.A)(r),e=(0,ae.A)(n,Es()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"mMoveSubject",new M.B),(0,c.A)(e,"mCurrentDragOver",void 0),(0,c.A)(e,"mCellWidth",1),(0,c.A)(e,"mCellHeight",1),(0,c.A)(e,"mDragMaterial",void 0),e.mDragMaterial=R.K.renderer().getRenderEngine().createMaterialBasic("droppable-drag-material"),e.mDragMaterial.setDiffuseColor(new Ft.v(65280)),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this.mSubscriptions.push(this.mMoveSubject.pipe(Cs(50)).subscribe(this.dragMoveHandler.bind(this))),this.registerMessageHandler(m.A0.TypeRTTI,(function(t){switch(t.name){case"start":e.onDragStarted();break;case"move":e.onDragMoved(t);break;case"end":e.onDragEnd(t);break;case"drop":e.onItemDropped(t).then((function(){}),(function(e){v.UX.error(e)}))}}))}},{key:"OnDetached",value:function(){this.resetDragMaterial(),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.unregisterMessageHandler(m.A0.TypeRTTI)}},{key:"setCellSize",value:function(e,t){this.mCellWidth=e,this.mCellHeight=t}},{key:"resolveDroppableComponent",value:function(e){if(e)return e.getComponent("droppable-handler")}},{key:"dragMoveHandler",value:function(e){var t=e.canvasPosition,n=e.data;if(Array.isArray(n.types)&&0!==n.types.length){for(var r,i=this.getIntersects(t),a=0;a<i.length;a++){var o=this.resolveDroppableComponent(i[a].entity);if(o&&o.interceptDragMove(i[a],this.mCellWidth,this.mCellHeight)){r=i[a].entity;break}}this.markDragMaterial(r)}else this.resetDragMaterial()}},{key:"onDragStarted",value:function(){}},{key:"onDragMoved",value:function(e){this.mMoveSubject.next(e)}},{key:"onDragEnd",value:function(e){this.resetDragMaterial()}},{key:"markDragMaterial",value:function(e){if(this.mCurrentDragOver!==e)if(e){this.resetDragMaterial(),this.mCurrentDragOver=e;var t=this.resolveDroppableComponent(this.mCurrentDragOver);t&&t.markDragMaterial(this.mCurrentDragOver)}else this.resetDragMaterial()}},{key:"resetDragMaterial",value:function(){if(this.mCurrentDragOver){var e=this.resolveDroppableComponent(this.mCurrentDragOver);e&&e.resetDragMaterial(this.mCurrentDragOver),delete this.mCurrentDragOver}}},{key:"onItemDropped",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c,l=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.resetDragMaterial(),null!=t&&t.data){e.next=4;break}return R.K.messenger().send(new m.BX("drop",!1)),e.abrupt("return");case 4:if(n=!1,v.UX.print("Item dropped:",t),r=t.data.product_id,t.data.model_id,void 0===r){e.next=28;break}if(a=this.getIntersects(t.canvasPosition),!(o=a.find((function(e){return!!l.resolveDroppableComponent(e.entity)})))){e.next=25;break}if(!(s=this.resolveDroppableComponent(o.entity))){e.next=23;break}return e.next=16,s.acceptDrop(o);case 16:u=e.sent,(c=R.K.sceneManager().createObject("product",void 0,r)).name="Product id:".concat(r),c.transform.position.copy(u.position),c.transform.quaternion.copy(u.quaternion),R.K.sceneManager().addNode(c,void 0,!1),n=!0;case 23:e.next=26;break;case 25:v.UX.print("Item dropped on non-droppable entity.",t);case 26:e.next=29;break;case 28:case 29:R.K.messenger().send(new m.BX("drop",n,t.data));case 30:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getIntersects",value:function(e){var t=R.K.renderer().getRenderEngine().getForwardRayFromScreenCoords(R.K.sceneManager().getActiveCamera(),e.x,e.y,1/0);return R.K.renderer().getRenderEngine().raycast(t)}}]);var r}(Ao);(0,c.A)(Rs,"TypeRTTI",new le.O("ViewportControllerDroppable",Ao.TypeRTTI));var Is=__webpack_require__(90597),Os=__webpack_require__(73380),Ds=__webpack_require__(85690);function Ps(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ps=function(){return!!e})()}var Bs=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),(n=(0,ae.A)(r,Ps()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a))).mName="GroupEntity",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){var n,r,i,a,o;return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,se.A)((0,oe.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"group"})}}])}(Eo.Z);(0,c.A)(Bs,"TypeRTTI",new le.O("GroupEntity",Eo.Z.TypeRTTI));__webpack_require__(54743),__webpack_require__(34594),__webpack_require__(61740),__webpack_require__(48140),__webpack_require__(81630),__webpack_require__(72170),__webpack_require__(75044),__webpack_require__(69539),__webpack_require__(31694),__webpack_require__(89955),__webpack_require__(21903),__webpack_require__(91134),__webpack_require__(33206),__webpack_require__(44496),__webpack_require__(66651),__webpack_require__(12887),__webpack_require__(19369),__webpack_require__(66812),__webpack_require__(8995),__webpack_require__(31575),__webpack_require__(36072),__webpack_require__(88747),__webpack_require__(28845),__webpack_require__(29423),__webpack_require__(57301),__webpack_require__(373),__webpack_require__(86614),__webpack_require__(41405),__webpack_require__(37467),__webpack_require__(44732),__webpack_require__(33684),__webpack_require__(79577),__webpack_require__(26280),__webpack_require__(27913),__webpack_require__(47801),__webpack_require__(47350),__webpack_require__(23241),__webpack_require__(67302),__webpack_require__(55871);var Fs=__webpack_require__(92981),Ns=__webpack_require__(70123),Ls=__webpack_require__(71699),js=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),null,[{key:"Create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI;arguments.length>6&&void 0!==arguments[6]||Fs.k.Front;n=Math.max(3,n);for(var o=[],s=[],u=[],c=[],l=e,h=(t-e)/(r=Math.max(1,r)),f=new te.P,m=new ee.I,p=0;p<=r;p++){for(var d=0;d<=n;d++){var v=i+d/n*a;f.x=l*Math.cos(v),f.y=l*Math.sin(v),s.push(f.x,f.y,f.z),u.push(0,0,1),m.x=(f.x/t+1)/2,m.y=(f.y/t+1)/2,c.push(m.x,m.y)}l+=h}for(var y=0;y<r;y++)for(var g=y*(n+1),b=0;b<n;b++){var A=b+g,_=A,M=A+n+1,k=A+n+2,w=A+1;o.push(_,M,w),o.push(M,k,w)}var T=R.K.renderer().getRenderEngine().createBuffer();return T.setIndexData(new Ls.T(new Uint32Array(o),1)),T.setVertexData(Ns.P.POSITION,new Ls.T(new Float32Array(s),3)),T.setVertexData(Ns.P.NORMAL,new Ls.T(new Float32Array(u),3)),T.setVertexData(Ns.P.UV,new Ls.T(new Float32Array(c),2)),T}}])}(),Us=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),null,[{key:"Create",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=(arguments.length>4&&void 0!==arguments[4]||Fs.k.Front,e/2),a=t/2,o=Math.floor(n),s=Math.floor(r),u=o+1,c=s+1,l=e/o,h=t/s,f=[],m=[],p=[],d=[],v=0;v<c;v++)for(var y=v*h-a,g=0;g<u;g++){var b=g*l-i;m.push(b,-y,0),p.push(0,0,1),d.push(g/o),d.push(1-v/s)}for(var A=0;A<s;A++)for(var _=0;_<o;_++){var M=_+u*A,k=_+u*(A+1),w=_+1+u*(A+1),T=_+1+u*A;f.push(M,k,T),f.push(k,w,T)}var x=R.K.renderer().getRenderEngine().createBuffer();return x.setIndexData(new Ls.T(new Uint32Array(f),1)),x.setVertexData(Ns.P.POSITION,new Ls.T(new Float32Array(m),3)),x.setVertexData(Ns.P.NORMAL,new Ls.T(new Float32Array(p),3)),x.setVertexData(Ns.P.UV,new Ls.T(new Float32Array(d),2)),x}}])}(),Vs=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),null,[{key:"Create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;arguments.length>4&&void 0!==arguments[4]||Fs.k.Front;t=Math.max(3,t);var i=[],a=[],o=[],s=[],u=new te.P,c=new ee.I;a.push(0,0,0),o.push(0,0,1),s.push(.5,.5);for(var l=0,h=3;l<=t;l++,h+=3){var f=n+l/t*r;u.x=e*Math.cos(f),u.y=e*Math.sin(f),a.push(u.x,u.y,u.z),o.push(0,0,1),c.x=(a[h]/e+1)/2,c.y=(a[h+1]/e+1)/2,s.push(c.x,c.y)}for(var m=1;m<=t;m++)i.push(m,m+1,0);var p=R.K.renderer().getRenderEngine().createBuffer();return p.setIndexData(new Ls.T(new Uint32Array(i),1)),p.setVertexData(Ns.P.POSITION,new Ls.T(new Float32Array(a),3)),p.setVertexData(Ns.P.NORMAL,new Ls.T(new Float32Array(o),3)),p.setVertexData(Ns.P.UV,new Ls.T(new Float32Array(s),2)),p}}])}(),zs=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),null,[{key:"Create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ft.v.White();t=Math.max(1,t);for(var r=[],i=[],a=[],o=new te.P,s=n,u=0;u<=t;u++){var c=u/t;o.x=e*c,r.push(o.x,o.y,o.z),a.push(s.r,s.g,s.b,1),i.push((r.length-1)/3)}var l=R.K.renderer().getRenderEngine().createBuffer();return l.setIndexData(new Ls.T(new Uint32Array(i),3)),l.setVertexData(Ns.P.POSITION,new Ls.T(new Float32Array(r),3)),l.setVertexData(Ns.P.COLOR,new Ls.T(new Float32Array(a),4)),l}},{key:"CreateStartEnd",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ft.v.White();n=Math.max(1,n);for(var i=e.distanceTo(t),a=t.clone().sub(e).normalize(),o=[],s=[],u=[],c=new te.P,l=r,h=0;h<=n;h++){var f=h/n;c.copy(e.clone().add(a.clone().multiplyScalar(i*f))),o.push(c.x,c.y,c.z),u.push(l.r,l.g,l.b,1),s.push((o.length-1)/3)}var m=R.K.renderer().getRenderEngine().createBuffer();return m.setIndexData(new Ls.T(new Uint32Array(s),3)),m.setVertexData(Ns.P.POSITION,new Ls.T(new Float32Array(o),3)),m.setVertexData(Ns.P.COLOR,new Ls.T(new Float32Array(u),4)),m}},{key:"CreateLines",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ft.v.White();t=Math.max(1,t);var i=[],a=[],o=[],s=new te.P,u=r,c=e.slice(0);n&&c.push(c[0]);for(var l=1;l<c.length;l++)for(var h=c[l-1],f=c[l],m=h.distanceTo(f),p=f.clone().sub(h).normalize(),d=0;d<=t;d++){var v=d/t;s.copy(h.clone().add(p.clone().multiplyScalar(m*v))),i.push(s.x,s.y,s.z),o.push(u.r,u.g,u.b,1),a.push((i.length-1)/3)}var y=R.K.renderer().getRenderEngine().createBuffer();return y.setIndexData(new Ls.T(new Uint32Array(a),3)),y.setVertexData(Ns.P.POSITION,new Ls.T(new Float32Array(i),3)),y.setVertexData(Ns.P.COLOR,new Ls.T(new Float32Array(o),4)),y}}])}(),Hs=__webpack_require__(79085),Gs=__webpack_require__(11345),qs=__webpack_require__(5074),Ws=__webpack_require__(47153),Ks=__webpack_require__(71197);function Xs(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xs=function(){return!!e})()}var Ys=function(e){function t(){var e,n,r,i,a=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,s.A)(this,t),n=this,r=t,i=["drop-area-object-collider"],r=(0,oe.A)(r),e=(0,ae.A)(n,Xs()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mGroundBody",void 0),(0,c.A)(e,"mEdgeBodies",[]),(0,c.A)(e,"mEdgesGroup",void 0),(0,c.A)(e,"mEdgeSceneObjects",[]),(0,c.A)(e,"mBodyType",Ks.k.Kinematic),(0,c.A)(e,"mMass",0),(0,c.A)(e,"mCollisionEdgedEnabled",!1),(0,c.A)(e,"mDebug",!1),(0,c.A)(e,"mGroundHelper",void 0),(0,c.A)(e,"mEdgeHelpers",[]),(0,c.A)(e,"mSubscriptionBrokers",[]),(0,c.A)(e,"PlaneThickness",.01),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"mScaleX",1),(0,c.A)(e,"mScaleY",1),e.mCollisionEdgedEnabled=a,e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this,t=this.getParentObject(),n=R.K.physicsSystem().getWorld(),r=new te.P(Qs.PlaneWidth,Qs.PlaneHeight,this.PlaneThickness);this.mGroundBody=n.createBody(n.createBox(r),this.mBodyType),this.mGroundBody.setMass(this.mMass),R.K.physicsSystem().registerMesh(t,this.mGroundBody),this.mDebug=R.K.physicsSystem().showHelpers(),this.mCollisionEdgedEnabled?this.createEdges():this.updateProperties(),this.mDebug&&this.createHelpers(),this.mSubscriptionBrokers.push(R.K.eventBus().subscribe(qs.E.getTopicName(Ws.o.PhysicsCollider),(function(t){e.mDebug=t.isVisible(),e.mDebug?e.createHelpers():e.destroyHelpers()}))),this.registerMessageHandler(m.Xf.TypeRTTI,(function(){e.OnDetached()})),this.registerMessageHandler(m.VC.TypeRTTI,this.onSceneUpdate.bind(this)),this.mSubscriptions.push(t.transform.scale.onChange.subscribe((function(){(0,_.G4)(e.mScaleX,t.transform.scale.x)&&(0,_.G4)(e.mScaleY,t.transform.scale.y)||(e.mScaleX=t.transform.scale.x,e.mScaleY=t.transform.scale.y,e.updateProperties())})))}},{key:"OnDetached",value:function(){this.mSubscriptionBrokers.splice(0).forEach((function(e){return e.unsubscribe()})),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.unregisterMessageHandler(m.VC.TypeRTTI),this.unregisterMessageHandler(m.Xf.TypeRTTI),this.destroyHelpers();var e=this.getParentObject();R.K.physicsSystem().unregisterMesh(e.getSceneObjectId()),this.mGroundBody&&delete this.mGroundBody,this.destroyEdges()}},{key:"isAttachable",value:function(e){return e.isTypeOf(Qs.TypeRTTI)}},{key:"onSceneUpdate",value:function(e){this.mCollisionEdgedEnabled&&this.mEdgesGroup&&this.mEdgesGroup.update(e)}},{key:"createEdges",value:function(){var e=this,t=this.getParentObject();this.mEdgesGroup=new Bs,this.mEdgesGroup.name="drop-area-edges-group",this.mEdgesGroup.setParent(t),["left-edge","right-edge","back-edge","front-edge"].forEach((function(t){return e.createEdge(t,e.mEdgesGroup)})),this.updateProperties(),this.mEdgeSceneObjects.forEach((function(t,n){var r=e.mEdgeBodies[n];R.K.physicsSystem().registerMesh(t,r)})),this.mDebug&&this.createHelpers()}},{key:"destroyEdges",value:function(){this.mEdgeSceneObjects.splice(0).forEach((function(e){R.K.physicsSystem().unregisterMesh(e.getSceneObjectId())})),this.mEdgeBodies.splice(0).forEach((function(e){e.dispose()})),this.mEdgesGroup&&(this.mEdgesGroup.destroy(),delete this.mEdgesGroup),this.destroyHelpers(!0)}},{key:"createEdge",value:function(e,t){var n=R.K.physicsSystem().getWorld(),r=n.createBody(n.createBox(te.P.One()),this.mBodyType);r.setMass(this.mMass),r.setIgnoreSync(!0),this.mEdgeBodies.push(r);var i=new Bs;i.name=e,i.setParent(t),R.K.sceneManager().addNode(i,t,!1),this.mEdgeSceneObjects.push(i)}},{key:"updateProperties",value:function(){var e=this.getParentObject(),t=Qs.PlaneWidth*e.transform.scale.x,n=Qs.PlaneHeight*e.transform.scale.y,r=.5,i=this.mGroundBody.getShape();if(i.setWidth(t),i.setHeight(n),i.setDepth(this.PlaneThickness),this.mGroundHelper&&this.mGroundHelper.updateChanges(),this.mCollisionEdgedEnabled){var a=this.mEdgeBodies[0].getShape();a.setWidth(this.PlaneThickness),a.setHeight(n),a.setDepth(r),this.mEdgeSceneObjects[0].transform.position.set(-.5*Qs.PlaneWidth,0,.25);var o=this.mEdgeBodies[1].getShape();o.setWidth(this.PlaneThickness),o.setHeight(n),o.setDepth(r),this.mEdgeSceneObjects[1].transform.position.set(.5*Qs.PlaneWidth,0,.25);var s=this.mEdgeBodies[2].getShape();s.setWidth(t),s.setHeight(this.PlaneThickness),s.setDepth(r),this.mEdgeSceneObjects[2].transform.position.set(0,.5*Qs.PlaneHeight,.25);var u=this.mEdgeBodies[3].getShape();u.setWidth(t),u.setHeight(this.PlaneThickness),u.setDepth(r),this.mEdgeSceneObjects[3].transform.position.set(0,-.5*Qs.PlaneHeight,.25),this.mEdgeHelpers.forEach((function(e){e.updateChanges()}))}}},{key:"createHelpers",value:function(){var e=this;this.mGroundHelper||(this.mGroundHelper=new Gs.F(this.mGroundBody),R.K.sceneManager().addNode(this.mGroundHelper,void 0,!1)),this.mCollisionEdgedEnabled&&0===this.mEdgeHelpers.length&&this.mEdgeBodies.forEach((function(t){var n=new Gs.F(t);e.mEdgeHelpers.push(n),R.K.sceneManager().addNode(n,void 0,!1)}))}},{key:"destroyHelpers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.mGroundHelper&&!e&&(R.K.sceneManager().removeNode(this.mGroundHelper),this.mGroundHelper.destroy(),delete this.mGroundHelper),this.mEdgeHelpers.splice(0).forEach((function(e){R.K.sceneManager().removeNode(e),e.destroy(!0)}))}},{key:"getCollisionEdgesEnabled",value:function(){return this.mCollisionEdgedEnabled}},{key:"setCollisionEdgesEnabled",value:function(e){this.mCollisionEdgedEnabled!==e&&(this.mCollisionEdgedEnabled=e,this.mCollisionEdgedEnabled?this.createEdges():this.destroyEdges())}},{key:"parse",value:function(e){var t=this;if(e)return this.mBodyType="number"==typeof e.body_type&&e.body_type in Ks.k?e.body_type:Ks.k.Kinematic,this.mMass="number"==typeof e.mass?e.mass:0,e.properties&&(this.mCollisionEdgedEnabled="boolean"==typeof e.properties.collision_edges_enabled&&e.properties.collision_edges_enabled),this.mGroundBody&&(this.mGroundBody.setBodyType(this.mBodyType),this.mGroundBody.setMass(this.mMass),this.mEdgeBodies.forEach((function(e){e.setBodyType(t.mBodyType),e.setMass(t.mMass)})),this.updateProperties()),!0}},{key:"serialize",value:function(){return{type:"drop-area",body_type:this.mBodyType,mass:this.mMass,properties:{collision_edges_enabled:this.mCollisionEdgedEnabled}}}}])}(he.$);function $s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($s=function(){return!!e})()}function Zs(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Ys,"TypeRTTI",new le.O("DropAreaColliderComponent",he.$.TypeRTTI));var Qs=function(e){function t(e,n,r){var i,a,o,u;if((0,s.A)(this,t),a=this,o=t,u=[e,Us.Create(t.PlaneWidth,t.PlaneHeight,1,1,Fs.k.Double),n,r],o=(0,oe.A)(o),i=(0,ae.A)(a,$s()?Reflect.construct(o,u||[],(0,oe.A)(a).constructor):o.apply(a,u)),(0,c.A)(i,"mCellWidth",1),(0,c.A)(i,"mCellHeight",1),(0,c.A)(i,"renderTechnique",Ot._1.grid_area),i.mName="DropAreaEntity",i.mPickable=!0,i.mCastShadow=!1,void 0===n){var l=R.K.renderer().getRenderEngine().createMaterialPBR("drop_area_material");l.setDiffuseColor(new Ft.v(15987699)),l.setTransparent(!0),l.setOpacity(0),l.setSpecularIntensity(0),l.setSpecularColor(Ft.v.Black()),l.setEnvironmentIntensity(0),l.setEmissiveIntensity(0),l.setSide(Fs.k.Double),i.setMaterial(l)}return i}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"cell_width":return this.mCellWidth=parseFloat(n),!0;case"cell_height":return this.mCellHeight=parseFloat(n),!0}return Zs(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Zs(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"cell_width":return this.mCellWidth;case"cell_height":return this.mCellHeight;case"cell_size":return this.getCellSize()}return null}},{key:"getCellSize",value:function(){return{width:this.mCellWidth,height:this.mCellHeight}}},{key:"serialize",value:function(e){var n=Object.assign(Zs(t,"serialize",this,3)([e]),{type:"drop_area"});n.properties=Object.assign(n.properties,{cell_width:this.mCellWidth,cell_height:this.mCellHeight});var r=this.getComponents(Ys.TypeRTTI),i=(0,o.A)(r,1)[0];return i&&(n.properties.collider=i.serialize()),n}},{key:"cellWidth",get:function(){return this.mCellWidth},set:function(e){this.mCellWidth=e,this.markNeedsRenderUpdate()}},{key:"cellHeight",get:function(){return this.mCellHeight},set:function(e){this.mCellHeight=e,this.markNeedsRenderUpdate()}}])}(Ds.F);(0,c.A)(Qs,"TypeRTTI",new le.O("DropAreaEntity",Ds.F.TypeRTTI)),(0,c.A)(Qs,"PlaneWidth",2),(0,c.A)(Qs,"PlaneHeight",2);var Js=__webpack_require__(12553),eu=__webpack_require__(73050);function tu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tu=function(){return!!e})()}var nu=function(e){function t(e,n,r,i,a,o,u){var l,h,f,m;return(0,s.A)(this,t),h=this,f=t,m=[e,n,r,u],f=(0,oe.A)(f),l=(0,ae.A)(h,tu()?Reflect.construct(f,m||[],(0,oe.A)(h).constructor):f.apply(h,m)),(0,c.A)(l,"mNodes",void 0),(0,c.A)(l,"mOffsetNodesGroups",[]),l.mName="MeshBatchEntity",a&&l.setNodes(a),i&&(l.mOffsetNodesGroups=i),o&&l.setSyncHash(o),l}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"setNodes",value:function(e){this.mNodes=e}},{key:"getNodes",value:function(){return this.mNodes}},{key:"getOffsetGroups",value:function(){return this.mOffsetNodesGroups}}])}(Ds.F);(0,c.A)(nu,"TypeRTTI",new le.O("MeshBatchEntity",Ds.F.TypeRTTI));var ru=__webpack_require__(77972),iu=__webpack_require__(60865);function au(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(au=function(){return!!e})()}var ou=function(e){function t(e,n,r){var i,a,o,u;return(0,s.A)(this,t),a=this,o=t,u=[e,n,r],o=(0,oe.A)(o),i=(0,ae.A)(a,au()?Reflect.construct(o,u||[],(0,oe.A)(a).constructor):o.apply(a,u)),(0,c.A)(i,"renderTechnique",Ot._1.mesh_line),i.mName="MeshLineEntity",i.drawMode=Ds.O.LINE_STRIP,i}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(Ds.F);(0,c.A)(ou,"TypeRTTI",new le.O("MeshLineEntity",iu.a.TypeRTTI));var su=__webpack_require__(70192);function uu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(uu=function(){return!!e})()}var cu,lu,hu,fu,mu=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["draggable-component"],r=(0,oe.A)(r),e=(0,ae.A)(n,uu()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSceneObject",void 0),(0,c.A)(e,"mColliderComponent",void 0),(0,c.A)(e,"mNextPosition",new te.P),(0,c.A)(e,"mNextQuaternion",new ne.P),(0,c.A)(e,"mBrokerSubscriptions",[]),(0,c.A)(e,"mObjectMovementSpeed",100),(0,c.A)(e,"mPlanePoint",new te.P(0,0,0)),(0,c.A)(e,"mPlaneNormal",te.P.Up()),(0,c.A)(e,"mPlaneNormalOld",te.P.Up()),(0,c.A)(e,"mPlaneNormalChanged",!1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this.getParentObject();this.mSceneObject=e,this.mNextPosition.copy(this.mSceneObject.transform.position),this.mNextQuaternion.copy(this.mSceneObject.transform.quaternion);var t=e.getComponents(su.f.TypeRTTI),n=(0,o.A)(t,1);this.mColliderComponent=n[0],this.registerMessageHandler(m.VC.TypeRTTI,this.update.bind(this))}},{key:"update",value:function(){if(this.mColliderComponent){var e=this.mNextPosition.distanceTo(this.mSceneObject.transform.position),t=this.mNextPosition.clone().sub(this.mSceneObject.transform.position).normalize().clone().multiplyScalar(e*this.mObjectMovementSpeed);if(this.mColliderComponent.getBody().setLinearVelocity(t),this.mPlaneNormalChanged){var n=(new ne.P).setFromUnitVectors(this.mPlaneNormalOld,this.mPlaneNormal);this.mSceneObject.transform.quaternion.premultiply(n),this.mSceneObject.transform.position.copy(this.mPlanePoint),this.mColliderComponent.getBody().setLinearVelocity(new te.P(0,0,0)),this.mColliderComponent.getBody().setAngularVelocity(ne.P.identity()),this.mPlaneNormalChanged=!1}}}},{key:"OnDetached",value:function(){this.unregisterMessageHandler(m.VC.TypeRTTI),this.mBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"isAttachable",value:function(e){return e.isTypeOf(Js._.TypeRTTI)||e.isTypeOf(kt.i.TypeRTTI)||e.isTypeOf(Na.t.TypeRTTI)}},{key:"setNextPosition",value:function(e){this.mNextPosition.equals(e)||this.mNextPosition.copy(e)}},{key:"setNextQuaternion",value:function(e){this.mNextQuaternion.equals(e)||this.mNextQuaternion.copy(e)}},{key:"setPlaneNormal",value:function(e){(0,_.G4)(this.mPlaneNormal.x,e.x)&&(0,_.G4)(this.mPlaneNormal.y,e.y)&&(0,_.G4)(this.mPlaneNormal.z,e.z)||(this.mPlaneNormalOld.copy(this.mPlaneNormal),this.mPlaneNormal.copy(e),this.mPlaneNormalChanged=!0)}},{key:"setPlanePoint",value:function(e){this.mPlanePoint.equals(e)||this.mPlanePoint.copy(e)}}])}(he.$);function pu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pu=function(){return!!e})()}(0,c.A)(mu,"TypeRTTI",new le.O("DraggableComponent",he.$.TypeRTTI)),(lu=cu||(cu={}))[lu.X=1]="X",lu[lu.Y=2]="Y",lu[lu.Z=4]="Z",(fu=hu||(hu={}))[fu.POSITIVE=0]="POSITIVE",fu[fu.NEGATIVE=1]="NEGATIVE";var du,vu,yu=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["transform-controls"],r=(0,oe.A)(r),e=(0,ae.A)(n,pu()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"mEventBrokerSubscriptions",[]),(0,c.A)(e,"enabled",!0),(0,c.A)(e,"rotationEnabled",!1),(0,c.A)(e,"panEnabled",!1),(0,c.A)(e,"isRotating",!1),(0,c.A)(e,"isPanning",!1),(0,c.A)(e,"visible",!1),(0,c.A)(e,"arrowsVisible",!1),(0,c.A)(e,"rotationAxisEnabled",cu.X|cu.Y|cu.Z),(0,c.A)(e,"object",void 0),(0,c.A)(e,"protractorTexture",void 0),(0,c.A)(e,"gizmoArrowTextures",void 0),(0,c.A)(e,"domElement",void 0),(0,c.A)(e,"rotationAxis",void 0),(0,c.A)(e,"rotationAxisSide",void 0),(0,c.A)(e,"originalRotation",void 0),(0,c.A)(e,"previousRotation",void 0),(0,c.A)(e,"previousUVCoord",void 0),(0,c.A)(e,"rotationOffset",0),(0,c.A)(e,"protractorGroup",void 0),(0,c.A)(e,"protractorMeshMaterial",void 0),(0,c.A)(e,"protractorMesh",void 0),(0,c.A)(e,"rotationRingMesh",void 0),(0,c.A)(e,"rotationLine",void 0),(0,c.A)(e,"rotationRaycastPlane",void 0),(0,c.A)(e,"panningRaycastPlanes",[]),(0,c.A)(e,"dragging",!1),(0,c.A)(e,"mousedown",!1),(0,c.A)(e,"arrowAxisXMesh",[]),(0,c.A)(e,"arrowAxisYMesh",[]),(0,c.A)(e,"arrowAxisZMesh",[]),(0,c.A)(e,"boundingBoxObject",void 0),(0,c.A)(e,"boundingRect",void 0),(0,c.A)(e,"UnitX",te.P.AxisX()),(0,c.A)(e,"UnitY",te.P.AxisY()),(0,c.A)(e,"UnitZ",te.P.AxisZ()),(0,c.A)(e,"sizeArrows",{scale:.5,min:.1,max:40}),(0,c.A)(e,"sizeProtractor",{scale:.5,min:.1,max:30}),(0,c.A)(e,"ringThickness",.045),(0,c.A)(e,"protractorRadius",.3),(0,c.A)(e,"objectUpDirectionBasedOnAxis",void 0),(0,c.A)(e,"rotationText",void 0),(0,c.A)(e,"mResourceHandles",void 0),(0,c.A)(e,"mImageLoader",void 0),(0,c.A)(e,"mArrowXMaterialhandle",void 0),(0,c.A)(e,"mArrowYMaterialhandle",void 0),(0,c.A)(e,"mArrowZMaterialhandle",void 0),(0,c.A)(e,"mUsePhysicsCollider",!1),(0,c.A)(e,"mObjectSelectedSubject",new M.B),(0,c.A)(e,"mNextObjectPosition",new te.P),(0,c.A)(e,"mNextObjectQuaternion",new ne.P),(0,c.A)(e,"mNextObjectPlaneNormal",te.P.Up()),(0,c.A)(e,"mNextObjectPlanePoint",te.P.Zero()),(0,c.A)(e,"mCameraToObjectDistance",-1),e.previousUVCoord=new ee.I,e.boundingBoxObject=new Os.N,e.boundingRect=new Is.I,e.mResourceHandles=[],e.gizmoArrowTextures=[],e.objectUpDirectionBasedOnAxis=te.P.Up(),e.mImageLoader=new ru.$,e.mImageLoader.setCrossOrigin("anonymous"),e.protractorGroup=new Bs,e.protractorGroup.name="transform-controls-protractor-group",e.protractorGroup.layers.enable(5),e.protractorGroup.layers.enable(8),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:(p=(0,n.A)(i().mark((function e(){var t,r,a,o,s,u,c,l,h,f,p,d=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.domElement=R.K.renderer().getRenderEngine().getCanvas(),t=en.J.getManager(en.n.MaterialManager),Promise.all([this.loadTexture("".concat(et.w.assetsUrl,"system/floorplanner/gizmo-arrow-x-2x.png"),"gizmo-arrow-x-texture"),this.loadTexture("".concat(et.w.assetsUrl,"system/floorplanner/gizmo-arrow-y-2x.png"),"gizmo-arrow-y-texture"),this.loadTexture("".concat(et.w.assetsUrl,"system/floorplanner/gizmo-arrow-z-2x.png"),"gizmo-arrow-z-texture")]).then(function(){var e=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.forEach((function(e){e.setRepeat(ee.I.One()),e.markDirty()})),d.gizmoArrowTextures.push(t[0]),d.gizmoArrowTextures.push(t[1]),d.gizmoArrowTextures.push(t[2]),e.next=6,d.createGizmoArrows();case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){v.UX.error("TransformControls: Unable to load gizmo arrow textures.",e)})),this.loadTexture("".concat(et.w.assetsUrl,"system/floorplanner/protractor-texture.png"),"protractor-texture").then(function(){var e=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:d.protractorTexture=t,d.protractorTexture.setRepeat(ee.I.One()),d.protractorTexture.markDirty(),d.protractorMeshMaterial.setDiffuseMap(d.protractorTexture),d.protractorMeshMaterial.markDirty();case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),(function(e){v.UX.error("TransformControls: Unable to load protractor texture.",e)})),this.object=void 0,this.rotationAxis=void 0,this.rotationAxisSide=void 0,this.previousRotation=0,this.originalRotation=0,(r=R.K.renderer().getRenderEngine().createMaterialBasic("rotation-ring-material")).setDiffuseColor(Ft.v.Blue()),r.setSide(Fs.k.Double),r.setTransparent(!0),r.setDepthTest(!1),r.setDepthWrite(!1),a=t.makeResourceRaw(r),e.t0=Ds.F,e.t1=void 0,e.t2=js.Create(2.6,3.1,64,1,(0,_.pu)(0),(0,_.pu)(1)),e.next=21,t.resolveResource(a);case 21:return e.t3=e.sent,this.rotationRingMesh=new e.t0(e.t1,e.t2,e.t3),this.rotationRingMesh.name="transform-controls-rotation-ring",this.rotationRingMesh.visible=!1,this.rotationRingMesh.pickable=!1,this.rotationRingMesh.castShadow=!1,this.rotationRingMesh.receiveShadow=!1,this.rotationRingMesh.renderOrder=3,this.rotationRingMesh.layers.enable(5),this.rotationRingMesh.layers.enable(8),(o=R.K.renderer().getRenderEngine().createMaterialLine("line-material")).setDiffuseColor(Ft.v.Blue()),o.setSide(Fs.k.Double),o.setTransparent(!0),o.setDepthTest(!1),o.setDepthWrite(!1),s=t.makeResourceRaw(o),e.t4=ou,e.t5=void 0,e.t6=zs.Create(.5,1,Ft.v.Blue()),e.next=43,t.resolveResource(s);case 43:return e.t7=e.sent,this.rotationLine=new e.t4(e.t5,e.t6,e.t7),this.rotationLine.name="transform-controls-rotation-line",this.rotationLine.visible=!1,this.rotationLine.pickable=!1,this.rotationLine.castShadow=!1,this.rotationLine.receiveShadow=!1,this.rotationLine.renderOrder=3,this.rotationLine.layers.enable(5),this.rotationLine.layers.enable(8),(u=R.K.renderer().getRenderEngine().createMaterialBasic("rotation-raycast-plane-material")).setDiffuseColor(Ft.v.Yellow()),u.setOpacity(0),u.setTransparent(!0),u.setSide(Fs.k.Double),c=t.makeResourceRaw(u),e.t8=Ds.F,e.t9=void 0,e.t10=Us.Create(1e4,1e4,1,1),e.next=64,t.resolveResource(c);case 64:return e.t11=e.sent,this.rotationRaycastPlane=new e.t8(e.t9,e.t10,e.t11),this.rotationRaycastPlane.name="transform-controls-rotation-raycast-plane",this.rotationRaycastPlane.visible=!0,this.rotationRaycastPlane.pickable=!0,this.rotationRaycastPlane.castShadow=!1,this.rotationRaycastPlane.receiveShadow=!1,this.rotationRaycastPlane.renderOrder=999999,this.rotationRaycastPlane.layers.enable(4),this.rotationRaycastPlane.layers.enable(5),this.rotationRaycastPlane.layers.enable(8),(l=R.K.renderer().getRenderEngine().createMaterialBasic("protractor-mesh-material")).setDiffuseColor(Ft.v.White()),l.setTransparent(!0),l.useAlphaFromDiffuseMap(!0),l.setDepthTest(!1),l.setDepthWrite(!1),l.setSide(Fs.k.Double),l.markDirty(),h=t.makeResourceRaw(l),e.next=86,t.resolveResource(h);case 86:this.protractorMeshMaterial=e.sent,this.protractorMesh=new Ds.F(void 0,Vs.Create(this.protractorRadius,64),this.protractorMeshMaterial),this.protractorMesh.name="transform-controls-protractor-mesh",this.protractorMesh.visible=!0,this.protractorMesh.pickable=!1,this.protractorMesh.castShadow=!1,this.protractorMesh.receiveShadow=!1,this.protractorMesh.renderOrder=3,this.protractorMesh.layers.enable(5),this.protractorMesh.layers.enable(8),this.protractorMesh.transform.position.set(0,.001,0),this.protractorMesh.transform.quaternion.setFromAxisAngle(te.P.AxisX(),(0,_.pu)(-90)),R.K.sceneManager().addNode(this.protractorMesh,this.protractorGroup,!1),(f=document.createElement("div")).style.position="absolute",f.style.display="none",f.style.top="0px",f.style.left="0px",f.style.width="auto",f.style.height="auto",f.style.padding="15px 5px 14px 5px",f.style.margin="0px",f.style.font="normal 16px Arial",f.style.textAlign="center",f.style.lineHeight="0",f.style.color="rgba(0,0,0,1)",f.style.backgroundColor="rgba(255,255,255,1)",f.style.border="1px solid rgba(0,0,0,1)",f.style.borderRadius="3px",f.style.whiteSpace="nowrap",f.style.boxSizing="border-box",f.style.zIndex="5",f.style.pointerEvents="none",f.innerHTML="".concat(0,"&#176;"),this.rotationText=f,document.body.appendChild(f),p=R.K.sceneManager().getScene(),R.K.sceneManager().addNode(this.rotationRaycastPlane,p,!1),R.K.sceneManager().addNode(this.protractorGroup,p,!1),R.K.sceneManager().addNode(this.rotationRingMesh,p,!1),R.K.sceneManager().addNode(this.rotationLine,p,!1),this.enablePanning(),this.setRotationVisibility(!1),this.initialize(),this.mEventBrokerSubscriptions.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ObjectSelected),(function(e){d.mObjectSelectedSubject.next(e)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.NodeAdded),this.objectAddedHandler.bind(this)),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.NodeRemoved),this.objectRemovedHandler.bind(this)),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.NodeChanged),this.objectAddedHandler.bind(this))),this.mObjectSelectedSubject.pipe(Cs(50)).subscribe(function(){var e=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:d.objectSelectedHandler(t).then((function(){}),(function(e){v.UX.error(e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.registerMessageHandler(m.W2.TypeRTTI,(function(){d.update()}));case 133:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"OnDetached",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mObjectSelectedSubject.unsubscribe(),this.dispose()}},{key:"objectAddedHandler",value:function(e){var t=e.getData();if(t){var n=this.resolveDroppableComponent(t);if(n){var r=n.getParentObject(),i=r.isDerivedTypeOf(Qs.TypeRTTI)?r:t;this.addPanningRaycastPlane(i)}}}},{key:"objectRemovedHandler",value:function(e){var t=e.getData();t&&(this.resolveDroppableComponent(t)&&this.removePanningRaycastPlane(t))}},{key:"resolveDroppableComponent",value:function(e){if(e&&e instanceof Hs.i)return e.getComponent("droppable-handler")}},{key:"objectSelectedHandler",value:(f=(0,n.A)(i().mark((function e(t){var n,r,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.detach(),n=t.getData(),r=n?n.selection:void 0){e.next=5;break}return e.abrupt("return");case 5:if(!(r instanceof Na.t)){e.next=10;break}return e.next=8,this.attach(r);case 8:e.next=20;break;case 10:if(r instanceof kt.i?a=r:r instanceof ce.S&&(a=r.findParentOfType(kt.i.TypeRTTI)),!a){e.next=20;break}if(!((o=a.getParent())&&o instanceof Na.t)){e.next=18;break}return e.next=16,this.attach(o);case 16:e.next=20;break;case 18:return e.next=20,this.attach(a);case 20:R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame));case 21:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"attach",value:(h=(0,n.A)(i().mark((function e(t){var n,r,s,u,c,l,h=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t||R.K.sceneManager().getScene().getSceneObjectId()!==t.getSceneObjectId()||R.K.sceneManager().getRootProductNode().getSceneObjectId()!==t.getSceneObjectId()){e.next=2;break}return e.abrupt("return");case 2:if(!this.object||!t||this.object.getSceneObjectId()!==t.getSceneObjectId()){e.next=4;break}return e.abrupt("return");case 4:return this.object&&this.detach(),this.object=t,this.updateBoundingBox(),e.next=9,this.createGizmoArrows();case 9:n=new te.P,r=new ne.P,this.object.transform.getWorldPosition(n),this.object.transform.getWorldQuaternion(r),[].concat((0,a.A)(this.arrowAxisXMesh),(0,a.A)(this.arrowAxisYMesh),(0,a.A)(this.arrowAxisZMesh)).forEach((function(e){R.K.sceneManager().addNode(e,h.object,!1)})),this.repositionGizmoArrows(),this.rotationLine.transform.position.copy(n),this.rotationLine.transform.quaternion.copy(r),this.rotationRingMesh.transform.position.copy(n),this.rotationRingMesh.transform.quaternion.copy(r),this.rotationRaycastPlane.transform.position.copy(n),this.rotationRaycastPlane.transform.quaternion.copy(r),this.setRotationVisibility(!1,this.rotationEnabled),this.mNextObjectPosition.copy(this.object.transform.position),this.mNextObjectQuaternion.copy(this.object.transform.quaternion),this.mNextObjectPlaneNormal.copy(this.object.up),this.mNextObjectPlanePoint.copy(this.object.transform.position),s=this.object.getComponents(su.f.TypeRTTI),u=(0,o.A)(s,1),c=u[0],this.mUsePhysicsCollider=!!c,c&&(l=new mu,this.object.addComponent(l),c.getBody().setBodyType(Ks.k.Dynamic),c.getBody().setMass(1),c.getBody().setLinearVelocity(te.P.Zero()),c.getBody().setAngularVelocity(ne.P.identity()),l.setNextPosition(this.mNextObjectPosition),l.setNextQuaternion(this.mNextObjectQuaternion),l.setPlaneNormal(this.mNextObjectPlaneNormal),l.setPlanePoint(this.mNextObjectPlanePoint)),this.update(),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame));case 31:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"detach",value:function(){if(this.hasObject()){this.arrowAxisXMesh.forEach((function(e){R.K.sceneManager().removeNode(e,!1,!1,!1,!1)})),this.arrowAxisYMesh.forEach((function(e){R.K.sceneManager().removeNode(e,!1,!1,!1,!1)})),this.arrowAxisZMesh.forEach((function(e){R.K.sceneManager().removeNode(e,!1,!1,!1,!1)})),this.object.removeComponents(mu.TypeRTTI);var e=this.object.getComponents(su.f.TypeRTTI),t=(0,o.A)(e,1)[0];t&&(t.getBody().setBodyType(Ks.k.Kinematic),t.getBody().setMass(0),t.getBody().setLinearVelocity(te.P.Zero()),t.getBody().setAngularVelocity(ne.P.identity()))}delete this.object,this.setRotationVisibility(!1),this.rotationAxis=void 0,this.rotationAxisSide=void 0,this.isRotating=!1,this.rotationRingMesh.visible=!1,this.rotationLine.visible=!1,this.mUsePhysicsCollider=!1}},{key:"update",value:function(){if(this.object&&this.enabled&&this.rotationEnabled){var e=R.K.sceneManager().getActiveCamera(),t=new te.P,n=new ne.P,r=new te.P;this.object.transform.getWorldPosition(t),this.object.transform.getWorldQuaternion(n),this.boundingBoxObject.getCenter(r),r.applyQuaternion(n);var i=t.clone().add(r),a=i.clone().sub(e.transform.position).normalize();if(this.arrowAxisXMesh.length>0&&this.arrowsVisible&&(this.rotationAxisEnabled&cu.X)===cu.X)for(var s=0,u=-1/0,c=new te.P,l=0;l<this.arrowAxisXMesh.length;l++){this.arrowAxisXMesh[l].visible=!1,this.arrowAxisXMesh[l].transform.getWorldPosition(c);var h=i.clone().sub(c).normalize(),f=a.dot(h);if(f>u&&(s=l,u=f),3===l||7===l){var m=new te.P;this.arrowAxisXMesh[s].transform.getWorldDirection(m),this.arrowAxisXMesh[s].visible=a.dot(m)<0,u=-1/0}}if(this.arrowAxisYMesh.length>0&&this.arrowsVisible&&(this.rotationAxisEnabled&cu.Y)===cu.Y)for(var p=0,d=-1/0,v=new te.P,y=0;y<this.arrowAxisYMesh.length;y++){this.arrowAxisYMesh[y].visible=!1,this.arrowAxisYMesh[y].transform.getWorldPosition(v);var g=i.clone().sub(v).normalize(),b=a.dot(g);if(b>d&&(p=y,d=b),3===y||7===y){var A=new te.P;this.arrowAxisYMesh[p].transform.getWorldDirection(A),this.arrowAxisYMesh[p].visible=a.dot(A)<0,d=-1/0}}if(this.arrowAxisZMesh.length>0&&this.arrowsVisible&&(this.rotationAxisEnabled&cu.Z)===cu.Z)for(var M=0,k=-1/0,w=new te.P,T=0;T<this.arrowAxisZMesh.length;T++){this.arrowAxisZMesh[T].visible=!1,this.arrowAxisZMesh[T].transform.getWorldPosition(w);var x=i.clone().sub(w).normalize(),S=a.dot(x);if(S>k&&(M=T,k=S),3===T||7===T){var C=new te.P;this.arrowAxisZMesh[M].transform.getWorldDirection(C),this.arrowAxisZMesh[M].visible=a.dot(C)<0,k=-1/0}}var E=t.distanceTo(e.transform.position);if(E!==this.mCameraToObjectDistance){this.mCameraToObjectDistance=E;var I=(0,_.qE)(E*this.sizeProtractor.scale,this.sizeProtractor.min,this.sizeProtractor.max);this.protractorGroup.transform.scale.set(I,I,I),this.arrowsVisible&&this.repositionGizmoArrows()}if(this.mUsePhysicsCollider){var O=this.object.getComponents(mu.TypeRTTI),D=(0,o.A)(O,1)[0];D&&(D.setNextPosition(this.mNextObjectPosition),D.setNextQuaternion(this.mNextObjectQuaternion),D.setPlaneNormal(this.mNextObjectPlaneNormal),D.setPlanePoint(this.mNextObjectPlanePoint))}}}},{key:"EnableRotationAxis",value:function(e){this.rotationAxisEnabled|=e,this.setRotationVisibility(!1,!0)}},{key:"DisableRotationAxis",value:function(e){this.rotationAxisEnabled&=~e,this.setRotationVisibility(!1,!0)}},{key:"toggleRotationAxis",value:function(e){this.rotationAxisEnabled^=e,this.setRotationVisibility(!1,!0)}},{key:"isRotationAxisEnabled",value:function(e){return(this.rotationAxisEnabled&e)===e}},{key:"enablePanning",value:function(){this.panEnabled=!0}},{key:"disablePanning",value:function(){this.panEnabled=!1}},{key:"isPanningEnabled",value:function(){return this.panEnabled}},{key:"EnableRotation",value:function(){this.rotationEnabled=!0,this.setRotationVisibility(!1,!0)}},{key:"DisableRotation",value:function(){this.rotationEnabled=!1,this.setRotationVisibility(!1,!1)}},{key:"isRotationEnabled",value:function(){return this.rotationEnabled}},{key:"initialize",value:function(){var e=this;try{if(document.body.contains(this.domElement)){var t=this.domElement.getBoundingClientRect();this.boundingRect.set(t.left,t.top,t.width,t.height)}}catch(e){v.UX.error(e)}this.registerMessageHandler(m.jb.TypeRTTI,(function(t){e.onWindowResize(t.width,t.height)})),this.registerMessageHandler(m.lF.TypeRTTI,(function(t){switch(t.name){case"up":e.onBeforeMouseUp(t.event);break;case"down":e.onBeforeMouseDown(t.event);break;case"move":e.onBeforeMouseMove(t.event)}}))}},{key:"dispose",value:function(){this.object&&this.detach(),this.arrowAxisXMesh.splice(0).forEach((function(e){e.unsetMaterial(),e.destroy(!0)})),this.arrowAxisYMesh.splice(0).forEach((function(e){e.unsetMaterial(),e.destroy(!0)})),this.arrowAxisZMesh.splice(0).forEach((function(e){e.unsetMaterial(),e.destroy(!0)}));var e=en.J.getManager(en.n.MaterialManager);e.disposeResource(this.mArrowXMaterialhandle,!0),e.disposeResource(this.mArrowYMaterialhandle,!0),e.disposeResource(this.mArrowZMaterialhandle,!0),delete this.mArrowXMaterialhandle,delete this.mArrowYMaterialhandle,delete this.mArrowZMaterialhandle;var t=en.J.getManager(en.n.TextureManager);this.protractorTexture&&(t.disposeTexture(this.protractorTexture,void 0,!0),delete this.protractorTexture),this.gizmoArrowTextures.splice(0).forEach((function(e){t.disposeTexture(e,void 0,!0)})),R.K.sceneManager().removeNode(this.protractorGroup,!1,!0),this.protractorGroup.destroy(!0),delete this.protractorGroup,this.protractorMesh.destroy(!0),delete this.protractorMesh,R.K.sceneManager().removeNode(this.rotationRingMesh,!1,!0),this.rotationRingMesh.destroy(!0),delete this.rotationRingMesh,R.K.sceneManager().removeNode(this.rotationLine,!1,!0),this.rotationLine.destroy(!0),R.K.sceneManager().removeNode(this.rotationRaycastPlane,!1,!0),this.rotationRaycastPlane.destroy(!0),delete this.rotationRaycastPlane,this.object=void 0,this.unregisterMessageHandler(m.jb.TypeRTTI),this.unregisterMessageHandler(m.lF.TypeRTTI)}},{key:"addPanningRaycastPlane",value:function(e){this.panningRaycastPlanes.findIndex((function(t){return t.id===e.id}))<0&&this.panningRaycastPlanes.push(e)}},{key:"removePanningRaycastPlane",value:function(e){var t=this.panningRaycastPlanes.findIndex((function(t){return t.id===e.id}));t>=0&&this.panningRaycastPlanes.splice(t,1)}},{key:"updateBoundingBox",value:function(){var e=new te.P,t=new Os.N;this.object.updateMatrixWorld(),this.object.transform.getWorldScale(e);var n=this.object.getChildrenDerivedTypeOf(Js._.TypeRTTI);if(n.length>0){var r=(0,o.A)(n,1)[0];t.copy(r.boundingBox)}var i=(new ie.k).makeScale(e.x,e.y,e.z);t.applyMatrix4(i),this.boundingBoxObject.copy(t)}},{key:"onMouseDown",value:function(e,t){if(this.object&&this.enabled){this.update(),this.isRotating=!1,this.isPanning=!1,this.mousedown=!0,this.object.updateMatrixWorld(),this.updateBoundingBox(),this.repositionGizmoArrows();var n=new te.P;this.boundingBoxObject.getSize(n);var r=n.x,i=n.y,a=n.z,s=new ne.P,u=te.P.Up(),c=new te.P;this.object.transform.getWorldQuaternion(s),u.applyQuaternion(s),this.object.transform.getWorldDirection(c);var l=c.clone().cross(u),h=new te.P;if(this.object.transform.getWorldPosition(h),this.rotationEnabled&&!this.isPanning){var f=[];if(this.isRotationAxisEnabled(cu.X))for(var m=0;m<this.arrowAxisXMesh.length;m++)this.arrowAxisXMesh[m].visible&&f.push(this.arrowAxisXMesh[m]);if(this.isRotationAxisEnabled(cu.Y))for(var p=0;p<this.arrowAxisYMesh.length;p++)this.arrowAxisYMesh[p].visible&&f.push(this.arrowAxisYMesh[p]);if(this.isRotationAxisEnabled(cu.Z))for(var d=0;d<this.arrowAxisZMesh.length;d++)this.arrowAxisZMesh[d].visible&&f.push(this.arrowAxisZMesh[d]);var y=this.intersectObjects(e,t,f);if(y.length>0){var g=(0,o.A)(y,1)[0];R.K.eventBus().dispatch(new K.r(Q.E.TransformControlChanged,this.object)),this.isRotating=!0,this.rotationAxis=void 0,this.rotationAxisSide=void 0;var b=R.K.sceneManager().getActiveCamera(),A=new te.P;b.transform.getWorldPosition(A);var M=this.arrowAxisXMesh.findIndex((function(e){return e.id===g.entity.id}));M>=0&&(this.rotationAxis=cu.X,this.rotationAxisSide=this.arrowAxisXMesh[M].metaData.AxisSide),this.rotationAxis||(M=this.arrowAxisYMesh.findIndex((function(e){return e.id===g.entity.id})))>=0&&(this.rotationAxis=cu.Y,this.rotationAxisSide=this.arrowAxisYMesh[M].metaData.AxisSide),this.rotationAxis||(M=this.arrowAxisZMesh.findIndex((function(e){return e.id===g.entity.id})))>=0&&(this.rotationAxis=cu.Z,this.rotationAxisSide=this.arrowAxisZMesh[M].metaData.AxisSide);var k=new te.P(0,0,0),w=this.object.transform.quaternion.clone();if(this.rotationAxis===cu.X){var T=l.clone();this.rotationAxisSide===hu.POSITIVE?(k.copy(T.multiplyScalar(-.5*r)),w.multiply((new ne.P).setFromAxisAngle(new te.P(0,1,0),(0,_.pu)(270)))):(k.copy(T.multiplyScalar(.5*r)),w.multiply((new ne.P).setFromAxisAngle(new te.P(0,1,0),(0,_.pu)(90))))}else if(this.rotationAxis===cu.Y){var x=u.clone();this.rotationAxisSide===hu.NEGATIVE?(k.copy(x.multiplyScalar(-.5*i)),w.multiply((new ne.P).setFromAxisAngle(new te.P(1,0,0),(0,_.pu)(270)))):(k.copy(x.multiplyScalar(.5*i)),w.multiply((new ne.P).setFromAxisAngle(new te.P(1,0,0),(0,_.pu)(90))))}else if(this.rotationAxis===cu.Z){var S=c.clone();this.rotationAxisSide===hu.NEGATIVE?k.copy(S.multiplyScalar(-.5*a)):(k.copy(S.multiplyScalar(.5*a)),w.multiply((new ne.P).setFromAxisAngle(new te.P(0,1,0),(0,_.pu)(180))))}else this.rotationAxis=void 0;this.previousRotation=void 0,this.rotationOffset=0,this.originalRotation=0;var C=h.clone().add(k);this.protractorGroup.transform.position.copy(h);var E=h.clone(),I=new te.P;this.protractorMesh.transform.getWorldPosition(I);var O=new ee.I(E.x,E.z),D=new ee.I(I.x,I.z);(O.distanceTo(D)<Sn.EPS||Math.abs(D.x)<Sn.EPS&&Math.abs(D.y)<Sn.EPS)&&E.add(new te.P(0,0,.001));var P=(new ie.k).lookAt(E,C,te.P.Up()),B=(new ne.P).setFromRotationMatrix(P);this.protractorMesh.transform.quaternion.copy(B),this.rotationRingMesh.transform.position.copy(h),this.rotationRingMesh.transform.quaternion.copy(w),this.rotationLine.transform.position.copy(h),this.rotationLine.transform.quaternion.copy(w);var F=window.pageXOffset||document.documentElement.scrollLeft,N=window.pageYOffset||document.documentElement.scrollTop,L=this.worldToScreen(C.x,C.y,C.z),j=this.boundingRect.x+L.x+F-15,U=this.boundingRect.y+L.y+N-15;this.rotationText.style.transform="translate3d(".concat(j,"px,").concat(U,"px,0px)"),this.rotationText.innerHTML="".concat(0,"&#176;"),this.rotationRaycastPlane.transform.position.copy(h),this.rotationRaycastPlane.transform.quaternion.copy(w),this.rotationRaycastPlane.layers.disable(4),this.objectUpDirectionBasedOnAxis.copy(te.P.Up().applyQuaternion(w)),this.setRotationVisibility(!0,!0),this.dragging=!0}else this.isRotating=!1,this.rotationAxis=void 0,this.rotationAxisSide=void 0,this.dragging=!1,this.rotationRaycastPlane.layers.enable(4),this.setRotationVisibility(!1,!0)}if(this.panEnabled&&!this.isRotating)if(this.panningRaycastPlanes.length>0)this.intersectProductNode(e,t,this.object)&&(R.K.eventBus().dispatch(new K.r(Q.E.TransformControlChanged,this.object)),this.isPanning=!0);else v.UX.warn("TransformControls: Raycast plane for panning is not defined!");(this.isPanning||this.isRotating)&&(this.mNextObjectPosition.copy(this.object.transform.position),this.mNextObjectQuaternion.copy(this.object.transform.quaternion)),this.update(),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))}}},{key:"onMouseUp",value:function(e,t){var n=this;this.object&&this.enabled&&(this.isPanning=!1,this.isRotating=!1,this.mousedown=!1,this.rotationEnabled&&void 0!==this.rotationAxis&&this.setRotationVisibility(!1,!0),this.dragging=!1,this.rotationAxis=void 0,this.rotationAxisSide=void 0,this.rotationOffset=0,this.previousRotation=void 0,this.rotationRaycastPlane.layers.enable(4),window.setTimeout((function(){n.rotationRingMesh.visible=!1,n.rotationLine.visible=!1}),10),this.update(),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)))}},{key:"getCellPosition",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=t.clone().multiply((new ne.P).setFromEuler(new re.O(-.5*Math.PI,0,0))),a=new te.P(n,0,r).addScalar(1e-5),o=a.clone().applyQuaternion(i),s=a.clone().multiplyScalar(.5).applyQuaternion(i);return(new te.P).copy(e).divide(o).floor().multiply(o).add(s)}},{key:"calculateUVCoordPlane",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:te.P.Up(),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ne.P.identity(),i=n.clone(),a=new te.P;e.transform.getWorldDirection(a),a.applyQuaternion(r),Math.abs(a.x-i.x)<Sn.EPS&&Math.abs(a.y-i.y)<Sn.EPS&&Math.abs(a.z-i.z)<Sn.EPS&&i.applyAxisAngle(te.P.Right(),(0,_.pu)(90));var o=new te.P;e.transform.getWorldPosition(o);var s=a.clone().cross(i),u=a.clone(),c=new eu.Z(u),l=new te.P,h=new te.P;c.projectPoint(t,l),c.projectPoint(o,h);var f=i.dot(l),m=s.dot(l),p=i.dot(h),d=s.dot(h);return new ee.I(f,m).sub(new ee.I(p,d)).normalize()}},{key:"getObjectsSnappedRotation",value:function(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=this.protractorGroup.transform.scale.x,s=this.protractorRadius*o*2,u=n,c=r.distanceTo(i),l=u-(0,_.qE)(c/s*u,0,u),h=360-Sn.Arctangent(0,0,e.x,e.y);return(0,_.H)(this.snapToDegrees((0,_.pu)(h),(0,_.pu)(t),(0,_.pu)(l),(0,_.pu)(a)))}},{key:"onMouseMove",value:function(e,t){var n=this;if(this.object&&this.enabled){if(this.panEnabled&&this.isPanning&&!this.isRotating&&this.mousedown&&this.panningRaycastPlanes.length>0){var r=this.intersectObjects(e,t,this.panningRaycastPlanes);if(r.length>0){var i=(0,o.A)(r,1)[0];R.K.eventBus().dispatch(new K.r(Q.E.TransformControlChanged,this.object));var a=this.panningRaycastPlanes.find((function(e){return e.id===i.entity.id})),s=new ne.P;a.transform.getWorldQuaternion(s),this.mNextObjectPlanePoint.copy(i.point),this.mNextObjectPlaneNormal.copy(i.normal);var u=1,c=1;a instanceof Qs&&(u=a.cellWidth,c=a.cellHeight);var l=this.getCellPosition(i.point,s,u,c),h=this.getCellPosition(this.object.transform.position,s,u,c);if(l.clone().sub(h).lengthSq()>Sn.EPS){var f=l.clone(),m=i.faceNormal.clone().applyQuaternion(i.entity.transform.quaternion),p=Sn.RotateBasedOnUpAxis(this.object.transform.quaternion.clone(),m);this.mUsePhysicsCollider?(this.mNextObjectPosition.copy(f),this.mNextObjectQuaternion.copy(p)):(this.object.transform.position.copy(f),this.object.transform.quaternion.copy(p),R.K.eventBus().dispatch(new K.r(Q.E.ObjectChanged,{name:"position",object:this.object})),R.K.eventBus().dispatch(new K.r(Q.E.ObjectChanged,{name:"rotation",object:this.object})),R.K.eventBus().dispatch(new K.r(Q.E.ObjectTransformed,{object:this.object})),R.K.eventBus().dispatch(new K.r(Q.E.TransformControlChanged,this.object)))}}}if(this.rotationEnabled&&!this.isPanning&&this.rotationAxis&&this.dragging){var d=this.intersectObjects(e,t,[this.rotationRaycastPlane]);if(d.length>0){var v=(0,o.A)(d,1)[0];R.K.eventBus().dispatch(new K.r(Q.E.TransformControlChanged,this.object));var y=new te.P,g=new ne.P;this.object.transform.getWorldPosition(y),this.object.transform.getWorldQuaternion(g);var b=R.K.sceneManager().getActiveCamera();this.object.updateMatrixWorld(),b.updateMatrixWorld();var A=(new ie.k).extractRotation(this.object.transform.matrixWorld),M=(new ne.P).setFromRotationMatrix(A),k=new te.P;this.boundingBoxObject.getCenter(k),k.applyQuaternion(g);var w=void 0===this.previousRotation,T=te.P.Up(),x=ne.P.identity();this.protractorMesh.transform.getWorldQuaternion(x),T.applyQuaternion(x);var S=this.calculateUVCoordPlane(this.protractorMesh,v.point,T),C=360-Sn.Arctangent(0,0,S.x,S.y),E=this.getObjectsSnappedRotation(S,30,10,v.point,this.rotationRaycastPlane.transform.position),I=this.getRotationOffset(E,C);Math.abs(I)>11&&(I=0);var O=this.calculateUVCoordPlane(this.rotationRaycastPlane,v.point,this.objectUpDirectionBasedOnAxis),D=360-Sn.Arctangent(0,0,O.x,O.y);D+=I,D=Math.round(D);var P=0;w&&(this.originalRotation=this.setToClosestBy(D%360,[0,90,180,270,360]),this.previousRotation=D,this.previousUVCoord.copy(O),P=this.getRotationOffset(D-this.originalRotation,D-this.previousRotation));var B=(D-this.previousRotation+P)%360;M.setFromRotationMatrix(A);var F=this.rotationAxisSide===hu.POSITIVE?1:-1;if(this.rotationAxis===cu.X?M.multiply((new ne.P).setFromAxisAngle(this.UnitX,(0,_.pu)(B*F))):this.rotationAxis===cu.Y?M.multiply((new ne.P).setFromAxisAngle(this.UnitY,(0,_.pu)(B*F))):this.rotationAxis===cu.Z&&M.multiply((new ne.P).setFromAxisAngle(this.UnitZ,(0,_.pu)(B*F))),this.rotationAxis){this.rotationOffset+=this.getRotationOffset(D,this.previousRotation),this.rotationOffset+=P,this.rotationOffset%=360;var N=this.rotationOffset>=0,L=0===this.originalRotation||180===this.originalRotation?90:270,j=D-this.originalRotation;N&&j<0&&(j+=360);var U=(N?j:-(360-j))%360,V=(this.originalRotation-U+L)%360;V<0&&(V+=360);var z=y.distanceTo(b.transform.position),H=(0,_.qE)(z*this.sizeProtractor.scale,this.sizeProtractor.min,this.sizeProtractor.max);this.protractorGroup.transform.scale.set(H,H,H),this.object.transform.updateMatrix(),this.updateBoundingBox();var G=new te.P;this.boundingBoxObject.getCenter(G);var q=this.object.transform.quaternion.clone().conjugate().multiply(M),W=(new ie.k).makeTranslation(G.x,G.y,G.z);W.multiply((new ie.k).makeRotationFromQuaternion(q)),W.multiply((new ie.k).makeTranslation(-G.x,-G.y,-G.z));var X=new te.P,Y=new ne.P,$=new te.P;if(this.object.transform.matrix.clone().multiply(W).decompose(X,Y,$),this.mUsePhysicsCollider,this.object.transform.quaternion.copy(Y),this.object.transform.updateMatrix(),this.rotationText.innerHTML="".concat(Math.abs(Math.round(U)),"&#176;"),Math.abs(U)>1e-5){var Z=this.protractorRadius*H-this.ringThickness*H,J=this.protractorRadius*H,ee=js.Create(Z,J,64,1,(0,_.pu)(V),(0,_.pu)(U),Fs.k.Double);this.rotationRingMesh.setGeometry(ee,void 0,!0),window.setTimeout((function(){n.rotationRingMesh.visible=!0}),0)}else window.setTimeout((function(){n.rotationRingMesh.visible=!1}),0);var re=(0,_.pu)(360-(D-90));this.rotationLine.setGeometry(zs.CreateStartEnd(te.P.Zero(),new te.P(Math.cos(re)*(this.protractorRadius*H),Math.sin(re)*(this.protractorRadius*H),0),1,Ft.v.Blue()),void 0,!0),window.setTimeout((function(){n.rotationLine.visible=!0}),10),R.K.eventBus().dispatch(new K.r(Q.E.TransformControlChanged,this.object)),this.previousRotation=D,this.previousUVCoord.copy(O)}}}}}},{key:"onWindowResize",value:function(e,t){var n=this;window.setTimeout((function(){try{var e=n.domElement.getBoundingClientRect();n.boundingRect.set(e.left,e.top,e.width,e.height)}catch(e){v.UX.error(e)}}),50)}},{key:"setRotationVisibility",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.visible=e||t,this.protractorGroup.visible=e,this.rotationText&&(this.rotationText.style.display=e?"block":"none"),this.arrowsVisible=t?!e:e,this.isRotationAxisEnabled(cu.X)||this.isRotationAxisEnabled(cu.Y)||this.isRotationAxisEnabled(cu.Z)||(this.arrowsVisible=!1);for(var n=0;n<this.arrowAxisXMesh.length;n++)this.arrowAxisXMesh[n]&&(this.arrowAxisXMesh[n].visible=!!this.isRotationAxisEnabled(cu.X)&&this.arrowsVisible);for(var r=0;r<this.arrowAxisYMesh.length;r++)this.arrowAxisYMesh[r]&&(this.arrowAxisYMesh[r].visible=!!this.isRotationAxisEnabled(cu.Y)&&this.arrowsVisible);for(var i=0;i<this.arrowAxisZMesh.length;i++)this.arrowAxisZMesh[i]&&(this.arrowAxisZMesh[i].visible=!!this.isRotationAxisEnabled(cu.Z)&&this.arrowsVisible);R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))}},{key:"repositionGizmoArrows",value:function(){this.object&&this.updateBoundingBox();var e=this.scaleGizmoArrows(),t=new te.P,n=new te.P;this.boundingBoxObject.getSize(t),this.boundingBoxObject.getCenter(n);for(var r=t.x,i=t.y,a=t.z,o=.05,s=.5*r+.5*(.05*e)+o,u=.5*i+.5*(.05*e)+o,c=.5*a+.5*(.05*e)+o,l=[new te.P(0,u,0),new te.P(0,0,c),new te.P(0,-u,0),new te.P(0,0,-c)],h=0;h<this.arrowAxisXMesh.length;h++)this.arrowAxisXMesh[h].transform.position.set(h<4?-.5*r:.5*r,l[h%4].y,l[h%4].z),this.arrowAxisXMesh[h].transform.position.add(n);l=[new te.P(0,0,c),new te.P(-s,0,0),new te.P(0,0,-c),new te.P(s,0,0)];for(var f=0;f<this.arrowAxisYMesh.length;f++)this.arrowAxisYMesh[f].transform.position.set(l[f%4].x,f<4?.5*i:-.5*i,l[f%4].z),this.arrowAxisYMesh[f].transform.position.add(n);l=[new te.P(0,u,0),new te.P(-s,0,0),new te.P(0,-u,0),new te.P(s,0,0)];for(var m=0;m<this.arrowAxisZMesh.length;m++)this.arrowAxisZMesh[m].transform.position.set(l[m%4].x,l[m%4].y,m<4?-.5*a:.5*a),this.arrowAxisZMesh[m].transform.position.add(n)}},{key:"scaleGizmoArrows",value:function(){var e=new te.P(0,0,0);this.object&&this.object.transform.getWorldPosition(e);for(var t=R.K.sceneManager().getActiveCamera(),n=e.distanceTo(t.transform.position),r=(0,_.qE)(n*this.sizeArrows.scale,this.sizeArrows.min,this.sizeArrows.max),i=0;i<this.arrowAxisXMesh.length;i++)this.arrowAxisXMesh[i].transform.scale.set(r,r,r);for(var a=0;a<this.arrowAxisYMesh.length;a++)this.arrowAxisYMesh[a].transform.scale.set(r,r,r);for(var o=0;o<this.arrowAxisZMesh.length;o++)this.arrowAxisZMesh[o].transform.scale.set(r,r,r);return r}},{key:"createGizmoArrows",value:(l=(0,n.A)(i().mark((function e(){var t,n,r,a,o,s,u,c,l,h,f,m,p,d,v,y,g,b,A,M,k,w,T,x;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==this.gizmoArrowTextures.length){e.next=2;break}return e.abrupt("return");case 2:if(t=en.J.getManager(en.n.MaterialManager),n=en.J.getManager(en.n.TextureManager),r=[(0,_.pu)(0),(0,_.pu)(90),(0,_.pu)(180),(0,_.pu)(270)],a=[(0,_.pu)(90),(0,_.pu)(270)],s=[hu.NEGATIVE,hu.POSITIVE],this.mArrowXMaterialhandle){e.next=22;break}return u=n.makeResourceRaw(this.gizmoArrowTextures[0]),e.next=11,n.resolveResource(u);case 11:c=e.sent,(l=R.K.renderer().getRenderEngine().createMaterialBasic("arrow-x-material")).setDiffuseColor(Ft.v.White()),l.setDiffuseMap(c),l.useAlphaFromDiffuseMap(!0),l.setTransparent(!0),l.setOpacity(.5),l.setDepthTest(!1),l.setDepthWrite(!1),l.setSide(Fs.k.Front),this.mArrowXMaterialhandle=t.makeResourceRaw(l);case 22:h=0===this.arrowAxisXMesh.length,f=0;case 24:if(!(f<8)){e.next=40;break}if(!h){e.next=35;break}return e.next=28,t.resolveResource(this.mArrowXMaterialhandle);case 28:m=e.sent,this.arrowAxisXMesh.push(new Ds.F(void 0,Us.Create(.05,.05,1,1),m)),this.arrowAxisXMesh[f].name="transform-controls-gizmo-arrow-x",this.arrowAxisXMesh[f].pickable=!0,this.arrowAxisXMesh[f].metaData.AxisSide=s[Math.floor(f/4)],this.arrowAxisXMesh[f].layers.enable(5),this.arrowAxisXMesh[f].layers.enable(8);case 35:this.arrowAxisXMesh[f].transform.quaternion.multiplyQuaternions((new ne.P).setFromAxisAngle(this.UnitX,r[f%4]),(new ne.P).setFromAxisAngle(this.UnitY,a[Math.floor(f/4)])),this.arrowAxisXMesh[f].visible=this.rotationEnabled&&this.arrowsVisible&&this.isRotationAxisEnabled(cu.X);case 37:f++,e.next=24;break;case 40:if(r=[(0,_.pu)(90),(0,_.pu)(270)],o=[(0,_.pu)(0),(0,_.pu)(90),(0,_.pu)(180),(0,_.pu)(270),(0,_.pu)(180),(0,_.pu)(90),(0,_.pu)(0),(0,_.pu)(270)],s=[hu.POSITIVE,hu.NEGATIVE],this.mArrowYMaterialhandle){e.next=58;break}return p=n.makeResourceRaw(this.gizmoArrowTextures[1]),e.next=47,n.resolveResource(p);case 47:d=e.sent,(v=R.K.renderer().getRenderEngine().createMaterialBasic("arrow-y-material")).setDiffuseColor(Ft.v.White()),v.setDiffuseMap(d),v.useAlphaFromDiffuseMap(!0),v.setTransparent(!0),v.setOpacity(.5),v.setDepthTest(!1),v.setDepthWrite(!1),v.setSide(Fs.k.Front),this.mArrowYMaterialhandle=t.makeResourceRaw(v);case 58:y=0===this.arrowAxisYMesh.length,g=0;case 60:if(!(g<8)){e.next=76;break}if(!y){e.next=71;break}return e.next=64,t.resolveResource(this.mArrowYMaterialhandle);case 64:b=e.sent,this.arrowAxisYMesh.push(new Ds.F(void 0,Us.Create(.05,.05,1,1),b)),this.arrowAxisYMesh[g].name="transform-controls-gizmo-arrow-y",this.arrowAxisYMesh[g].pickable=!0,this.arrowAxisYMesh[g].metaData.AxisSide=s[Math.floor(g/4)],this.arrowAxisYMesh[g].layers.enable(5),this.arrowAxisYMesh[g].layers.enable(8);case 71:this.arrowAxisYMesh[g].transform.quaternion.multiplyQuaternions((new ne.P).setFromAxisAngle(this.UnitX,r[Math.floor(g/4)]),(new ne.P).setFromAxisAngle(this.UnitZ,o[g])),this.arrowAxisYMesh[g].visible=this.rotationEnabled&&this.arrowsVisible&&this.isRotationAxisEnabled(cu.Y);case 73:g++,e.next=60;break;case 76:if(a=[(0,_.pu)(0),(0,_.pu)(180)],o=[(0,_.pu)(0),(0,_.pu)(90),(0,_.pu)(180),(0,_.pu)(270),(0,_.pu)(0),(0,_.pu)(270),(0,_.pu)(180),(0,_.pu)(90)],s=[hu.NEGATIVE,hu.POSITIVE],this.mArrowZMaterialhandle){e.next=94;break}return A=n.makeResourceRaw(this.gizmoArrowTextures[2]),e.next=83,n.resolveResource(A);case 83:M=e.sent,(k=R.K.renderer().getRenderEngine().createMaterialBasic("arrow-z-material")).setDiffuseColor(Ft.v.White()),k.setDiffuseMap(M),k.useAlphaFromDiffuseMap(!0),k.setTransparent(!0),k.setOpacity(.5),k.setDepthTest(!1),k.setDepthWrite(!1),k.setSide(Fs.k.Front),this.mArrowZMaterialhandle=t.makeResourceRaw(k);case 94:w=0===this.arrowAxisZMesh.length,T=0;case 96:if(!(T<8)){e.next=112;break}if(!w){e.next=107;break}return e.next=100,t.resolveResource(this.mArrowZMaterialhandle);case 100:x=e.sent,this.arrowAxisZMesh.push(new Ds.F(void 0,Us.Create(.05,.05,1,1),x)),this.arrowAxisZMesh[T].name="transform-controls-gizmo-arrow-z",this.arrowAxisZMesh[T].pickable=!0,this.arrowAxisZMesh[T].metaData.AxisSide=s[Math.floor(T/4)],this.arrowAxisZMesh[T].layers.enable(5),this.arrowAxisZMesh[T].layers.enable(8);case 107:this.arrowAxisZMesh[T].transform.quaternion.multiplyQuaternions((new ne.P).setFromAxisAngle(this.UnitY,a[Math.floor(T/4)]),(new ne.P).setFromAxisAngle(this.UnitZ,o[T])),this.arrowAxisZMesh[T].visible=this.rotationEnabled&&this.arrowsVisible&&this.isRotationAxisEnabled(cu.Z);case 109:T++,e.next=96;break;case 112:this.repositionGizmoArrows();case 113:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"intersectObjects",value:function(e,t,n){var r=e-this.boundingRect.x,i=t-this.boundingRect.y,a=R.K.sceneManager().getActiveCamera(),o=R.K.renderer().getRenderEngine().getForwardRayFromScreenCoords(a,r,i,1/0);return R.K.renderer().getRenderEngine().raycastIntersects(o,n,!1)}},{key:"intersectProductNode",value:function(e,t,n){var r=this,i=e-this.boundingRect.x,a=t-this.boundingRect.y,o=R.K.sceneManager().getActiveCamera(),s=R.K.renderer().getRenderEngine().getForwardRayFromScreenCoords(o,i,a,1/0),u=R.K.renderer().getRenderEngine().raycast(s);if(u.length>0){var c=u.find((function(e){var t=e.entity;return t&&t.visible&&!r.panningRaycastPlanes.find((function(e){return e.getSceneObjectId()===t.getSceneObjectId()}))&&!(r.rotationRaycastPlane&&r.rotationRaycastPlane.getSceneObjectId()===t.getSceneObjectId())&&!r.arrowAxisXMesh.find((function(e){return e.getSceneObjectId()===t.getSceneObjectId()}))&&!r.arrowAxisYMesh.find((function(e){return e.getSceneObjectId()===t.getSceneObjectId()}))&&!r.arrowAxisZMesh.find((function(e){return e.getSceneObjectId()===t.getSceneObjectId()}))&&!(r.rotationRingMesh&&r.rotationRingMesh.getSceneObjectId()===t.getSceneObjectId())&&!(r.rotationLine&&r.rotationLine.getSceneObjectId()===t.getSceneObjectId())&&!(r.protractorMesh&&r.protractorMesh.getSceneObjectId()===t.getSceneObjectId())}));if(c&&c.entity instanceof nu){var l=c.entity.findParentOfType(kt.i.TypeRTTI),h=c.entity.findParentOfType(Na.t.TypeRTTI);if(l&&l.getSceneObjectId()===n.getSceneObjectId())return c;if(h&&h.getSceneObjectId()===n.getSceneObjectId())return c}}}},{key:"hasObject",value:function(e){return e?this.object&&this.object.getSceneObjectId()===e.getSceneObjectId():!!this.object}},{key:"snapToDegrees",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=2*Math.PI,a=void 0!==n?n:Math.PI/48,o=void 0!==t?t:Math.PI/12,s=Math.floor(i/o),u=a,c=0;c<s;c++){var l=o*c;if(Math.abs(e+r-l)<u||e+r+u>=i){e=l;break}}return e}},{key:"setToClosestBy",value:function(e,t){for(var n=(0,o.A)(t,1)[0],r=0;r<t.length;r++)Math.abs(e-t[r])<Math.abs(e-n)&&(n=t[r]);return n}},{key:"worldToScreen",value:function(e,t,n){var r=new te.P(e,t,n),i=R.K.sceneManager().getActiveCamera();return r.project(i.transform.matrixWorld.clone().invert(),i.getProjectionMatrix()),new ee.I(Math.round((r.x+1)*this.boundingRect.z/2),Math.round(-(r.y-1)*this.boundingRect.w/2))}},{key:"getRotationOffset",value:function(e,t){return t>=270&&e<=90?e-(t-360):e>=270&&t<=90?e-360-t:e-t}},{key:"onBeforeMouseDown",value:function(e){try{var t=this.domElement.getBoundingClientRect();this.boundingRect.set(t.left,t.top,t.width,t.height)}catch(e){v.UX.error("onBeforeMouseDown:",e)}var n=e.changedTouches?e.changedTouches[0]:e;this.onMouseDown(n.clientX,n.clientY)}},{key:"onBeforeMouseUp",value:function(e){try{var t=this.domElement.getBoundingClientRect();this.boundingRect.set(t.left,t.top,t.width,t.height)}catch(e){v.UX.error("onBeforeMouseUp:",e)}var n=e.changedTouches?e.changedTouches[0]:e;this.onMouseUp(n.clientX,n.clientY)}},{key:"onBeforeMouseMove",value:function(e){try{var t=this.domElement.getBoundingClientRect();this.boundingRect.set(t.left,t.top,t.width,t.height)}catch(e){v.UX.error("onBeforeMouseMove:",e)}var n=e.changedTouches?e.changedTouches[0]:e;this.onMouseMove(n.clientX,n.clientY)}},{key:"loadTexture",value:(r=(0,n.A)(i().mark((function e(t,n){var r,a,o,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=en.J.getManager(en.n.TextureManager),e.next=3,this.mImageLoader.loadAsync(t);case 3:return a=e.sent,(o=R.K.renderer().getRenderEngine().createTexture2D(void 0!==n?n:"transform-controls-texture",void 0,!0,Cn.C$.UV,Cn.qC.Repeat,Cn.qC.Repeat,Cn.wm.Linear,Cn.wm.Linear,Cn.wm.Linear,!0,Cn.nC.RGBA,Cn.Gs.UnsignedByte,1,Cn.vv.Linear)).updateSource(a),n&&o.setName(n),s=r.makeResourceRaw(o),e.next=10,r.resolveResource(s);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]);var r,l,h,f,p}(Ao);function gu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gu=function(){return!!e})()}(0,c.A)(yu,"TypeRTTI",new le.O("ViewportControllerTransformControls",Ao.TypeRTTI)),(vu=du||(du={}))[vu.RayPickedSceneObject=0]="RayPickedSceneObject",vu[vu.RayHoverSceneObject=1]="RayHoverSceneObject",vu[vu.MaxTypeValue=2]="MaxTypeValue";var bu=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["selector"],r=(0,oe.A)(r),e=(0,ae.A)(n,gu()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mOnDownPosition",void 0),(0,c.A)(e,"mOnUpPosition",void 0),(0,c.A)(e,"mOnDoublePosition",void 0),(0,c.A)(e,"mHoverEnabled",!1),(0,c.A)(e,"mHoverThrottle",void 0),(0,c.A)(e,"mHoverThrottleTime",300),(0,c.A)(e,"mDragging",!1),e.mOnDownPosition=new ee.I,e.mOnUpPosition=new ee.I,e.mOnDoublePosition=new ee.I,e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this.registerMessageHandler(m.lF.TypeRTTI,(function(t){switch(t.name){case"down":e.handleViewMouseDown(t.event);break;case"up":e.handleViewMouseUp(t.event);break;case"move":e.handleViewMouseMove(t.event);break;case"leave":e.handleViewMouseLeave(t.event);break;case"dbclick":e.handleDoubleClick(t.event)}})),this.registerMessageHandler(m.A0.TypeRTTI,(function(t){"start"===t.name?e.mDragging=!0:"end"!==t.name&&"drop"!==t.name||(e.mDragging=!1)}))}},{key:"OnDetached",value:function(){this.unregisterMessageHandler(m.lF.TypeRTTI)}},{key:"enableHover",value:function(e){this.mHoverEnabled=e}},{key:"setHoverThrothleTime",value:function(e){this.mHoverThrottleTime=e}},{key:"clearDocumentSelections",value:function(){document.selection?document.selection.empty():window.getSelection&&window.getSelection().removeAllRanges()}},{key:"getMousePosition",value:function(e,t){var n=this.getViewportRenderer().getViewContainer();if(n){var r=n.getBoundingClientRect();return[e-r.left,t-r.top]}return[0,0]}},{key:"handleViewMouseMove",value:function(e){var t=this;this.mHoverEnabled&&!this.mDragging&&void 0===this.mHoverThrottle&&(this.mHoverThrottle=window.setTimeout((function(){delete t.mHoverThrottle;var n=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientX:e.clientX,r=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientY:e.clientY,i=t.getIntersects((new ee.I).fromArray(t.getMousePosition(n,r)));i.length>0&&R.K.interceptorManager().intercept(du.RayHoverSceneObject,i[0]).then((function(e){}),(function(e){}))}),this.mHoverThrottleTime))}},{key:"handleViewMouseLeave",value:function(e){}},{key:"handleViewMouseDown",value:function(e){this.clearDocumentSelections();var t=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientX:e.clientX,n=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientY:e.clientY;this.mOnDownPosition.fromArray([t,n])}},{key:"handleViewMouseUp",value:function(e){var t=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientX:e.clientX,n=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientY:e.clientY;this.mOnUpPosition.fromArray([t,n]),this.handleClick(!0===e.ctrlKey)}},{key:"handleDoubleClick",value:function(e){var t=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientX:e.clientX,n=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientY:e.clientY;this.mOnDoublePosition.fromArray(this.getMousePosition(t,n));var r=this.getIntersects(this.mOnDoublePosition);if(r.length>0){var i=r[0];R.K.eventBus().dispatch(new K.r(Q.E.ObjectFocused,i.entity))}}},{key:"handleClick",value:function(e){if(this.mOnDownPosition.distanceTo(this.mOnUpPosition)<.01){var t=this.getIntersects((new ee.I).fromArray(this.getMousePosition(this.mOnUpPosition.x,this.mOnUpPosition.y)));v.UX.print("clicked, intersects:",t),t.length>0?R.K.interceptorManager().intercept(du.RayPickedSceneObject,t[0],e).then((function(t){v.UX.print("clicked item after interceptors:",t),R.K.eventBus().dispatch(new K.r(Q.E.ObjectSelected,{selection:t.entity,options:{control:e}}))}),(function(e){v.UX.print("clicked item discarded")})):R.K.eventBus().dispatch(new K.r(Q.E.ObjectSelected,{selection:void 0,options:{control:e}}))}}},{key:"getIntersects",value:function(e){var t=R.K.sceneManager().getActiveCamera(),n=R.K.renderer().getRenderEngine().getForwardRayFromScreenCoords(t,e.x,e.y);return R.K.renderer().getRenderEngine().raycast(n).filter((function(e){return!!e.entity}))}}])}(Ao);function Au(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Au=function(){return!!e})()}(0,c.A)(bu,"TypeRTTI",new le.O("ViewportControllerEditorSelector",Ao.TypeRTTI));var _u=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["viewport-camera-controls"],r=(0,oe.A)(r),e=(0,ae.A)(n,Au()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"mEventBrokerSubcriptions",[]),(0,c.A)(e,"mControlChanged",void 0),(0,c.A)(e,"mTransformLocked",!1),e.mControlChanged=new M.B,e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"OnAttached",value:function(){var e=this;this.mEventBrokerSubcriptions.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.TransformControlChanged),(function(){return e.mControlChanged.next()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.TransformControlLock),(function(){e.mTransformLocked=!0,R.K.sceneManager().getScene().dispatchMessage(new m.qX(e.mTransformLocked,!1))})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.TransformControlUnLock),(function(){e.mTransformLocked=!1,R.K.sceneManager().getScene().dispatchMessage(new m.qX(e.mTransformLocked,!1))})),R.K.eventBus().subscribe(Ce.getTopicName(),(function(){R.K.eventBus().dispatch(new K.r(Q.E.ZoomChanged)),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))})),R.K.eventBus().subscribe(Me.getTopicName(),(function(){R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))}))),this.mSubscriptions.push(this.mControlChanged.pipe((0,k.M)((function(){R.K.sceneManager().getScene().dispatchMessage(new m.qX(e.mTransformLocked,!0))})),C(300)).subscribe((function(){R.K.sceneManager().getScene().dispatchMessage(new m.qX(e.mTransformLocked,!0))})))}},{key:"OnDetached",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mEventBrokerSubcriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}}])}(Ao),Mu=__webpack_require__(31731),ku=__webpack_require__(1005),wu=__webpack_require__(81080);class Tu{constructor(){this._dataLength=0,this._bufferLength=0,this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashStr(e,t=!1){return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){const t=Tu.hexChars,n=Tu.hexOut;let r,i,a,o;for(o=0;o<4;o+=1)for(i=8*o,r=e[o],a=0;a<8;a+=2)n[i+1+a]=t.charAt(15&r),r>>>=4,n[i+0+a]=t.charAt(15&r),r>>>=4;return n.join("")}static _md5cycle(e,t){let n=e[0],r=e[1],i=e[2],a=e[3];n+=(r&i|~r&a)+t[0]-680876936|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+t[1]-389564586|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+t[2]+606105819|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+t[3]-1044525330|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+t[4]-176418897|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+t[5]+1200080426|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+t[6]-1473231341|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+t[7]-45705983|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+t[8]+1770035416|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+t[9]-1958414417|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+t[10]-42063|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+t[11]-1990404162|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+t[12]+1804603682|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+t[13]-40341101|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+t[14]-1502002290|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+t[15]+1236535329|0,r=(r<<22|r>>>10)+i|0,n+=(r&a|i&~a)+t[1]-165796510|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+t[6]-1069501632|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+t[11]+643717713|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+t[0]-373897302|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+t[5]-701558691|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+t[10]+38016083|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+t[15]-660478335|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+t[4]-405537848|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+t[9]+568446438|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+t[14]-1019803690|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+t[3]-187363961|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+t[8]+1163531501|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+t[13]-1444681467|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+t[2]-51403784|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+t[7]+1735328473|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+t[12]-1926607734|0,r=(r<<20|r>>>12)+i|0,n+=(r^i^a)+t[5]-378558|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+t[8]-2022574463|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+t[11]+1839030562|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+t[14]-35309556|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+t[1]-1530992060|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+t[4]+1272893353|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+t[7]-155497632|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+t[10]-1094730640|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+t[13]+681279174|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+t[0]-358537222|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+t[3]-722521979|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+t[6]+76029189|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+t[9]-640364487|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+t[12]-421815835|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+t[15]+530742520|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+t[2]-995338651|0,r=(r<<23|r>>>9)+i|0,n+=(i^(r|~a))+t[0]-198630844|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+t[7]+1126891415|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+t[14]-1416354905|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+t[5]-57434055|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+t[12]+1700485571|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+t[3]-1894986606|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+t[10]-1051523|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+t[1]-2054922799|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+t[8]+1873313359|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+t[15]-30611744|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+t[6]-1560198380|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+t[13]+1309151649|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+t[4]-145523070|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+t[11]-1120210379|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+t[2]+718787259|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+t[9]-343485551|0,r=(r<<21|r>>>11)+i|0,e[0]=n+e[0]|0,e[1]=r+e[1]|0,e[2]=i+e[2]|0,e[3]=a+e[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(Tu.stateIdentity),this}appendStr(e){const t=this._buffer8,n=this._buffer32;let r,i,a=this._bufferLength;for(i=0;i<e.length;i+=1){if(r=e.charCodeAt(i),r<128)t[a++]=r;else if(r<2048)t[a++]=192+(r>>>6),t[a++]=63&r|128;else if(r<55296||r>56319)t[a++]=224+(r>>>12),t[a++]=r>>>6&63|128,t[a++]=63&r|128;else{if(r=1024*(r-55296)+(e.charCodeAt(++i)-56320)+65536,r>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");t[a++]=240+(r>>>18),t[a++]=r>>>12&63|128,t[a++]=r>>>6&63|128,t[a++]=63&r|128}a>=64&&(this._dataLength+=64,Tu._md5cycle(this._state,n),a-=64,n[0]=n[16])}return this._bufferLength=a,this}appendAsciiStr(e){const t=this._buffer8,n=this._buffer32;let r,i=this._bufferLength,a=0;for(;;){for(r=Math.min(e.length-a,64-i);r--;)t[i++]=e.charCodeAt(a++);if(i<64)break;this._dataLength+=64,Tu._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(e){const t=this._buffer8,n=this._buffer32;let r,i=this._bufferLength,a=0;for(;;){for(r=Math.min(e.length-a,64-i);r--;)t[i++]=e[a++];if(i<64)break;this._dataLength+=64,Tu._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}getState(){const e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){const t=e.buffer,n=e.state,r=this._state;let i;for(this._dataLength=e.length,this._bufferLength=e.buflen,r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],i=0;i<t.length;i+=1)this._buffer8[i]=t.charCodeAt(i)}end(e=!1){const t=this._bufferLength,n=this._buffer8,r=this._buffer32,i=1+(t>>2);this._dataLength+=t;const a=8*this._dataLength;if(n[t]=128,n[t+1]=n[t+2]=n[t+3]=0,r.set(Tu.buffer32Identity.subarray(i),i),t>55&&(Tu._md5cycle(this._state,r),r.set(Tu.buffer32Identity)),a<=4294967295)r[14]=a;else{const e=a.toString(16).match(/(.*?)(.{0,8})$/);if(null===e)return;const t=parseInt(e[2],16),n=parseInt(e[1],16)||0;r[14]=t,r[15]=n}return Tu._md5cycle(this._state,r),e?this._state:Tu._hex(this._state)}}if(Tu.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]),Tu.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Tu.hexChars="0123456789abcdef",Tu.hexOut=[],Tu.onePassHasher=new Tu,"5d41402abc4b2a76b9719d911017c592"!==Tu.hashStr("hello"))throw new Error("Md5 self test failed.");var xu=__webpack_require__(11208);function Su(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Su=function(){return!!e})()}var Cu=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["productSceneLoaderComponent"],r=(0,oe.A)(r),e=(0,ae.A)(n,Su()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"_dependenciesReplay$$",void 0),(0,c.A)(e,"_attributeUpdate$$",void 0),(0,c.A)(e,"_destroy$$",void 0),(0,c.A)(e,"_loadingFailed$$",void 0),(0,c.A)(e,"_queryFromServer",!1),(0,c.A)(e,"_queryInProgress",!1),(0,c.A)(e,"_loaderBusy",!1),(0,c.A)(e,"_loaderIdle$$",void 0),(0,c.A)(e,"mAttributeManager",void 0),(0,c.A)(e,"mCatalogueSettings",void 0),(0,c.A)(e,"mFirstBuild",!0),(0,c.A)(e,"mBrokerSubscriptions",[]),(0,c.A)(e,"mClientCache",{}),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this._attributeUpdate$$=new M.B,this._destroy$$=new M.B,this._loaderIdle$$=new L.m(1),this.markLoaderBusy(),this.registerMessageHandler(m.VC.TypeRTTI,this.onSceneUpdate.bind(this)),this.mBrokerSubscriptions.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.DrawingTechniqueFailed),(function(){var t;e._queryFromServer=!0,null===(t=e._loadingFailed$$)||void 0===t||t.next()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductOptionChanged),(function(){return e._attributeUpdate$$.next()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductAttributeUpdated),(function(){return e._attributeUpdate$$.next()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductQuestionChanged),(function(){return e._attributeUpdate$$.next()})),R.K.renderer().getRenderEngine().getUiRenderer().onUiSelected.subscribe((function(){e._attributeUpdate$$.next()}))),this.observeAttributeUpdates()}},{key:"OnDetached",value:function(){var e;this.unregisterFromAllMessages(),this.mBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this._destroy$$.next(),this._destroy$$.complete(),this.markLoaderIdle(),this._loaderIdle$$.complete(),null===(e=this._loadingFailed$$)||void 0===e||e.complete()}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(kt.i.TypeRTTI)}},{key:"markLoaderBusy",value:function(){this._loaderBusy=!0,this._loaderIdle$$.next(!this._loaderBusy)}},{key:"markLoaderIdle",value:function(){this._loaderBusy=!1,this._loaderIdle$$.next(!this._loaderBusy)}},{key:"loaderIdle",value:function(){return this._loaderIdle$$.pipe((0,ku.u)())}},{key:"createMeshFailObserver",value:function(){this._loadingFailed$$&&this._loadingFailed$$.complete(),this._loadingFailed$$=new M.B}},{key:"observeAttributeUpdates",value:function(){var e=this;this._attributeUpdate$$.pipe((0,k.M)((function(){return e.markLoaderBusy()})),(0,wu.p)(this.resolveDependencies.bind(this)),C(50),(0,cn.T)(this.buildQuery.bind(this)),ca((function(t,n){var r=t.clientHash===n.clientHash;return r&&!e._queryInProgress&&e.markLoaderIdle(),r})),(0,k.M)((function(){e.createMeshFailObserver(),e._queryFromServer=!1,e._queryInProgress=!0})),Ar((function(t){return(0,Mr.of)(t).pipe((0,Bn.L)((function(){return(0,xn.H)(e.queryScene(t,e._queryFromServer))})),Ar((function(t){return(0,xn.H)(e.updateArticles(t))})),(0,k.M)((function(t){return e.updateHierarchy(t)})),(0,Mu.u)({count:2,delay:function(){return e._loadingFailed$$}}))})),(0,ls.Q)(this._destroy$$)).subscribe({next:function(){e._queryInProgress=!1,e.markLoaderIdle()},error:function(t){e._queryInProgress=!1,e.markLoaderIdle(),v.UX.error(t),e.broadcastBuildEvent(!0)},complete:function(){e._queryInProgress=!1}})}},{key:"resolveFromCache",value:(f=(0,n.A)(i().mark((function e(t,n){var r,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.getParentObject(),!(a=r.getComponent("propertyValue"))||!0!==a.getValue("disable_bootstrap")){e.next=5;break}throw v.UX.print("API Batch Query Cache is disabled"),new Error("API Cache is disabled");case 5:return e.next=7,J.k.uniqueInstance().get("configuration_cache/".concat(t,"/configuration_").concat(n,".json"),{baseURL:et.w.spacesUrl});case 7:return o=e.sent,e.abrupt("return",o.data);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"resolveFromServer",value:(h=(0,n.A)(i().mark((function e(t,n,r,a){var o,s,u,c,l,h,f;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this.getParentObject(),s=o.getComponent("propertyValue"),e.next=4,(0,y._)(U.getInstance().resolveCatalogueSettings(t));case 4:return u=e.sent,c=u.getVersionHash(),l=new URLSearchParams,c?l.append("revision_hash",c):s&&!0===s.getValue("disable_bootstrap")&&(v.UX.print("API Batch Query Cache is disabled. Using active db."),l.append("use_active_db","true")),h=Array.from(l.keys()).length>0?"?".concat(l.toString()):"",e.next=11,J.k.getInstance().post("scene_object/batch/".concat(t).concat(h),{id:t,attributes:n,nodes:!0,hash:r,compression:a});case 11:return f=e.sent,e.abrupt("return",f.data);case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return h.apply(this,arguments)})},{key:"buildQuery",value:function(){var e=this.getParentObject().productId,t=this.mAttributeManager.buildQueryParams(!1,!1),n=this.mAttributeManager.buildQueryParams(!1,!0),r=this.mCatalogueSettings.getSceneDeviceSettings((0,H.Fr)()?N.RB.Mobile:N.RB.Desktop),i=parseInt(r.compression,10),a="";Object.keys(t).forEach((function(e){a+="".concat(e,":").concat(t[e],"/")}));var o="".concat(e,"/").concat(this.mCatalogueSettings.getGraphRevId(),"/").concat(this.mCatalogueSettings.getSceneRevId(),"/").concat(i,"/").concat(a),s=Tu.hashStr(o).toString(),u="";return Object.keys(n).forEach((function(e){u+="".concat(e,":").concat(n[e],"/")})),{id:e,serverHash:s,clientHash:Tu.hashStr(u).toString(),query:t,compression:i}}},{key:"queryScene",value:(l=(0,n.A)(i().mark((function e(t){var n,r=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.length>1&&void 0!==r[1]&&r[1],v.UX.print("request configuration with new hash path:",t.serverHash,t.query),n||!(t.serverHash in this.mClientCache)){e.next=4;break}return e.abrupt("return",this.mClientCache[t.serverHash]);case 4:return this.mClientCache={},e.next=7,this.resolveBatchQuery(t,n);case 7:return this.mClientCache[t.serverHash]=e.sent,e.abrupt("return",this.mClientCache[t.serverHash]);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"resolveBatchQuery",value:(o=(0,n.A)(i().mark((function e(t){var n=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.length>1&&void 0!==n[1]&&n[1]){e.next=10;break}return e.prev=2,e.next=5,this.resolveFromCache(t.id,t.serverHash);case 5:return e.abrupt("return",e.sent);case 8:e.prev=8,e.t0=e.catch(2);case 10:return e.abrupt("return",this.resolveFromServer(t.id,t.query,t.serverHash,t.compression));case 11:case"end":return e.stop()}}),e,this,[[2,8]])}))),function(e){return o.apply(this,arguments)})},{key:"updateArticles",value:(a=(0,n.A)(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getParentObject(),e.next=3,n._updateArticles(t);case 3:return e.abrupt("return",t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"updateHierarchy",value:function(e){this.getParentObject()._updateHierarchy(e)}},{key:"loadDependencies",value:(r=(0,n.A)(i().mark((function e(){var t,n,r,a,o,s,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getParentObject(),n=t.productId,r=t.getComponent("processManager"),a=t.getComponent("attributeManager"),o=t.getComponent("catalogueSettings"),s=t.getComponent("catalogueMeta"),e.next=8,Promise.all([r.resolveManager(),(0,y._)(a.resolveAttributeManager()),(0,y._)(o.resolveSettings()),s.loadCatalogueMeta(),za.getInstance().preloadCatalogue(n),Qa.m.getInstance().preloadCatalogue(n),tn.u.getInstance().preloadCatalogue(n),Tr.getInstance().preloadCatalogue(n)]);case 8:u=e.sent,this.mAttributeManager=u[1],this.mCatalogueSettings=u[2];case 11:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"resolveDependencies",value:function(){var e=this;return this._dependenciesReplay$$||(this._dependenciesReplay$$=new L.m(1),this.loadDependencies().then((function(){e._dependenciesReplay$$.next(),e._dependenciesReplay$$.complete()}),(function(t){e._dependenciesReplay$$.error(t)}))),this._dependenciesReplay$$}},{key:"onSceneUpdate",value:function(e){this.broadcastFirstBuild(),this.setProcessStatus(e)}},{key:"setProcessStatus",value:function(e){e.setProcessStatus(t.TypeRTTI.getTypeName(),this._loaderBusy?xu.B.InProgress:xu.B.Idle)}},{key:"broadcastFirstBuild",value:function(){this.mFirstBuild&&(this.mFirstBuild=!1,this.broadcastBuildEvent(),this._attributeUpdate$$.next())}},{key:"broadcastBuildEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getParentObject();if(t){var n=e?Q.E.ProductErrorLoading:Q.E.ProductStartLoading;R.K.eventBus().dispatch(new K.r(n,{catalogue_id:t.productId,scene_object_id:t.getSceneObjectId(),object_uuid:t.getObjectUUID()}))}}}]);var r,a,o,l,h,f}(he.$);function Eu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Eu=function(){return!!e})()}function Ru(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Cu,"TypeRTTI",new le.O("ProductSceneLoaderComponent",he.$.TypeRTTI));var Iu=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Eu()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mEventBrokerSubscriptions",[]),(0,c.A)(e,"mRendererBuildBusy",!0),(0,c.A)(e,"mBuildFullyLoaded",!1),(0,c.A)(e,"mBuildReady",!1),(0,c.A)(e,"mInitialBuildFinished",!1),(0,c.A)(e,"mTransparentLoadingScreen",!1),(0,c.A)(e,"mLoadDisplayDelay",void 0),(0,c.A)(e,"mProductsLoading",new Map),(0,c.A)(e,"mGlobalStyleElement",void 0),(0,c.A)(e,"mBlockLoadingScreen",!1),(0,c.A)(e,"mReconfiguring",!1),(0,c.A)(e,"mProducts",[]),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"createContainer",value:function(){var e=p.createElement("div");p.setAttribute(e,"id","xpv__viewer_load_backdrop"),p.setStyle(e,{width:"100%",height:"100%",flex:"1",position:"absolute",zIndex:"4",textAlign:"center",display:"flex",fontSize:"9px",backgroundColor:"rgba(255, 255, 255, 1.0)",alignItems:"center",justifyContent:"center",top:"0",pointerEvents:"none"});var t=p.createElement("div");p.setStyle(t,"width","20%"),p.append(e,t);var n=p.createElement("div");return p.setHtml(n,'<div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div>'),p.append(t,n),e}},{key:"init",value:function(){var e=this;Ru(t,"init",this,3)([]),this.initializeGlobalStyle(),this.mProductsLoading.clear(),this.mEventBrokerSubscriptions.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.RendererBuildStarted),(function(){e.mRendererBuildBusy=!0,e.checkBuildProcess()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.RendererBuildFinished),(function(){e.mRendererBuildBusy=!1,e.checkBuildProcess()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductStartLoading),(function(t){var n,r,i=t.getData().scene_object_id,a=R.K.sceneManager().findNodesOfType(kt.i.TypeRTTI,(function(e){return e.getSceneObjectId()===i}))[0],o=null===(n=null==a?void 0:a.enabled)||void 0===n||n,s=!0;null!==(r=a.getParent())&&void 0!==r&&r.isDerivedTypeOf(ss.TypeRTTI)&&!a.getParent().isViewVisible()&&(s=!1),o&&s&&(e.mProductsLoading.set(i,!0),e.checkBuildProcess())})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductErrorLoading),(function(t){var n=t.getData().scene_object_id;e.mProductsLoading.set(n,!1),e.checkBuildProcess()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductFinishedLoading),(function(t){var n=t.getData().scene_object_id;e.mProductsLoading.set(n,!1),e.checkBuildProcess()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.BuildFailed),(function(){e.mBuildFullyLoaded=!0,e.checkBuildProcess()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.BuildFullyLoaded),(function(){e.mBuildFullyLoaded=!0,e.checkBuildProcess()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductOptionChanged),(function(){e.showTransparentLoading(!0)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.LoadConfigurationStarted),(function(){e.mInitialBuildFinished=!1,e.mBuildReady=!1,e.showTransparentLoading(!0)})),R.K.messenger().listen(m.A0.TypeRTTI,(function(t){"start"===t.name?e.mBlockLoadingScreen=!0:"leave"===t.name&&(e.mBlockLoadingScreen=!1),e.checkBuildProcess()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.NodeAdded),(function(t){var n=t.getData();if(n instanceof kt.i){var r=n.findParentOfType(ss.TypeRTTI);r&&r.isViewVisible()&&e.subscribeToProductNode(n)}})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.NodeRemoved),(function(t){var n=t.getData();if(n instanceof kt.i){e.mProductsLoading.has(n.getSceneObjectId())&&e.mProductsLoading.delete(n.getSceneObjectId());var r=e.mProducts.findIndex((function(e){return e.product.getSceneObjectId()===n.getSceneObjectId()}));-1!==r&&(e.mProducts.splice(r,1).forEach((function(e){return e.subscription.unsubscribe()})),e.checkBuildProcess())}})),R.K.stateRegistery().subscribe("reconfigure",(function(t){e.mReconfiguring=!!t,e.checkBuildProcess()}))),this.mReconfiguring=!!R.K.stateRegistery().get("reconfigure");var n=R.K.sceneManager().getRootProductNode();n&&this.subscribeToProductNode(n)}},{key:"subscribeToProductNode",value:function(e){var t=this;if(!(this.mProducts.findIndex((function(t){return t.product.getSceneObjectId()===e.getSceneObjectId()}))>=0)){var n=e.getComponents(Cu.TypeRTTI)[0];n&&this.mProducts.push({product:e,subscription:n.loaderIdle().subscribe((function(n){t.mProductsLoading.set(e.getSceneObjectId(),!n),t.checkBuildProcess()}))})}}},{key:"showTransparentLoading",value:function(e){this.mInitialBuildFinished&&(this.mTransparentLoadingScreen=e,this.updateLoader())}},{key:"checkBuildProcess",value:function(){var e=!Array.from(this.mProductsLoading.values()).some((function(e){return!0===e}));!this.mInitialBuildFinished&&e&&!this.mRendererBuildBusy&&this.mBuildFullyLoaded&&(this.mReconfiguring||(this.mInitialBuildFinished=!0,this.mTransparentLoadingScreen=!0,this.mBuildReady=!0,this.mProductsLoading.clear()),this.updateLoader()),this.mInitialBuildFinished&&(!e||this.mRendererBuildBusy||this.mReconfiguring?this.mBuildReady=!1:(this.mBuildReady=!0,this.mProductsLoading.clear()),this.updateLoader())}},{key:"updateLoader",value:function(){var e=this;this.mTransparentLoadingScreen||this.mBlockLoadingScreen?"transparent"!==p.getStyle(this.mLayerContainer,"backgroundColor")&&window.setTimeout((function(){p.setStyle(e.mLayerContainer,"backgroundColor","transparent")}),100):p.setStyle(this.mLayerContainer,"backgroundColor","rgba(255, 255, 255, 1.0)");this.mBuildReady||this.mBlockLoadingScreen?(void 0!==this.mLoadDisplayDelay&&(window.clearTimeout(this.mLoadDisplayDelay),delete this.mLoadDisplayDelay),p.setStyle(this.mLayerContainer,"display","none")):"none"===p.getStyle(this.mLayerContainer,"display")&&this.mTransparentLoadingScreen?void 0===this.mLoadDisplayDelay&&(v.UX.print("show loader with delay"),this.mLoadDisplayDelay=window.setTimeout((function(){delete e.mLoadDisplayDelay,e.showLoader()}),300)):this.showLoader()}},{key:"showLoader",value:function(){p.setStyle(this.mLayerContainer,"display","flex")}},{key:"destroy",value:function(){this.mBuildReady=!1,this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mProducts.splice(0).forEach((function(e){return e.subscription.unsubscribe()})),this.mProducts.splice(0),this.mProductsLoading.clear(),this.mGlobalStyleElement.remove(),delete this.mGlobalStyleElement,Ru(t,"destroy",this,3)([])}},{key:"initializeGlobalStyle",value:function(){this.mGlobalStyleElement=p.createElement("style"),document.getElementsByTagName("head")[0].appendChild(this.mGlobalStyleElement),p.setAttribute(this.mGlobalStyleElement,"type","text/css"),p.setHtml(this.mGlobalStyleElement,".lds-ellipsis {\n              display: inline-block;\n              position: relative;\n              width: 64px;\n              height: 64px;\n            }\n            .lds-ellipsis div {\n              position: absolute;\n              top: 27px;\n              width: 11px;\n              height: 11px;\n              border-radius: 50%;\n              background: #ff6432;\n              animation-timing-function: cubic-bezier(0, 1, 1, 0);\n            }\n            .lds-ellipsis div:nth-child(1) {\n              left: 6px;\n              animation: lds-ellipsis1 0.6s infinite;\n            }\n            .lds-ellipsis div:nth-child(2) {\n              left: 6px;\n              animation: lds-ellipsis2 0.6s infinite;\n            }\n            .lds-ellipsis div:nth-child(3) {\n              left: 26px;\n              animation: lds-ellipsis2 0.6s infinite;\n            }\n            .lds-ellipsis div:nth-child(4) {\n              left: 45px;\n              animation: lds-ellipsis3 0.6s infinite;\n            }\n            @keyframes lds-ellipsis1 {\n              0% {\n                transform: scale(0);\n              }\n              100% {\n                transform: scale(1);\n              }\n            }\n            @keyframes lds-ellipsis3 {\n              0% {\n                transform: scale(1);\n              }\n              100% {\n                transform: scale(0);\n              }\n            }\n            @keyframes lds-ellipsis2 {\n              0% {\n                transform: translate(0, 0);\n              }\n              100% {\n                transform: translate(19px, 0);\n              }\n            }")}}])}(po);function Ou(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Du(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Du(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Du(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Pu=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mParentContainer",void 0),(0,c.A)(this,"mLayers",[]),this.mParentContainer=t}),[{key:"pushLayer",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var a=i[r];this.mLayers.push(a),a.setParentContainer(this.mParentContainer),a.isLayerInitialized()&&!a.isLayerAttached()&&a.attach()}this.sortLayers()}},{key:"removeLayer",value:function(e){var t=this.mLayers.indexOf(e);if(t>=0){var n=this.mLayers.splice(t,1),r=(0,o.A)(n,1)[0];r.isLayerAttached()&&r.detach(),r.setParentContainer(void 0)}}},{key:"initLayers",value:function(){var e,t=Ou(this.mLayers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.isLayerInitialized()||n.init(),n.isLayerAttached()||n.attach()}}catch(e){t.e(e)}finally{t.f()}}},{key:"destroyLayers",value:function(){var e,t=Ou(this.mLayers.splice(0));try{for(t.s();!(e=t.n()).done;){var n=e.value;n.isLayerInitialized()&&n.destroy()}}catch(e){t.e(e)}finally{t.f()}}},{key:"sortLayers",value:function(){if(!this.isLayersSorted()){var e,t=Ou(this.mLayers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.isLayerAttached()&&this.mParentContainer.removeChild(n.getLayerContainer())}}catch(e){t.e(e)}finally{t.f()}this.mLayers.sort((function(e,t){return t.getLayerIndex()-e.getLayerIndex()}));var r,i=Ou(this.mLayers);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.isLayerAttached()&&this.mParentContainer.appendChild(a.getLayerContainer())}}catch(e){i.e(e)}finally{i.f()}}}},{key:"isLayersSorted",value:function(){for(var e=!0,t=0;t<this.mLayers.length-1;t++)if(this.mLayers[t].getLayerIndex()>this.mLayers[t+1].getLayerIndex()){e=!1;break}return e}}])}();function Bu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bu=function(){return!!e})()}var Fu=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Bu()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mContainer",void 0),r.mContainer=n.container,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"createContainer",value:function(){return this.mContainer}}])}(po);function Nu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Nu=function(){return!!e})()}var Lu=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Nu()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mHandleViewMouseDownContext",void 0),(0,c.A)(r,"mGlobalStyleElement",void 0),r.mHandleViewMouseDownContext=r.handleViewMouseDown.bind(r),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"createContainer",value:function(){if(this.mViewLayerOptions.show360Indicator){this.initializeGlobalStyle();var e=p.createElement("div");return p.setStyle(e,"display","flex"),this.mViewLayerOptions.viewerCanvas.addEventListener("mousedown",this.mHandleViewMouseDownContext,!1),this.mViewLayerOptions.viewerCanvas.addEventListener("touchstart",this.mHandleViewMouseDownContext,!1),p.setAttribute(e,"class","interact-icon-360-container"),p.setHtml(e,'<div class="animation-wrapper">\n              <img class="icon-360"\n                alt=""\n                src="'.concat(et.w.assetsUrl,'system/icons/360-arrow.png" />\n              <img class="hand-360 wobble-hor-bottom"\n                alt=""\n                src="').concat(et.w.assetsUrl,'system/icons/hand-pointer-icon.png" />\n            </div>')),e}}},{key:"handleViewMouseDown",value:function(){this.destroyContainer()}},{key:"destroyContainer",value:function(){var e,n,r,i,a;this.mViewLayerOptions.viewerCanvas.removeEventListener("mousedown",this.mHandleViewMouseDownContext,!1),this.mViewLayerOptions.viewerCanvas.removeEventListener("touchstart",this.mHandleViewMouseDownContext,!1),this.mGlobalStyleElement&&(this.mGlobalStyleElement.remove(),delete this.mGlobalStyleElement),(e=t,n="destroyContainer",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}},{key:"initializeGlobalStyle",value:function(){this.mGlobalStyleElement=p.createElement("style"),document.getElementsByTagName("head")[0].appendChild(this.mGlobalStyleElement),p.setAttribute(this.mGlobalStyleElement,"type","text/css"),p.setHtml(this.mGlobalStyleElement,".interact-icon-360-container {\n                position: absolute;\n                width: 100px;\n                height: 58px;\n                background: rgba(38, 36, 36, 0.73);\n                display: none;\n                flex-direction: column;\n                align-items: center;\n                justify-content: center;\n                box-shadow: 1px 4px 4px 0px #5050505c;\n                color: white;\n                border-radius: 50px !important;\n                overflow: hidden;\n                padding: 0.5rem;\n                opacity: 0.9;\n                pointer-events: none;\n                justify-self: center;\n                align-self: center;\n                top: 50%;\n                left: 50%;\n                transform: translate(-50%, -50%);\n            }\n\n            .interact-icon-360-container .animation-wrapper {\n              width: 100%;\n              height: 100%;\n              position: relative;\n              display: flex;\n              justify-content: center;\n            }\n\n            .interact-icon-360-container .animation-wrapper img {\n              position: absolute !important;\n              top: 20px !important;\n            }\n\n            .interact-icon-360-container .animation-wrapper .hand-360 {\n                width: auto !important;\n                max-width: auto !important;\n                height: 38px !important;\n                z-index: 2  !important;\n                opacity: 0.95  !important;\n                background-color: transparent !important;\n                border-radius: 0 !important;\n                margin: 0 !important;\n                color: white !important;\n                padding: 0 !important;\n            }\n\n            .interact-icon-360-container .animation-wrapper .wobble-hor-bottom {\n                -webkit-animation: xpv-wobble-hor-bottom 2.8s ease-in-out infinite both;\n                        animation: xpv-wobble-hor-bottom 2.8s ease-in-out infinite both;\n            }\n\n            /* ----------------------------------------------\n             * Generated by Animista on 2019-6-17 13:26:58\n             * w: https://animista.net, t: @cssanimista\n             * ---------------------------------------------- */\n\n            /**\n             * ----------------------------------------\n             * animation wobble-hor-bottom\n             * ----------------------------------------\n             */\n            @-webkit-keyframes xpv-wobble-hor-bottom {\n              0%,\n              100% {\n                -webkit-transform: translateX(0%);\n                        transform: translateX(0%);\n                -webkit-transform-origin: 50% 50%;\n                        transform-origin: 50% 50%;\n              }\n              15% {\n                -webkit-transform: translateX(-30px) rotate(-6deg);\n                        transform: translateX(-30px) rotate(-6deg);\n              }\n              30% {\n                -webkit-transform: translateX(15px) rotate(6deg);\n                        transform: translateX(15px) rotate(6deg);\n              }\n              45% {\n                -webkit-transform: translateX(-15px) rotate(-3.6deg);\n                        transform: translateX(-15px) rotate(-3.6deg);\n              }\n              60% {\n                -webkit-transform: translateX(9px) rotate(2.4deg);\n                        transform: translateX(9px) rotate(2.4deg);\n              }\n              75% {\n                -webkit-transform: translateX(-6px) rotate(-1.2deg);\n                        transform: translateX(-6px) rotate(-1.2deg);\n              }\n            }\n            @keyframes xpv-wobble-hor-bottom {\n              0%,\n              100% {\n                -webkit-transform: translateX(0%);\n                        transform: translateX(0%);\n                -webkit-transform-origin: 50% 50%;\n                        transform-origin: 50% 50%;\n              }\n              15% {\n                -webkit-transform: translateX(-30px) rotate(-6deg);\n                        transform: translateX(-30px) rotate(-6deg);\n              }\n              30% {\n                -webkit-transform: translateX(15px) rotate(6deg);\n                        transform: translateX(15px) rotate(6deg);\n              }\n              45% {\n                -webkit-transform: translateX(-15px) rotate(-3.6deg);\n                        transform: translateX(-15px) rotate(-3.6deg);\n              }\n              60% {\n                -webkit-transform: translateX(9px) rotate(2.4deg);\n                        transform: translateX(9px) rotate(2.4deg);\n              }\n              75% {\n                -webkit-transform: translateX(-6px) rotate(-1.2deg);\n                        transform: translateX(-6px) rotate(-1.2deg);\n              }\n            }\n\n            .interact-icon-360-container .animation-wrapper .icon-360 {\n                height: auto !important;\n                width: 60% !important;\n                top: 0 !important;\n                background-color: transparent !important;\n                border-radius: 0 !important;\n                margin: 0 !important;\n                color: white !important;\n                padding: 0 !important;\n            }")}}])}(po);function ju(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ju=function(){return!!e})()}function Uu(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Vu=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,ju()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mEventBrokerSubscriptions",[]),(0,c.A)(e,"mOverlayImage",void 0),(0,c.A)(e,"mOverlayImageOpacityTimer",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"createContainer",value:function(){var e=p.createElement("div");return p.setStyle(e,{display:"none",position:"absolute",top:"0",left:"0",width:"100%",height:"100%",flex:"1",margin:"0",padding:"0",userSelect:"none",pointerEvents:"none"}),this.mOverlayImage=p.createElement("img"),p.setStyle(this.mOverlayImage,{width:"100%"}),e}},{key:"init",value:function(){var e=this;Uu(t,"init",this,3)([]),this.mEventBrokerSubscriptions.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ScreenshotTransitionStart),(function(t){e.screenshotStart(t.getData().image_data,t.getData().image_width,t.getData().image_height)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ScreenshotTransitionEnd),(function(){e.screenshotEnd()})))}},{key:"screenshotStart",value:function(e,t,n){void 0!==this.mOverlayImageOpacityTimer&&(window.clearTimeout(this.mOverlayImageOpacityTimer),delete this.mOverlayImageOpacityTimer),p.append(this.mLayerContainer,this.mOverlayImage),this.mOverlayImage.setAttribute("src",e),p.setStyle(this.mOverlayImage,{webkitTransition:"opacity 0s ease-in-out",MozTransition:"opacity 0s ease-in-out",msTransition:"opacity 0s ease-in-out",OTransition:"opacity 0s ease-in-out",transition:"opacity 0s ease-in-out"}),p.setStyle(this.mOverlayImage,"opacity","1"),p.setStyle(this.mOverlayImage,{webkitTransition:"opacity 1s ease-in-out",MozTransition:"opacity 1s ease-in-out",msTransition:"opacity 1s ease-in-out",OTransition:"opacity 1s ease-in-out",transition:"opacity 1s ease-in-out"});var r=void 0===t?"100%":"".concat(t,"px"),i=void 0===n?"auto":"".concat(n,"px");p.setStyle(this.mOverlayImage,{width:r,height:i}),p.setStyle(this.mLayerContainer,"display","block")}},{key:"screenshotEnd",value:function(){var e=this;p.setStyle(this.mOverlayImage,"opacity","0"),this.mOverlayImageOpacityTimer=window.setTimeout((function(){var t;delete e.mOverlayImageOpacityTimer,p.setStyle(e.mLayerContainer,"display","none"),null!==(t=e.mOverlayImage)&&void 0!==t&&t.parentElement&&e.mLayerContainer.removeChild(e.mOverlayImage)}),1e3)}},{key:"destroy",value:function(){this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),Uu(t,"destroy",this,3)([])}}])}(po);function zu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zu=function(){return!!e})()}var Hu,Gu,qu,Wu,Ku=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,zu()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"createContainer",value:function(){var e=this.mViewLayerOptions.container;return p.setStyle(e,{position:"absolute",top:"1px",left:"1px",zIndex:"1",width:"1px",height:"1px"}),e.setAttribute("id","svg_renderdom"),e}}])}(po);function Xu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xu=function(){return!!e})()}function Yu(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(Gu=Hu||(Hu={})).TOP="top",Gu.BOTTOM="bottom",Gu.LEFT="left",Gu.RIGHT="right",(Wu=qu||(qu={})).PERCENTAGE="percentage",Wu.ICON="icon",Wu.GALLERY="gallery";var $u=function(e){function t(e){var n,r,i,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,s.A)(this,t),r=this,i=t,a=[e,o],i=(0,oe.A)(i),n=(0,ae.A)(r,Xu()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mEventBrokerSubscriptions",[]),(0,c.A)(n,"mProductsLoading",new Map),(0,c.A)(n,"mInitialBuildFinished",!1),(0,c.A)(n,"mBuildReady",!1),(0,c.A)(n,"mRendererBuildBusy",!0),(0,c.A)(n,"mBuildFullyLoaded",!1),(0,c.A)(n,"mReconfiguring",!1),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"init",value:function(){var e=this;Yu(t,"init",this,3)([]),this.mProductsLoading.clear(),this.mEventBrokerSubscriptions.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.RendererBuildStarted),(function(){e.mRendererBuildBusy=!0,e.checkBuildProcess()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.RendererBuildFinished),(function(){e.mRendererBuildBusy=!1,e.checkBuildProcess()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductStartLoading),(function(t){var n,r,i=t.getData().scene_object_id,a=R.K.sceneManager().findNodesOfType(kt.i.TypeRTTI,(function(e){return e.getSceneObjectId()===i}))[0],o=null===(n=null==a?void 0:a.enabled)||void 0===n||n,s=!0;null!==(r=a.getParent())&&void 0!==r&&r.isDerivedTypeOf(ss.TypeRTTI)&&!a.getParent().isViewVisible()&&(s=!1),o&&s&&(e.mProductsLoading.set(i,!0),e.checkBuildProcess())})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductErrorLoading),(function(t){var n=t.getData().scene_object_id;e.mProductsLoading.set(n,!1),e.checkBuildProcess()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductFinishedLoading),(function(t){var n=t.getData().scene_object_id;e.mProductsLoading.set(n,!1),e.checkBuildProcess()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.BuildFailed),(function(){e.mBuildFullyLoaded=!0,e.checkBuildProcess()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.BuildFullyLoaded),(function(){e.mBuildFullyLoaded=!0,e.checkBuildProcess()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.NodeRemoved),(function(t){var n;if("ProductNode"===(null===(n=t.getData())||void 0===n||null===(n=n.getType())||void 0===n?void 0:n.getTypeName())){var r=t.getData().getSceneObjectId();e.mProductsLoading.has(r)&&e.mProductsLoading.delete(r),e.checkBuildProcess()}})),R.K.stateRegistery().subscribe("reconfigure",(function(t){e.mReconfiguring=!!t,e.checkBuildProcess()}))),this.mReconfiguring=!!R.K.stateRegistery().get("reconfigure")}},{key:"checkBuildProcess",value:function(){var e=!Array.from(this.mProductsLoading.values()).some((function(e){return!0===e}));!this.mInitialBuildFinished&&e&&!this.mRendererBuildBusy&&this.mBuildFullyLoaded&&(this.mReconfiguring||(this.mInitialBuildFinished=!0,this.mBuildReady=!0,this.mProductsLoading.clear()),this.updateLoader()),this.mInitialBuildFinished&&this.finishedLoading()}},{key:"updateLoader",value:function(){}},{key:"destroy",value:function(){this.mBuildReady=!1,this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),Yu(t,"destroy",this,3)([])}}])}(po);function Zu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zu=function(){return!!e})()}var Qu=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Zu()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mProgressContainer",void 0),(0,c.A)(e,"mBuildProgress",0),(0,c.A)(e,"mLoadDisplayDelay",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"createContainer",value:function(){var e=p.createElement("div");p.setAttribute(e,"id","xpv__viewer_initial_load_backdrop"),p.setStyle(e,{width:"100%",height:"100%",flex:"1",position:"absolute",zIndex:"4",textAlign:"center",display:"flex",fontSize:"14px",backgroundColor:"rgba(255, 255, 255, 1.0)",alignItems:"center",justifyContent:"center",top:"0",fontFamily:"Arial, sans-serif"});var t=p.createElement("div");return p.setStyle(t,"width","50%"),p.append(e,t),this.mViewLayerOptions.showProgressBar&&(this.mProgressContainer=p.createElement("div"),p.setAttribute(this.mProgressContainer,"id","xpv__viewer_initial_progress_container"),p.setStyle(this.mProgressContainer,{width:"100%","pointer-events":"none","user-select":"none"}),p.append(t,this.mProgressContainer)),e}},{key:"init",value:function(){var e,n,r,i,a,o=this;(e=t,n="init",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.mEventBrokerSubscriptions.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.RendererBuildProgress),(function(e){var t=e.getData();Number.isFinite(t)&&o.buildProgressHandler(t)})))}},{key:"buildProgressHandler",value:function(e){var t=e;t/=Array.from(this.mProductsLoading.values()).filter((function(e){return!0===e})).length+1,this.mBuildProgress=(0,_.qE)(Math.floor(100*t),0,100),this.updateLoader()}},{key:"updateLoader",value:function(){var e=this;if(this.mBuildReady)return void 0!==this.mLoadDisplayDelay&&(window.clearTimeout(this.mLoadDisplayDelay),delete this.mLoadDisplayDelay),void p.setStyle(this.mLayerContainer,"display","none");"none"!==p.getStyle(this.mLayerContainer,"display")?this.showLoader():void 0===this.mLoadDisplayDelay&&(v.UX.print("show loader with delay"),this.mLoadDisplayDelay=window.setTimeout((function(){e.showLoader()}),300))}},{key:"showLoader",value:function(){if(p.setStyle(this.mLayerContainer,"display","flex"),this.mProgressContainer)if(this.mBuildReady)p.setHtml(this.mProgressContainer,"");else{var e=Math.max(0,this.mBuildProgress);p.setHtml(this.mProgressContainer,'<div style="margin: auto;width: 100%;height: 4px;color:#fb9526; background-color: #fedfb5;">\n                <div style="height: 100%;width: '.concat(e,'%;background: linear-gradient(to right, #fedfb5, #fb9526); margin-bottom: 15px;"></div>\n                ').concat(e,"%\n            </div>"))}}},{key:"finishedLoading",value:function(){this.mBuildProgress=0,this.mProgressContainer&&(this.mProgressContainer.remove(),delete this.mProgressContainer),this.destroy()}}])}($u);function Ju(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ju=function(){return!!e})()}var ec=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Ju()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"createContainer",value:function(){var e,t,n,r=p.createElement("div");if(p.setAttribute(r,"id","xpv__viewer_initial_load_backdrop"),null===(e=this.mViewLayerOptions.icon)||void 0===e||!e.source_url)return r;p.setStyle(r,{width:"100%",height:"100%",flex:"1",position:"absolute",zIndex:"4",textAlign:"center",display:"flex",fontSize:"14px",backgroundColor:"rgba(255, 255, 255, 1.0)",alignItems:"center",justifyContent:"center",top:"0",fontFamily:"Arial, sans-serif"});var i=p.createElement("div");p.setStyle(i,"width","20%"),p.append(r,i);var a=p.createElement("div");return p.setHtml(a,'<img\n                src="'.concat(null===(t=this.mViewLayerOptions.icon)||void 0===t?void 0:t.source_url,'"\n                alt="').concat(null===(n=this.mViewLayerOptions.icon)||void 0===n?void 0:n.name,'" style="width: 100%; height: 100%; object-fit: contain;"\n            >')),p.append(i,a),r}},{key:"finishedLoading",value:function(){this.destroy()}}])}($u);function tc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tc=function(){return!!e})()}var nc=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,tc()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"galleryContainer",void 0),(0,c.A)(e,"thumbnailContainer",void 0),(0,c.A)(e,"mGlobalStyleElement",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"createContainer",value:function(){var e,t=p.createElement("div");if(p.setAttribute(t,"id","xpv__viewer_initial_load_backdrop"),null===(e=this.mViewLayerOptions.gallery)||void 0===e||!e.length)return t;p.setStyle(t,{display:"none",width:"100%",height:"100%",flex:"1",position:"absolute",zIndex:"4",textAlign:"center",fontSize:"14px",backgroundColor:"rgba(255, 255, 255, 1.0)",alignItems:"center",justifyContent:"center",top:"0",fontFamily:"Arial, sans-serif"});var n=p.createElement("div");return n.style.width="80%",n.className="xpv-preview-loading-screen-gallery",p.append(t,n),this.loadScripts(n),t}},{key:"loadScripts",value:function(e){var t=this;__webpack_require__.e(836).then(__webpack_require__.bind(__webpack_require__,27148)).then((function(n){return n.register(),t.initializeGlobalStyle(),t.mountSwiper(e),t.initSwiper()})).catch((function(e){v.UX.error("Failed to load swiper:",e),t.destroy()}))}},{key:"mountSwiper",value:function(e){this.galleryContainer=p.createElement("swiper-container"),this.galleryContainer.className="xpv-swiper-container-carousel",p.setAttribute(this.galleryContainer,"init","false");var t=this.mViewLayerOptions.gallery.map((function(e){return'\n            <swiper-slide><img src="'.concat(e.source_url,'" alt="').concat(e.name,'"/></swiper-slide>\n        ')})).join("");p.setHtml(this.galleryContainer,t);var n=p.createElement("div");n.className="xpv-container-swiper-thumb";var r=this.mViewLayerOptions.gallery.map((function(e){return'\n            <swiper-slide><img src="'.concat(e.lod2_url,'" alt="').concat(e.name,'"/></swiper-slide>\n        ')})).join("");this.thumbnailContainer=p.createElement("swiper-container"),this.thumbnailContainer.className="xpv-container-swiper-thumb-slides",this.thumbnailContainer.style.width="".concat(this.swiperThumbSlidesWidth(),"px"),p.setAttribute(this.thumbnailContainer,"init","false"),p.setHtml(this.thumbnailContainer,r),p.append(n,this.thumbnailContainer);var i=p.createElement("div");p.setHtml(i,'<div class="xpv-content-img-loading-viewer">\n                <img src="'.concat(et.w.assetsUrl,'system/gifs/product-presentation-loading-gallery.gif" alt="Model 3D thumbnail"/>\n            </div>')),p.append(e,this.galleryContainer),p.append(e,n),p.append(n,i)}},{key:"initSwiper",value:function(){var e=this.thumbnailContainer;Object.assign(e,{slidesPerView:this.thumbSlidesPerView(),watchSlidesProgress:!0,slideToClickedSlide:!0,watchSlidesVisibility:!0,slideThumbActiveClass:"xpv-swiper-slide-thumb-active"}),e.initialize();var t=this.galleryContainer;Object.assign(t,{slidesPerView:1,navigation:!0,thumbs:e}),t.initialize(),p.setStyle(this.mLayerContainer,"display","flex")}},{key:"thumbSlidesPerView",value:function(){return Math.min(this.mViewLayerOptions.gallery.length,3)}},{key:"swiperThumbSlidesWidth",value:function(){return Math.min(80*this.mViewLayerOptions.gallery.length,240)}},{key:"finishedLoading",value:function(){this.galleryContainer&&(this.galleryContainer.remove(),delete this.galleryContainer),this.thumbnailContainer&&(this.thumbnailContainer.remove(),delete this.thumbnailContainer),this.mGlobalStyleElement&&(this.mGlobalStyleElement.remove(),delete this.mGlobalStyleElement),this.destroy()}},{key:"initializeGlobalStyle",value:function(){this.mGlobalStyleElement=p.createElement("style"),document.getElementsByTagName("head")[0].appendChild(this.mGlobalStyleElement),p.setAttribute(this.mGlobalStyleElement,"type","text/css"),p.setHtml(this.mGlobalStyleElement,"\n            .xpv-preview-loading-screen-gallery {\n                width: 100%;\n                height: 100%;\n                position: relative;\n            }\n\n            .xpv-preview-loading-screen-gallery img {\n              width: 300px;\n              aspect-ratio: 1;\n              object-fit: contain;\n            }\n\n            .xpv-preview-loading-screen-gallery swiper-container::part(button-prev),\n            .xpv-preview-loading-screen-gallery swiper-container::part(button-next) {\n                --swiper-navigation-size: 25px;\n                color: #fb9526;\n            }\n\n            .xpv-swiper-container-carousel {\n                width: 100%;\n                height: 100%;\n            }\n\n            .xpv-swiper-container-carousel swiper-slide {\n                width: 100%;\n                display: flex;\n                justify-content: center;\n                align-items: center;\n            }\n\n            .xpv-container-swiper-thumb {\n              position: absolute;\n              bottom: 20px;\n              left: 50%;\n              transform: translateX(-50%);\n              gap: 10px;\n              z-index: 2;\n              padding: 10px 30px;\n              border-radius: 50px;\n              box-shadow: 0 3px 10px rgb(0 0 0 / 0.2);\n              display: flex;\n            }\n\n            .xpv-container-swiper-thumb swiper-slide {\n              opacity: 0.4;\n              display: flex;\n              align-items: center;\n            }\n\n            .xpv-container-swiper-thumb .xpv-container-swiper-thumb-slides .xpv-swiper-slide-thumb-active {\n              opacity: 1;\n            }\n\n            .xpv-container-swiper-thumb .xpv-container-swiper-thumb-slides .xpv-swiper-slide-thumb-active img {\n              transform: scale(1);\n              border: 2px solid #fb9526;\n            }\n\n            .xpv-container-swiper-thumb .xpv-container-swiper-thumb-slides img {\n              width: 40px;\n              aspect-ratio: 1;\n              object-fit: contain;\n              border-radius: 50%;\n              border: 2px solid lightgrey;\n              box-sizing: border-box;\n              cursor: pointer;\n              transform: scale(0.8);\n            }\n\n            .xpv-container-swiper-thumb .xpv-content-img-loading-viewer {\n              width: 40px;\n              aspect-ratio: 1;\n              border-radius: 50%;\n              border: 2px solid lightgrey;\n              box-sizing: border-box;\n              background-color: white;\n              display: flex;\n              justify-content: center;\n            }\n\n            .xpv-container-swiper-thumb .xpv-content-img-loading-viewer img {\n              width: 50%;\n              aspect-ratio: 1;\n              object-fit: contain;\n              margin-right: 10px;\n            }")}}])}($u),rc=function(){function e(t,n,r,i){(0,s.A)(this,e),(0,c.A)(this,"mViewRenderWrapper",void 0),(0,c.A)(this,"mViewerCanvas",void 0),(0,c.A)(this,"mLayerManager",void 0),(0,c.A)(this,"mSubscriptions",[]),(0,c.A)(this,"mEventBrokerSubscriptions",[]),(0,c.A)(this,"mViewportRenderer",void 0),(0,c.A)(this,"mClockLastUpdate",0),(0,c.A)(this,"mRenderActive",void 0),(0,c.A)(this,"mViewRenderSize",new ee.I(800,640)),(0,c.A)(this,"mRenderStream",new M.B),(0,c.A)(this,"mRenderRepeat",0),(0,c.A)(this,"mToolbar",void 0),(0,c.A)(this,"mInteractTimeout",-1),(0,c.A)(this,"dropzone",void 0),(0,c.A)(this,"mEngineStopped",!1),(0,c.A)(this,"mRequestFrameStream",new M.B),(0,c.A)(this,"viewerOptions",void 0),(0,c.A)(this,"uiContainer",void 0),this.mViewRenderWrapper=t,this.mViewerCanvas=n,this.viewerOptions=i||{},this.uiContainer=r,this.mRenderActive=!1,this.mToolbar=new ho(this.mViewRenderWrapper),this.mLayerManager=new Pu(this.mViewRenderWrapper),this.mViewportRenderer=new mo(this)}return(0,u.A)(e,[{key:"init",value:function(){var e=this;this.mViewportRenderer.addController(new _u),this.mViewportRenderer.addController(new Ts),this.mViewportRenderer.addController(new Rs),this.mViewportRenderer.addController(new bu);var t=new yu;this.mViewportRenderer.addController(t),this.isSubProductsRotationAllowed()?(t.DisableRotationAxis(cu.X|cu.Z),t.EnableRotation()):t.DisableRotation(),this.mViewportRenderer.initialize(),this.mEventBrokerSubscriptions.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.WindowResized),(function(){return e.windowResizeHandler()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.RequestFrame),(function(){e.mRenderRepeat=10})),R.K.eventBus().subscribeAll((function(t,n){return e.onEventSent(t,n)})),R.K.messenger().listen(m.Eg.TypeRTTI,(function(t){e.dispatchMessageToViewport(t)})),R.K.messenger().listen(m.y0.TypeRTTI,(function(t){e.dispatchMessageToViewport(t)})),R.K.messenger().listen(m.kU.TypeRTTI,(function(t){e.dispatchMessageToViewport(t)}))),this.mSubscriptions.push(this.mRenderStream.subscribe((function(t){e.renderView(t)})),this.mRequestFrameStream.pipe(Cs(16)).subscribe((function(){R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))}))),this._viewInit(),this.mToolbar.init(),this.mLayerManager.initLayers()}},{key:"destroy",value:function(){this.mEngineStopped=!0,this.mRenderActive=!1,this.mToolbar&&(this.mToolbar.dispose(),delete this.mToolbar),this.mLayerManager.destroyLayers(),this.mViewportRenderer.dispose(),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.unregisterInputEvents(),this.dropzone&&(this.dropzone.destroy(),delete this.dropzone)}},{key:"registerInputEvents",value:function(){var e=this;p.on(this.mViewerCanvas,"mousedown",(function(t){return e.handleViewMouseDown(t)})),p.on(this.mViewerCanvas,"mousemove",(function(t){return e.handleViewMouseMove(t)})),p.on(this.mViewerCanvas,"mouseup",(function(t){return e.handleViewMouseUp(t)})),p.on(this.mViewerCanvas,"mouseleave",(function(t){return e.handleMouseLeave(t)})),p.on(this.mViewerCanvas,"click",(function(e){return e.preventDefault()})),p.on(this.mViewerCanvas,"dblclick",(function(t){return e.handleDoubleClick(t)})),p.on(this.mViewerCanvas,"touchstart",(function(t){e.handleViewMouseDown(t)})),p.on(this.mViewerCanvas,"touchmove",(function(t){e.handleViewMouseMove(t)})),p.on(this.mViewerCanvas,"touchend",(function(t){e.handleViewMouseUp(t)})),p.on(this.mViewerCanvas,"wheel",(function(t){t.preventDefault(),e.interactWithViewer(),e.mRequestFrameStream.next()})),p.on(document,"keydown",(function(t){e.mRequestFrameStream.next()})),p.on(document,"keyup",(function(t){e.mRequestFrameStream.next()}))}},{key:"unregisterInputEvents",value:function(){p.off(this.mViewerCanvas,"mousedown"),p.off(this.mViewerCanvas,"mousemove"),p.off(this.mViewerCanvas,"mouseup"),p.off(this.mViewerCanvas,"mouseleave"),p.off(this.mViewerCanvas,"click"),p.off(this.mViewerCanvas,"dblclick"),p.off(this.mViewerCanvas,"touchstart"),p.off(this.mViewerCanvas,"touchmove"),p.off(this.mViewerCanvas,"touchend"),p.off(this.mViewerCanvas,"wheel"),p.off(document,"keydown"),p.off(document,"keyup")}},{key:"_viewInit",value:function(){var e=this;this.dropzone=window.expivi.interact().dropzone({droppable:this.mViewRenderWrapper,ondropped:function(t){if(t){var n=t.originalSource;n&&(n.hasAttribute("data-product")||n.hasAttribute("data-model"))&&e.onItemDropped(t)}}}),this.mViewportRenderer.setViewContainer(this.mViewRenderWrapper),this.mViewportRenderer.dispatchMessage(new m.LH),R.K.sceneManager().getActiveCamera().transform.position.copy(new te.P(2,3,0)),this.mClockLastUpdate=window.performance.now(),this.mRenderActive=!0,window.requestAnimationFrame(this.animateView.bind(this)),this.updateViewportSize()}},{key:"getViewportRenderer",value:function(){return this.mViewportRenderer}},{key:"windowResizeHandler",value:function(){!0===this.mRenderActive&&this.updateViewportSize()}},{key:"interactWithViewer",value:function(){var e=this;void 0!==this.mInteractTimeout&&window.clearTimeout(this.mInteractTimeout),this.mViewRenderWrapper.classList.add("interacted"),this.mInteractTimeout=window.setTimeout((function(){e.mViewRenderWrapper.classList.remove("interacted"),delete e.mInteractTimeout}),250)}},{key:"handleViewMouseDown",value:function(e){var t;e.preventDefault(),this.interactWithViewer(),this.mViewerCanvas.focus(),null===(t=this.mViewportRenderer)||void 0===t||t.mouseDown(e),this.mRequestFrameStream.next()}},{key:"handleViewMouseUp",value:function(e){var t;e.preventDefault(),this.interactWithViewer(),null===(t=this.mViewportRenderer)||void 0===t||t.mouseUp(e),this.mRequestFrameStream.next()}},{key:"handleViewMouseMove",value:function(e){var t;e.preventDefault(),this.interactWithViewer(),null===(t=this.mViewportRenderer)||void 0===t||t.mouseMove(e),this.mRequestFrameStream.next()}},{key:"handleMouseLeave",value:function(e){var t;e.preventDefault(),this.interactWithViewer(),null===(t=this.mViewportRenderer)||void 0===t||t.mouseLeave(e),this.mRequestFrameStream.next()}},{key:"handleDoubleClick",value:function(e){var t;e.preventDefault(),this.interactWithViewer(),null===(t=this.mViewportRenderer)||void 0===t||t.mouseDbClick(e),this.mRequestFrameStream.next()}},{key:"onItemDropped",value:function(e){try{var t,n=Number(e.clientX||0),r=Number(e.clientY||0),i=e.originalSource,a=(0,h.yA)(i.dataset.product),o=(0,h.yA)(i.dataset.model);null===(t=this.mViewportRenderer)||void 0===t||t.dropItem({position:new ee.I(n,r),dragData:{model_id:o,product_id:a,target:i,dropzone:e.currentTarget,types:["dragend","dropped"]}})}catch(e){v.UX.error("onItemDropped error: ",e)}}},{key:"onItemDragStart",value:function(e){try{var t,n=Number(e.clientX||0),r=Number(e.clientY||0),i=e.originalSource;null===(t=this.mViewportRenderer)||void 0===t||t.dragStart({position:new ee.I(n,r),dragData:{target:i,types:["dragstart"]}}),R.K.messenger().send(new m.A0("start",new ee.I(e.position.x,e.position.y),e.dragData)),this.mRequestFrameStream.next()}catch(e){v.UX.error("onItemDragStart error: ",e)}}},{key:"onItemDragMove",value:function(e){try{var t,n=Number(e.clientX||0),r=Number(e.clientY||0),i=e.originalSource;null===(t=this.mViewportRenderer)||void 0===t||t.dragMove({position:new ee.I(n,r),dragData:{target:i,types:["dragmove"]}}),this.mRequestFrameStream.next()}catch(e){v.UX.error("onItemDragMove error: ",e)}}},{key:"onItemDragEnd",value:function(e){try{var t,n=Number(e.clientX||0),r=Number(e.clientY||0),i=e.originalSource;null===(t=this.mViewportRenderer)||void 0===t||t.dragEnd({position:new ee.I(n,r),dragData:{target:i,types:["dragend"]}}),R.K.messenger().send(new m.A0("leave",new ee.I(e.position.x,e.position.y),e.dragData)),this.mRequestFrameStream.next()}catch(e){v.UX.error("onItemDragEnd error:",e)}}},{key:"updateViewportSize",value:function(){var e=this,t=this.mViewRenderWrapper.offsetWidth,n=this.mViewRenderWrapper.offsetHeight;R.K.renderer().getRenderEngine().setSize(t,n),this.mViewportRenderer.resize(t,n),window.setTimeout((function(){e.mViewRenderSize.set(t,n)}),0)}},{key:"dispatchMessageToViewport",value:function(e){v.UX.print("dispatch message to viewport renderer: ",this.mViewportRenderer,"message: ",e),this.mViewportRenderer&&this.mViewportRenderer.dispatchMessage(e)}},{key:"renderCamera",value:(t=(0,n.A)(i().mark((function t(n,r){var a,o,s=this,u=arguments;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=u.length>2&&void 0!==u[2]?u[2]:"image/jpeg",o=u.length>3?u[3]:void 0,t.abrupt("return",new Promise((function(t){var i=new te.P,u=new ne.P,c=R.K.sceneManager().getActiveCamera();c.transform.getWorldPosition(i),c.transform.getWorldQuaternion(u);var l=!1;switch(n){case G.FIRST_POSITION:v.UX.print("rendering first",n);var f=R.K.sceneManager().findNodesOfType(We.TypeRTTI,(function(e){return e.isCameraPartOfScene()}));f.length>0?s.mViewportRenderer.dispatchMessage(new m.Eg(f[0].getSceneObjectId(),!1,!0,!0)):s.mViewportRenderer.dispatchMessage(new m.ui(G.FIT_OBJECT_FRONT,r,!1));break;case G.FIT_OBJECT_FRONT:case G.FIT_OBJECT_BACK:case G.FIT_OBJECT_LEFT:case G.FIT_OBJECT_RIGHT:case G.FIT_OBJECT_TOP:case G.FIT_OBJECT_BOTTOM:v.UX.print("rendering fit",n),s.mViewportRenderer.dispatchMessage(new m.ui(n,r,!1));break;case G.CUSTOM_CAMERA_POSITION:var p=new te.P(0,0,0),d=new re.O(0,0,0);if(p.copy(i),d.setFromQuaternion(u),o)if(Array.isArray(o.position)?p.fromArray(o.position):o.position&&p.set(Number(o.position.x)||0,Number(o.position.y)||0,Number(o.position.z)||0),o.direction){var y=new te.P;Array.isArray(o.direction)?y.fromArray(o.direction):y.set(Number(o.direction.x)||0,Number(o.direction.y)||0,Number(o.direction.z)||0);var g=(new ie.k).lookAt(y,new te.P(0,0,0),new te.P(0,1,0));d.setFromRotationMatrix(g)}else if(o.quaternion){var b=new ne.P;Array.isArray(o.quaternion)?b.fromArray(o.quaternion):b.set(Number(o.quaternion.x)||0,Number(o.quaternion.y)||0,Number(o.quaternion.z)||0,isNaN(o.quaternion.w)?1:Number(o.quaternion.w)),d.setFromQuaternion(b)}else if(o.rotation){var A=new re.O;Array.isArray(o.rotation)?A.fromArray(o.rotation):A.set(Number(o.rotation.x)||0,Number(o.rotation.y)||0,Number(o.rotation.z)||0,o.rotation.order||"XYZ"),d.copy(A)}v.UX.print("renderCamera CUSTOM_CAMERA_POSITION",p,d),s.mViewportRenderer.dispatchMessage(new m.kU(p,new te.P(d.x,d.y,d.z),m.nN.PUSH_CONTROLLER,1,!0)),l=!0;break;default:v.UX.print("rendering default",n);var _=R.K.sceneManager().getActiveCameraId();h.N5.isNumeric(_)?s.mViewportRenderer.dispatchMessage(new m.Eg(_,!1,!0,!0)):s.mViewportRenderer.dispatchMessage(new m.ui(G.FIT_OBJECT_FRONT,r,!1))}window.setTimeout((function(){s.renderView(1/e.FRAME_RATE_CAP);var n=["image/jpeg","image/png","image/tiff"].find((function(e){return e===a}));void 0===n&&(n="image/jpeg");var r=R.K.renderer().getRenderEngine().getCanvas().toDataURL(n);if(l){var o=(new re.O).setFromQuaternion(u);s.mViewportRenderer.dispatchMessage(new m.kU(i,new te.P(o.x,o.y,o.z),m.nN.POP_CONTROLLER,1,!0))}t(r)}),1)})));case 3:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})},{key:"animateView",value:function(e){if(!this.mEngineStopped){window.requestAnimationFrame(this.animateView.bind(this));var t=e/1e3,n=t-this.mClockLastUpdate;this.mClockLastUpdate=t,this.mRenderActive&&(R.K.sceneManager().fixedUpdate(n),R.K.physicsSystem()&&(R.K.physicsSystem().syncTransforms(),R.K.physicsSystem().step(1/60,20),R.K.physicsSystem().syncMeshes()),R.K.sceneManager().update(n),this.mViewportRenderer.update(n),this.mRenderRepeat>0&&(this.mRenderRepeat-=1,this.mRenderStream.next(n)))}}},{key:"renderView",value:function(e){R.K.renderer().render(e)}},{key:"onEventSent",value:function(e,t){switch(t){case K.r.getTopicName(Q.E.TransformControlChanged):case K.r.getTopicName(Q.E.ModelAttributeChanged):case K.r.getTopicName(Q.E.ObjectChanged):case K.r.getTopicName(Q.E.ObjectSelected):case K.r.getTopicName(Q.E.ObjectTargetChanged):case K.r.getTopicName(Q.E.TransformModeChanged):case K.r.getTopicName(Q.E.TransformTargetMode):case K.r.getTopicName(Q.E.WindowResized):case K.r.getTopicName(Q.E.ActiveViewChanged):R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame),void 0,void 0,500)}switch(t){case K.r.getTopicName(Q.E.SceneGraphAdded):case K.r.getTopicName(Q.E.SceneGraphRemoved):R.K.eventBus().dispatch(new K.r(Q.E.SceneGraphChanged))}}},{key:"isSubProductsRotationAllowed",value:function(){var e=R.K.settingsManager().getSettings().getCatalogueMeta().allowSubProductRotation;return"boolean"!=typeof e||e}},{key:"createViewLayers",value:function(e){var t=this.resolveInitialLoadingScreen(7,e);this.mLayerManager.pushLayer(t,new Iu(6),new Lu(5,{show360Indicator:this.viewerOptions.show360Indicator,viewerCanvas:this.mViewerCanvas}),new go(3,{toolbar:this.mToolbar}),new Ku(2,{container:this.uiContainer}),new Vu(1),new Fu(0,{container:this.mViewerCanvas}))}},{key:"resolveInitialLoadingScreen",value:function(e,t){var n,r=t.getSettings().getProductPresentationSettings();switch((null==r?void 0:r.loading_type)||qu.PERCENTAGE){case qu.ICON:n=new ec(e,{icon:null==r?void 0:r.loading_icon});break;case qu.GALLERY:n=new nc(e,{gallery:null==r?void 0:r.loading_gallery});break;default:n=new Qu(e,{showProgressBar:this.viewerOptions.showProgress})}return n}}]);var t}();(0,c.A)(rc,"FRAME_RATE_CAP",60);__webpack_require__(5746);function ic(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ic=function(){return!!e})()}var ac=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),(n=(0,ae.A)(r,ic()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a))).mName="PrimitiveEntity",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(iu.a);function oc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oc=function(){return!!e})()}function sc(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(ac,"TypeRTTI",new le.O("PrimitiveEntity",iu.a.TypeRTTI));var uc=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,oc()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"renderTechnique",Ot._1.primitive_line),(0,c.A)(n,"mPointA",te.P.Left()),(0,c.A)(n,"mPointB",te.P.Right()),(0,c.A)(n,"mSpriteOffset",new te.P),(0,c.A)(n,"mLineColor",Ft.v.Black()),(0,c.A)(n,"mLabel",{title:"",color:new Ft.v("#0b0004"),margin:0,fontSize:32,spriteScale:1}),n.mName="PrimitiveEntityLine",n.setValue("label",{}),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"point_a":return n instanceof te.P?this.mPointA.copy(n):Array.isArray(n)&&this.mPointA.fromArray(n),!0;case"point_b":return n instanceof te.P?this.mPointB.copy(n):Array.isArray(n)&&this.mPointB.fromArray(n),!0;case"point_a_x":return this.mPointA.setX(parseFloat(n)),!0;case"point_a_y":return this.mPointA.setY(parseFloat(n)),!0;case"point_a_z":return this.mPointA.setZ(parseFloat(n)),!0;case"point_b_x":return this.mPointB.setX(parseFloat(n)),!0;case"point_b_y":return this.mPointB.setY(parseFloat(n)),!0;case"point_b_z":return this.mPointB.setZ(parseFloat(n)),!0;case"inv_point_a":return n instanceof te.P&&this.setWorldPosition(n,this.mPointA),!0;case"inv_point_b":return n instanceof te.P&&this.setWorldPosition(n,this.mPointB),!0;case"sprite_offset":return n instanceof te.P?this.mSpriteOffset.copy(n):Array.isArray(n)&&this.mSpriteOffset.fromArray(n),!0;case"inv_sprite_offset":return n instanceof te.P&&this.setOffsetPosition(n),!0;case"line_color":return this.mLineColor.set(n),!0;case"color":return this.mLabel.color.set(n),!0;case"fontSize":return this.mLabel.fontSize=parseInt(n,10),!0;case"spriteScale":return this.mLabel.spriteScale=parseFloat(n),!0;case"title":var i="";try{i=n.toString()}catch(e){}return this.mLabel.title=i,!0;case"label":try{var a=null;(a="string"==typeof n?JSON.parse(n):n).title&&(this.mLabel.title=a.title),a.margin&&(this.mLabel.margin=a.margin),a.color&&this.mLabel.color.set(a.color),a.fontSize&&(this.mLabel.fontSize=a.fontSize),a.spriteScale&&(this.mLabel.spriteScale=a.spriteScale)}catch(e){return!1}return!0}return sc(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=sc(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"point_a":return this.mPointA;case"point_b":return this.mPointB;case"point_a_x":return this.mPointA.x;case"point_a_y":return this.mPointA.y;case"point_a_z":return this.mPointA.z;case"point_b_x":return this.mPointB.x;case"point_b_y":return this.mPointB.y;case"point_b_z":return this.mPointB.z;case"sprite_offset":return this.mSpriteOffset;case"line_color":return this.mLineColor;case"title":return this.mLabel.title;case"color":return this.mLabel.color;case"fontSize":return this.mLabel.fontSize;case"spriteScale":return this.mLabel.spriteScale;case"label":return this.mLabel}return null}},{key:"setWorldPosition",value:function(e,t){var n=new ie.k;n.copy(this.transform.matrixWorld).invert(),e.applyMatrix4(n),t.copy(e)}},{key:"setOffsetPosition",value:function(e){var t=this.getSpritePosition(!1);this.mSpriteOffset.copy(e.sub(t))}},{key:"getSpritePosition",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.mPointA.clone().add(this.mPointB.clone().sub(this.mPointA).normalize().multiplyScalar(.5*this.mPointB.distanceTo(this.mPointA))).add(e?this.mSpriteOffset:new te.P)}},{key:"serialize",value:function(e){var n=Object.assign(sc(t,"serialize",this,3)([e]),{type:"line"});return n.properties=Object.assign(n.properties,{point_a:this.mPointA.toArray(),point_b:this.mPointB.toArray(),sprite_offset:this.mSpriteOffset.toArray(),line_color:this.mLineColor.getHexString(),label:JSON.stringify({title:this.mLabel.title,color:this.mLabel.color.getHexString(),margin:this.mLabel.margin,fontSize:this.mLabel.fontSize,spriteScale:this.mLabel.spriteScale})}),n}},{key:"pointA",get:function(){return this.mPointA},set:function(e){this.mPointA.copy(e)}},{key:"pointB",get:function(){return this.mPointB},set:function(e){this.mPointB.copy(e)}},{key:"lineColor",get:function(){return this.mLineColor},set:function(e){this.mLineColor.copy(e)}},{key:"spriteOffset",get:function(){return this.mSpriteOffset},set:function(e){this.mSpriteOffset.copy(e)}},{key:"labelText",get:function(){return this.mLabel.title},set:function(e){this.mLabel.title=e}},{key:"labelColor",get:function(){return this.mLabel.color},set:function(e){this.mLabel.color.copy(e)}},{key:"labelFontSize",get:function(){return this.mLabel.fontSize},set:function(e){this.mLabel.fontSize=e}},{key:"labelSpriteScale",get:function(){return this.mLabel.spriteScale},set:function(e){this.mLabel.spriteScale=e}}])}(ac);function cc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cc=function(){return!!e})()}(0,c.A)(uc,"TypeRTTI",new le.O("PrimitiveEntityLine",ac.TypeRTTI));var lc=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),(n=(0,ae.A)(r,cc()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a))).mName="ShaderEntity",n.mLayers.enable(3),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(iu.a);function hc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hc=function(){return!!e})()}(0,c.A)(lc,"TypeRTTI",new le.O("ShaderEntity",iu.a.TypeRTTI));var fc=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,hc()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"renderTechnique",Ot._1.effect_fire),n.mName="ShaderEntityFire",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,se.A)((0,oe.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"fire"});var n,r,i,a,o}}])}(lc);function mc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mc=function(){return!!e})()}(0,c.A)(fc,"TypeRTTI",new le.O("ShaderEntityFire",lc.TypeRTTI));var pc=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,mc()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mUpdatable",!1),(0,c.A)(n,"mCommandName",void 0),(0,c.A)(n,"mCommandId",-1),n.mCommandName=e,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"_setCommandId",value:function(e){this.mCommandId=e}},{key:"getCommandId",value:function(){return this.mCommandId}},{key:"setCommandName",value:function(e){this.mCommandName=e}},{key:"getCommandName",value:function(){return this.mCommandName}},{key:"setUpdatable",value:function(e){this.mUpdatable=e}},{key:"isUpdatable",value:function(){return this.mUpdatable}},{key:"overridesCommand",value:function(e){return this.isTypeOf(e.getType())}},{key:"update",value:function(e){}}])}(nt.b);function dc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dc=function(){return!!e})()}(0,c.A)(pc,"TypeRTTI",new le.O("Command",nt.b.TypeRTTI));var vc=function(e){function t(e,n){var r,i,a,o,u=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],l=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return(0,s.A)(this,t),i=this,a=t,o=["Add Object"],a=(0,oe.A)(a),r=(0,ae.A)(i,dc()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mAddingObject",void 0),(0,c.A)(r,"mParentNode",void 0),(0,c.A)(r,"mPersistant",void 0),(0,c.A)(r,"mSelectAfterCreation",void 0),r.mAddingObject=e,r.mParentNode=n,r.mPersistant=u,r.mSelectAfterCreation=l,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"execute",value:function(){R.K.sceneManager().addNode(this.mAddingObject,this.mParentNode,this.mPersistant),this.mSelectAfterCreation&&this.mAddingObject instanceof ce.S&&R.K.sceneManager().select(this.mAddingObject)}},{key:"undo",value:function(){R.K.sceneManager().deselect(),R.K.sceneManager().removeNode(this.mAddingObject,this.mPersistant)}}])}(pc);function yc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yc(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}(0,c.A)(vc,"TypeRTTI",new le.O("AddObjectCommand",pc.TypeRTTI));var bc=function(){function e(){(0,s.A)(this,e),(0,c.A)(this,"mCache",{})}return(0,u.A)(e,[{key:"resolveProducts",value:(a=(0,n.A)(i().mark((function e(){var t,n,r,a,o,s,u=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=u.length>3?u[3]:void 0,n=u.length>4?u[4]:void 0,r=u.length>5?u[5]:void 0,a=gc({active:1,limit:u.length>1&&void 0!==u[1]?u[1]:12,cursor:u.length>0&&void 0!==u[0]?u[0]:0,include:(u.length>2&&void 0!==u[2]?u[2]:[]).join(",")},r&&{renderer_type:r}),n&&(a.category=n),t&&(a.sort=t),e.next=11,J.k.getInstance().get("catalogue",{params:a});case 11:return o=e.sent,s=o.data,e.abrupt("return",It.eE.getItemsWithRelations(s));case 14:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"resolveProduct",value:(r=(0,n.A)(i().mark((function e(t,n){var r,a,o,s,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r={},null!=n&&n.include&&(r.include=n.include),!((a="".concat(t,"_").concat(f.V.Md5(JSON.stringify(r))))in this.mCache)){e.next=5;break}return e.abrupt("return",(0,y._)(this.mCache[a]));case 5:return this.mCache[a]=new L.m,e.prev=6,e.next=9,J.k.getInstance().get("catalogue/".concat(t),{params:r});case 9:return o=e.sent,s=o.data,u=It.eE.hydrateResponse(s,!1,5),this.mCache[a].next(u),this.mCache[a].complete(),e.abrupt("return",u);case 17:throw e.prev=17,e.t0=e.catch(6),this.mCache[a].error(e.t0),e.t0;case 21:case"end":return e.stop()}}),e,this,[[6,17]])}))),function(e,t){return r.apply(this,arguments)})},{key:"search",value:(t=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:15,r=c.length>2&&void 0!==c[2]?c[2]:[],a=c.length>3?c[3]:void 0,o=c.length>4&&void 0!==c[4]?c[4]:V.Threejs,s=gc({active:1,limit:n,include:r.join(",")},o&&{renderer_type:o}),a&&(s.sort=a),e.next=8,J.k.getInstance().get("catalogue/search?q=".concat(t),{params:s});case 8:return u=e.sent,e.abrupt("return",It.eE.getItemsWithRelations(u.data));case 10:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}]);var t,r,a}();(0,c.A)(bc,"sInstance",void 0);var Ac=function(){function e(){(0,s.A)(this,e),(0,c.A)(this,"mLoader",void 0)}return(0,u.A)(e,[{key:"getSupportedLocales",value:(t=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.sync().pipe((0,E.s)(1)).subscribe((function(t){e(t)}),(function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},{key:"resetCache",value:function(){return this.disposeLoader(),this}},{key:"disposeLoader",value:function(){this.mLoader&&(this.mLoader.error("Disposed"),delete this.mLoader)}},{key:"sync",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.mLoader&&!t||(this.mLoader=new L.m(1),J.k.getInstance().get("".concat(et.w.apiUrl,"team/current")).then((function(t){if(!t||200!==t.status)throw new Error("Api responded with status:".concat(t.status));var n=t.data.data.attributes.languages.map((function(e){return e.code}));e.mLoader&&e.mLoader.next(n)}),(function(){e.mLoader&&(e.mLoader.error("Failed resolve locale data"),delete e.mLoader)}))),this.mLoader}}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}]);var t}();function _c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_c(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function kc(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return wc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wc(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function wc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}(0,c.A)(Ac,"sInstance",void 0);var Tc=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mCalculatorList",void 0),(0,c.A)(this,"mPricingData",void 0),(0,c.A)(this,"mConfigurableNode",void 0),(0,c.A)(this,"mExcludePriceZero",void 0),this.mCalculatorList=[],this.mExcludePriceZero=!0}),[{key:"setExcludePriceZero",value:function(e){this.mExcludePriceZero=e}},{key:"get",value:(t=(0,n.A)(i().mark((function e(){var t,n,r,o,s,u,c,l,h,f,m,p,d,v,y,g,b;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=J.k.getInstance(),o=null!==(t=r.getAcceptLanguage())&&void 0!==t?t:"en-US",s=r.getCountry(),u=r.getCurrency(),c=R.K.sceneManager().getActiveProductNode(),l=c.getComponent("priceManager"),e.next=8,l.requestPriceBreakDown();case 8:h=e.sent,this.mConfigurableNode=h.configurableNode,this.mPricingData=h.pricingData,(n=this.mCalculatorList).push.apply(n,(0,a.A)(h.calculators)),f={},m=0,p={},d={totals:{base:0},models:h.models,articles:h.articles,catalogue:this.mPricingData.catalogue},v=kc(this.mCalculatorList),e.prev=17,v.s();case 19:if((y=v.n()).done){e.next=26;break}return g=y.value,e.next=23,this.getBreakDownFromCalculator(c,g,d,p,f);case 23:p=e.sent;case 24:e.next=19;break;case 26:e.next=31;break;case 28:e.prev=28,e.t0=e.catch(17),v.e(e.t0);case 31:return e.prev=31,v.f(),e.finish(31);case 34:for(b in f)m+=f[b];return f=Object.assign(f,{total:m}),e.abrupt("return",Mc(Mc({locale:o,country:s,currency:u},p),{},{total:f}));case 37:case"end":return e.stop()}}),e,this,[[17,28,31,34]])}))),function(){return t.apply(this,arguments)})},{key:"getBreakDownFromCalculator",value:(e=(0,n.A)(i().mark((function e(t,n,r,a,o){var s,u,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.getBreakDownName(),e.next=3,n.calculate(r,this.mPricingData,t,this.mConfigurableNode);case 3:if((u=e.sent).totals){e.next=6;break}return e.abrupt("return");case 6:return e.prev=6,e.next=9,n.breakDown(t,{excludePriceZero:this.mExcludePriceZero},this.mPricingData,r,this.mConfigurableNode);case 9:(c=e.sent)&&(a=Mc(Mc({},a),c)),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),v.UX.warn("Failed to get breakDown of calculator ".concat(s,":"),e.t0);case 16:return o[s]=u.totals.base,e.abrupt("return",a);case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(t,n,r,i,a){return e.apply(this,arguments)})}]);var e,t}(),xc=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mService",void 0)}),[{key:"setDiagnostic",value:function(e){if("price-breakdown"===e)this.mService=new Tc;else v.UX.error("Unknown diagnostic service.");return this.mService}},{key:"get",value:(e=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.mService){e.next=3;break}throw new Error("Diagnostic service not defined");case 3:return e.next=5,this.mService.get();case 5:return e.abrupt("return",e.sent);case 8:e.prev=8,e.t0=e.catch(0),v.UX.error(e.t0.message);case 11:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(){return e.apply(this,arguments)})}]);var e}();function Sc(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Cc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cc(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Cc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Ec=(0,u.A)((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;(0,s.A)(this,e),(0,c.A)(this,"id",void 0),(0,c.A)(this,"action",void 0),(0,c.A)(this,"priority",void 0),this.id=++e.sId,this.action=t,this.priority=n}));(0,c.A)(Ec,"sId",0);var Rc=function(){function e(){(0,s.A)(this,e),(0,c.A)(this,"mHooks",void 0),this.mHooks=new Map}return(0,u.A)(e,[{key:"hasHook",value:function(e){return this.mHooks.has(e)}},{key:"registerAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!t)throw new Error("Unable to register hook.");this.mHooks.has(e)||this.mHooks.set(e,[]);var r=this.mHooks.get(e)||[],i=new Ec(t,n);return r.push(i),this.mHooks.set(e,r),i.id}},{key:"unregisterAction",value:function(e){var t=this;this.mHooks.forEach((function(n,r){var i=n.findIndex((function(t){return t.id===e}));i>=0&&t.mHooks.get(r).splice(i,1)}))}},{key:"unregisterHook",value:function(e){this.mHooks.has(e)&&this.mHooks.delete(e)}},{key:"executeHook",value:(t=(0,n.A)(i().mark((function e(t,n){var r,a,o,s,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mHooks.has(t)){e.next=2;break}return e.abrupt("return",n);case 2:(r=this.mHooks.get(t)).sort((function(e,t){return e.priority-t.priority})),a=n,e.prev=5,o=Sc(r),e.prev=7,o.s();case 9:if((s=o.n()).done){e.next=16;break}return u=s.value,e.next=13,u.action(a);case 13:a=e.sent;case 14:e.next=9;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(7),o.e(e.t0);case 21:return e.prev=21,o.f(),e.finish(21);case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(5),v.UX.error("Unable to execute hook (".concat(t,"):"),e.t1);case 29:return e.abrupt("return",a);case 30:case"end":return e.stop()}}),e,this,[[5,26],[7,18,21,24]])}))),function(e,n){return t.apply(this,arguments)})}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}]);var t}();(0,c.A)(Rc,"sInstance",void 0);var Ic=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mCache",new Map)}),[{key:"get",value:(e=(0,n.A)(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mCache.has(t)){e.next=2;break}return e.abrupt("return",this.mCache.get(t));case 2:return e.next=4,J.k.getInstance().get("".concat(et.w.apiUrl,"attributes/").concat(t,"/gallery"));case 4:if(200===(n=e.sent).status&&n.data){e.next=7;break}throw new Error("Failed to retrieve results");case 7:return r=n.data,this.mCache.set(t,r),e.abrupt("return",r);case 10:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})}]);var e}(),Oc=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mCache",new Map)}),[{key:"get",value:(e=(0,n.A)(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mCache.has(t)){e.next=2;break}return e.abrupt("return",this.mCache.get(t));case 2:return e.next=4,J.k.getInstance().get("".concat(et.w.apiUrl,"media/").concat(t));case 4:if(200===(n=e.sent).status&&n.data){e.next=7;break}throw new Error("Failed to retrieve results");case 7:return r=n.data.data,this.mCache.set(t,r),e.abrupt("return",r);case 10:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})}]);var e}(),Dc=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"resolveCategories",value:(e=(0,n.A)(i().mark((function e(){var t,n,r,a,o=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={active:1,sort:o.length>3?o[3]:void 0,limit:o.length>1&&void 0!==o[1]?o[1]:12,cursor:o.length>0&&void 0!==o[0]?o[0]:0},null!=(t=o.length>2&&void 0!==o[2]?o[2]:[])&&t.length&&(n.include=t.join(",")),e.next=8,J.k.getInstance().get("category",{params:n});case 8:return r=e.sent,a=r.data,e.abrupt("return",It.eE.getItems(a));case 11:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})}],[{key:"getInstance",value:function(){return null===this._instance&&(this._instance=new this),this._instance}}]);var e}();function Pc(e){var t="function"==typeof Map?new Map:void 0;return Pc=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Ye(e,arguments,(0,oe.A)(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),(0,Xe.A)(n,e)},Pc(e)}function Bc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bc=function(){return!!e})()}(0,c.A)(Dc,"_instance",null);var Fc=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),(n=(0,ae.A)(r,Bc()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a))).name="ModerationException",n}return(0,ue.A)(t,e),(0,u.A)(t)}(Pc(Error));function Nc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Nc=function(){return!!e})()}var Lc=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e],a=(0,oe.A)(a),r=(0,ae.A)(i,Nc()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"messages",void 0),r.name="ValidationException",r.messages=n,r}return(0,ue.A)(t,e),(0,u.A)(t)}(Pc(Error)),jc=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"endPoint",void 0),this.endPoint=t}),[{key:"upload",value:(o=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=u.length>1&&void 0!==u[1]&&u[1],e.prev=1,t){e.next=4;break}throw new Error("Image source is required");case 4:return e.next=6,this.sendRequest(t,n);case 6:return r=e.sent,e.next=9,this.setImageDimensions(r);case 9:return e.abrupt("return",e.sent);case 12:if(e.prev=12,e.t0=e.catch(1),"ModerationException"!==(null===e.t0||void 0===e.t0||null===(a=e.t0.response)||void 0===a||null===(a=a.data)||void 0===a?void 0:a.class_name)){e.next=16;break}throw new Fc(e.t0.response.data.message);case 16:if("ValidationException"!==(null===e.t0||void 0===e.t0||null===(o=e.t0.response)||void 0===o||null===(o=o.data)||void 0===o?void 0:o.class_name)){e.next=18;break}throw new Lc(e.t0.response.data.message,e.t0.response.data.messages);case 18:throw new Error((null===e.t0||void 0===e.t0||null===(s=e.t0.response)||void 0===s||null===(s=s.data)||void 0===s?void 0:s.message)||e.t0.message);case 19:case"end":return e.stop()}}),e,this,[[1,12]])}))),function(e){return o.apply(this,arguments)})},{key:"sendRequest",value:(a=(0,n.A)(i().mark((function e(t,n){var r,a,o,s,u,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o={"Content-Type":"multipart/form-data"},s={image:t,keep_original:n?1:0},e.next=4,J.k.getInstance().post(this.endPoint,s,{headers:o});case 4:if("failed"===(null==(u=e.sent)||null===(r=u.data)||void 0===r?void 0:r.result)&&this.handleUploadFailure(u.data),c=null==u||null===(a=u.data)||void 0===a||null===(a=a.uploaded)||void 0===a?void 0:a.entities[0]){e.next=9;break}throw new Error("Unexpected Error: UploadResponseEntity not found in response");case 9:return e.abrupt("return",c);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"handleUploadFailure",value:function(e){var t,n,r=null!==(t=null==e||null===(n=e.failed)||void 0===n?void 0:n.entities)&&void 0!==t?t:[];if(0===r.length)throw new Error("Upload failed with no error details provided");var i=r.map((function(e){return"".concat(e.name,": ").concat(e.errors.join(", "))})).join("; ");throw new Error(i)}},{key:"setImageDimensions",value:(r=(0,n.A)(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.loadImage(t.url);case 2:return n=e.sent,t.width=n.width,t.height=n.height,e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"loadImage",value:(t=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=new Image;r.crossOrigin="anonymous",r.onload=function(){return e(r)},r.onerror=function(){return n(new Error("Failed to load image"))},r.src=t})));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"removeImage",value:(e=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,J.k.getInstance().delete("".concat(this.endPoint,"?upload_id=").concat(t));case 3:return e.abrupt("return",!0);case 6:e.prev=6,e.t0=e.catch(0),v.UX.error("Failed to remove image: ".concat(e.t0));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(t){return e.apply(this,arguments)})}]);var e,t,r,a,o}(),Uc=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"getImage",value:function(e,t,n){var r,i,a,s,u,c,l=R.K.sceneManager().findNodesOfType(kt.i.TypeRTTI,(function(t){return t.getSceneObjectId()===e||t.getObjectUUID()===e})),h=(0,o.A)(l,1)[0];if(!h)throw new Error("Unable to find product node.");var f=h.getComponent("attributeManager");if(!f)throw new Error("Unable to retrieve attribute manager component.");var m=f._getAttributeController(t);if(!m)throw new Error("Unable to find attribute.");if(!m.isDerivedTypeOf(Er.TypeRTTI))throw new Error("Attribute is not compatible with palletization feature. Only svg attributes are supported.");var p=m.getPalletizationContext(n);if(!p)throw new Error("No palletization context available for given object.");return{src:null!==(r=null===(i=p.canvas)||void 0===i?void 0:i.toDataURL())&&void 0!==r?r:"",width:null!==(a=null===(s=p.canvas)||void 0===s?void 0:s.width)&&void 0!==a?a:0,height:null!==(u=null===(c=p.canvas)||void 0===c?void 0:c.height)&&void 0!==u?u:0,originalWidth:p.svgEngine.getOriginalWidth(),originalHeight:p.svgEngine.getOriginalHeight()}}}])}(),Vc=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mNext",void 0)}),[{key:"setNext",value:function(e){return this.mNext?this.mNext.setNext(e):this.mNext=e,this}},{key:"execute",value:(e=(0,n.A)(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.request(t);case 2:if(!(n=e.sent)){e.next=5;break}return e.abrupt("return",this.response(t,n));case 5:if(!this.mNext){e.next=9;break}return e.next=8,this.mNext.execute(t);case 8:n=e.sent;case 9:return e.abrupt("return",Promise.resolve(this.response(t,n)));case 10:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})},{key:"request",value:function(e){}},{key:"response",value:function(e,t){return t}}]);var e}();function zc(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Hc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hc(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Hc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Gc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gc=function(){return!!e})()}var qc=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Gc()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"response",value:(r=(0,n.A)(i().mark((function e(t,n){var r,a,o,s,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.productNode,a=r.getComponent("materialGroupManager"),e.next=4,(0,y._)(a.resolveMaterialGroups());case 4:o=e.sent,s=n.data,u=zc(s);try{for(u.s();!(c=u.n()).done;)l=c.value,o.applyOverwritesOnMaterialReference(l.attributes)}catch(e){u.e(e)}finally{u.f()}return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})}]);var r}(Vc),Wc=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mCache",{})}),[{key:"store",value:function(e,t){this.mCache[e]=t}},{key:"get",value:function(e){return this.mCache[e]}},{key:"has",value:function(e){return e in this.mCache}},{key:"clear",value:function(){this.mCache={}}},{key:"generateHash",value:function(e){return f.V.Md5(JSON.stringify(e))}}])}();function Kc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kc=function(){return!!e})()}var Xc=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Kc()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mCache",new Wc),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"request",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.productNode,r=this.mCache.generateHash({product_scene_id:n.getSceneObjectId(),material_group_id:t.materialGroupId,sort_order:t.sortOrder,sort_attribute:t.sortAttribute,cursor:t.cursor,limit:t.limit}),this.mCache.has(r)){e.next=15;break}if(0!==t.cursor||30!==t.limit||"asc"!==t.sortOrder||"position"!==t.sortAttribute){e.next=14;break}return e.next=6,(0,y._)(Rt._.getInstance().resolveBootstrapData(n.productId));case 6:if(a=e.sent,o=a.getMaterialsByGroup(),s=o.find((function(e){return e.id===t.materialGroupId}))){e.next=11;break}return e.abrupt("return",void 0);case 11:return this.mCache.store(r,s.materials),t.cached=!0,e.abrupt("return",s.materials);case 14:return e.abrupt("return",void 0);case 15:return t.cached=!0,e.abrupt("return",this.mCache.get(r));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"response",value:function(e,t){if(e.cached)return t;var n=e.productNode,r=this.mCache.generateHash({product_scene_id:n.getSceneObjectId(),material_group_id:e.materialGroupId,sort_order:e.sortOrder,sort_attribute:e.sortAttribute,cursor:e.cursor,limit:e.limit});return this.mCache.store(r,t),t}}]);var r}(Vc);function Yc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yc=function(){return!!e})()}var $c,Zc,Qc=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Yc()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"request",value:(r=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",za.getInstance().getMaterialReferences(t.materialGroupId,t.cursor,t.limit,t.sortOrder,t.sortAttribute));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})}]);var r}(Vc),Jc=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mMiddleware",void 0),this.mMiddleware=(new qc).setNext(new Xc).setNext(new Qc)}),[{key:"getMaterialReferences",value:(e=(0,n.A)(i().mark((function e(t,n){var r,a,o,s,u,c,l=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=l.length>2&&void 0!==l[2]?l[2]:0,a=l.length>3&&void 0!==l[3]?l[3]:30,o=l.length>4&&void 0!==l[4]?l[4]:"asc",s=l.length>5&&void 0!==l[5]?l[5]:"position",u=this.findProductNode((0,h.ms)(t))){e.next=7;break}throw new Error("Could not find product node");case 7:return c=u.getComponent("materialGroupManager"),e.next=10,(0,y._)(c.resolveMaterialGroups());case 10:if(e.sent.getGroup(n)){e.next=13;break}throw new Error("Could not find material group in given product");case 13:return e.abrupt("return",this.mMiddleware.execute({productNode:u,materialGroupId:n,cursor:r,limit:a,sortOrder:o,sortAttribute:s}));case 14:case"end":return e.stop()}}),e,this)}))),function(t,n){return e.apply(this,arguments)})},{key:"findProductNode",value:function(e){var t,n=(0,h.yA)(e),r=(0,h.qO)(e);return void 0===r&&void 0===n?R.K.sceneManager().getRootProductNode():(R.K.sceneManager().findNodesOfType(kt.i.TypeRTTI).every((function(e){return r&&e.getObjectUUID()===r?(t=e,!1):!(!r&&e.getSceneObjectId()===n)||(t=e,!1)})),t)}}]);var e}(),el=function(){function e(){(0,s.A)(this,e)}return(0,u.A)(e,[{key:"find",value:(t=(0,n.A)(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,J.k.getInstance().get(et.w.makeApiRoute("product_preset/find/".concat(t,"?include=constraints")));case 2:return n=e.sent,e.abrupt("return",It.eE.getItem(n.data));case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}],[{key:"getInstance",value:function(){return e.sInstance||(e.sInstance=new e),e.sInstance}}]);var t}();(0,c.A)(el,"sInstance",void 0),(Zc=$c||($c={})).Category="category",Zc.Product="product",Zc.Attribute="attribute",Zc.AttributeValue="attribute_value";var tl=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"isCategoryLocked",value:function(e){return R.K.constraintSystem().getSystem($c.Category).isLocked(e)}},{key:"isProductLocked",value:function(e,t){return R.K.constraintSystem().getSystem($c.Product).isLocked(e,t)}},{key:"isAttributeLocked",value:function(e,t){return R.K.constraintSystem().getSystem($c.Attribute).isLocked(e,t)}},{key:"isAttributeValueLocked",value:function(e,t,n){return R.K.constraintSystem().getSystem($c.AttributeValue).isLocked(e,t,n)}}])}(),nl=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mAppViewer",void 0),this.mAppViewer=t}),[{key:"init",value:function(){var e=this;window.expivi.getCataloguePresentation=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.N5.resolveUuidOrId(n),t.abrupt("return",e.getCataloguePresentation(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.getService=function(t){if(!t)throw new Error("Invalid service name.");return e.resolveService(t)},window.expivi.managers.resolveMaterialGroups=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.N5.resolveUuidOrId(n),t.abrupt("return",e.resolveMaterialGroups(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.managers.resolveMaterialGroupManager=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.N5.resolveUuidOrId(n),t.abrupt("return",e.resolveMaterialGroupManagerByProductId(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.managers.resolveOffsetGroups=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.N5.resolveUuidOrId(n),t.abrupt("return",e.resolveOffsetGroups(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.managers.resolveMaterials=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.N5.resolveUuidOrId(n),t.abrupt("return",e.resolveMaterials(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.managers.resolveMaterialManager=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.N5.resolveUuidOrId(n),t.abrupt("return",e.resolveMaterialManager(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.managers.resolveTextures=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.N5.resolveUuidOrId(n),t.abrupt("return",e.resolveTextures(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.resolveSvgElementBoundaries=function(){var t=(0,n.A)(i().mark((function t(n,r,a){var o,s,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=h.N5.resolveInt(n),Number.isFinite(o)){t.next=3;break}throw new Error("Invalid attribute id.");case 3:if(s=r){t.next=6;break}throw new Error("Invalid element id.");case 6:return u=h.N5.resolveUuidOrId(a),t.abrupt("return",e.resolveSvgElementBoundaries(o,s,u));case 8:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),window.expivi.getAttributeById=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=h.N5.resolveInt(n),Number.isFinite(r)){t.next=3;break}throw new Error("Invalid attribute id.");case 3:return t.abrupt("return",e.getAttributeById(r));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.getProductAttributes=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.N5.resolveUuidOrId(n),t.abrupt("return",e.getProductAttributes(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.getMatgroupOptions=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=h.N5.resolveInt(n),Number.isFinite(r)){t.next=3;break}throw new Error("Invalid attribute id.");case 3:return t.abrupt("return",e.getMatgroupOptions(r));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.getColorOptions=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=h.N5.resolveInt(n),Number.isFinite(r)){t.next=3;break}throw new Error("Invalid attribute id.");case 3:return t.abrupt("return",e.getColorOptions(r));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.getQuestionOptions=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=h.N5.resolveInt(n),Number.isFinite(r)){t.next=3;break}throw new Error("Invalid attribute id.");case 3:return t.abrupt("return",e.getQuestionOptions(r));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.setProductAttribute=function(){var t=(0,n.A)(i().mark((function t(n,r,a){var o,s,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=h.N5.resolveInt(n),s=r,u=h.N5.resolveUuidOrId(a),Number.isFinite(o)){t.next=5;break}throw new Error("Invalid attribute id.");case 5:return t.abrupt("return",e.setProductAttribute(o,s,u));case 6:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),window.expivi.setProductAttributeNamed=function(){var t=(0,n.A)(i().mark((function t(n,r,a){var o,s,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=String(n),s=r,u=h.N5.resolveUuidOrId(a),n&&0!==o.length){t.next=5;break}throw new Error("Invalid attribute name.");case 5:return t.abrupt("return",e.setProductAttributeNamed(o,s,u));case 6:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),window.expivi.setProductAttributeByKey=function(){var t=(0,n.A)(i().mark((function t(n,r,a){var o,s,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=String(n),s=r,u=h.N5.resolveUuidOrId(a),n&&0!==o.length){t.next=5;break}throw new Error("Invalid attribute name.");case 5:return t.abrupt("return",e.setProductAttributeByKey(o,s,u));case 6:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),window.expivi.resetProductAttribute=function(){var t=(0,n.A)(i().mark((function t(n,r){var a,o;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=h.N5.resolveInt(n),o=h.N5.resolveUuidOrId(r),Number.isFinite(a)){t.next=4;break}throw new Error("Invalid attribute id.");case 4:return t.abrupt("return",e.resetProductAttribute(a,o));case 5:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),window.expivi.getActiveMaterial=function(){var t=(0,n.A)(i().mark((function t(n,r){var a,o;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=h.N5.resolveInt(n),o=h.N5.resolveUuidOrId(r),a){t.next=4;break}throw new Error("Invalid material group id.");case 4:return t.abrupt("return",e.getActiveMaterial(a,o));case 5:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),window.expivi.setActiveMaterial=function(){var t=(0,n.A)(i().mark((function t(n,r,a){var o,s,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=h.N5.resolveInt(n),s=h.N5.resolveInt(r),u=h.N5.resolveUuidOrId(a),o&&s){t.next=5;break}throw new Error("Invalid material group id or reference id.");case 5:return t.abrupt("return",e.setActiveMaterial(o,s,u));case 6:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),window.expivi.applyActiveMaterial=function(){var t=(0,n.A)(i().mark((function t(n,r,a){var o,s,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=h.N5.resolveInt(n),s=h.N5.resolveInt(r),u=h.N5.resolveUuidOrId(a),o&&s){t.next=5;break}throw new Error("Invalid material group id or material id.");case 5:return t.abrupt("return",e.applyActiveMaterial(o,s,u));case 6:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),window.expivi.getScreenshot=function(){var t=(0,n.A)(i().mark((function t(n,r,a,o,s){var u,c,l,f,m;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=h.N5.resolveInt(n),c=h.N5.resolveInt(r),l=a||G.ACTIVE_CAMERA,f=String(o),m=s,t.abrupt("return",e.mAppViewer.requestScreenshot(u,c,l,f,m));case 6:case"end":return t.stop()}}),t)})));return function(e,n,r,i,a){return t.apply(this,arguments)}}(),window.expivi.registerPriceCalculator=function(){var t=(0,n.A)(i().mark((function t(n,r){var a,o;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=n,o=h.N5.resolveUuidOrId(r),a){t.next=4;break}throw new Error("Invalid price calculator");case 4:return t.abrupt("return",e.registerPriceCalculator(a,o));case 5:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),window.expivi.getPrice=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.N5.resolveUuidOrId(n),t.abrupt("return",e.getPrice(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.getAllPrices=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.N5.resolveUuidOrId(n),t.abrupt("return",e.getAllPrices(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.getSupportedLocales=(0,n.A)(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.requestSupportedLocales());case 1:case"end":return t.stop()}}),t)}))),window.expivi.setNodeProperty=function(){var t=(0,n.A)(i().mark((function t(n,r){var a,o,s;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=String(n),r){t.next=3;break}throw new Error("Invalid node property.");case 3:if(o=String(r.name),s=r.value,n&&0!==a.length){t.next=7;break}throw new Error("Invalid node name.");case 7:return t.abrupt("return",e.setNodeProperty(a,o,s));case 8:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),window.expivi.getSceneObj=(0,n.A)(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.getSceneObj());case 1:case"end":return t.stop()}}),t)}))),window.expivi.getActiveCamera=(0,n.A)(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.getActiveCamera());case 1:case"end":return t.stop()}}),t)}))),window.expivi.changeCameraZoom=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==(r=h.N5.resolveInt(n))){t.next=3;break}throw new Error("Invalid zoom");case 3:return t.abrupt("return",e.changeCameraZoom(r));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.saveConfiguration=function(){var t=(0,n.A)(i().mark((function t(n,r,a,o,s){var u,c,l,f,m;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=h.N5.resolveInt(n),c=h.N5.resolveInt(r),l=a||G.ACTIVE_CAMERA,f=String(o),m=s,t.abrupt("return",e.mAppViewer.saveConfiguration(u,c,l,f,m));case 6:case"end":return t.stop()}}),t)})));return function(e,n,r,i,a){return t.apply(this,arguments)}}(),window.expivi.loadConfiguration=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n){t.next=3;break}throw new Error("Invalid configuration.");case 3:return t.abrupt("return",e.mAppViewer.loadConfiguration(r));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.loadPreset=function(){var t=(0,n.A)(i().mark((function t(n,r){var a,o;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=h.N5.resolveUuidOrId(n),o=String(r),r&&0!==o.length){t.next=4;break}throw new Error("Invalid preset id.");case 4:return t.abrupt("return",e.loadPreset(a,o));case 5:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),window.expivi.selectProductNode=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.N5.resolveUuidOrId(n),t.abrupt("return",e.selectProductNode(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.deselect=(0,n.A)(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.deselect());case 1:case"end":return t.stop()}}),t)}))),window.expivi.autoRotateYAxis=function(){var t=(0,n.A)(i().mark((function t(n,r,a,o){var s,u,c,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=h.N5.resolveUuidOrId(n),u=Boolean(r),c=h.N5.resolveInt(a),l=h.N5.resolveInt(o),t.abrupt("return",e.autoRotationYAxis(s,u,c,l));case 5:case"end":return t.stop()}}),t)})));return function(e,n,r,i){return t.apply(this,arguments)}}(),window.expivi.deleteNode=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.N5.resolveUuidOrId(n),t.abrupt("return",e.deleteNode(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.resolveProductNodes=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Boolean(n),t.abrupt("return",e.resolveProductNodes(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.getCatalogueProducts=function(){var t=(0,n.A)(i().mark((function t(n,r,a,o){var s,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=h.N5.resolveInt(n),u=h.N5.resolveInt(r),t.abrupt("return",e.getCatalogueProducts(s,u,a,o));case 3:case"end":return t.stop()}}),t)})));return function(e,n,r,i){return t.apply(this,arguments)}}(),window.expivi.searchCatalogueProducts=function(){var t=(0,n.A)(i().mark((function t(n,r,a){var o;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=h.N5.resolveInt(r),t.abrupt("return",e.searchCatalogueProducts(n,o,a));case 2:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),window.expivi.getCatalogueProductById=function(){var t=(0,n.A)(i().mark((function t(n,r){var a;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=h.N5.resolveInt(n)){t.next=3;break}throw new Error("Invalid product id.");case 3:return t.abrupt("return",e.getCatalogueProductById(a,r));case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),window.expivi.usesCatalogueBrowser=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.N5.resolveUuidOrId(n),t.abrupt("return",e.usesCatalogueBrowser(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.getCameraTransform=(0,n.A)(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.getCameraTransform());case 1:case"end":return t.stop()}}),t)}))),window.expivi.setCameraTransform=function(){var t=(0,n.A)(i().mark((function t(n,r){var a;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=n){t.next=3;break}throw new Error("Invalid transform.");case 3:return t.abrupt("return",e.setCameraTransform(a,r));case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),window.expivi.addProduct=function(){var t=(0,n.A)(i().mark((function t(n,r,a){var o,s,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=h.N5.resolveInt(n),s=r,u=a,o){t.next=5;break}throw new Error("Invalid product id.");case 5:return t.abrupt("return",e.addProduct(o,s,u));case 6:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),window.expivi.moveProduct=function(){var t=(0,n.A)(i().mark((function t(n,r){var a,o;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=h.N5.resolveUuidOrId(n),o=r){t.next=4;break}throw new Error("Invalid transform.");case 4:return t.abrupt("return",e.moveProduct(a,o));case 5:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),window.expivi.removeProduct=function(){var t=(0,n.A)(i().mark((function t(n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=h.N5.resolveUuidOrId(n),t.abrupt("return",e.removeProduct(r));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),window.expivi.getCategories=function(){var e=(0,n.A)(i().mark((function e(t,n,r){var a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=h.N5.resolveInt(t),o=h.N5.resolveInt(n),e.abrupt("return",Dc.getInstance().resolveCategories(a,o,[],r));case 3:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),window.expivi._dispatch=function(){var t=(0,n.A)(i().mark((function t(n,r,a){var o,s,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=String(n),s=r,u=h.N5.resolveUuidOrId(a),n&&0!==o.length){t.next=5;break}throw new Error("Invalid type");case 5:return t.abrupt("return",e.dispatch(o,s,u));case 6:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()}},{key:"resolveService",value:function(e){var t=this,n=this.mAppViewer.getServices();if(n.has(e))return n.get(e);var r={image_library:function(){return new Ic},media:function(){return new Oc},diagnostic:function(){return new xc},hooks:function(){return Rc.getInstance()},image_uploader:function(){return new jc(t.mAppViewer.mOptions.uploadURL)},palletization:function(){return new Uc},matgroup:function(){return new Jc},constraint:function(){return new tl}}[e]();if(!r)throw new Error("Unknown service.");return n.set(e,r),r}},{key:"resolveMaterialGroups",value:(me=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=n.findProductNode(t);if(!i)return r("product node not found");i.getComponent("materialGroupManager").resolveMaterialGroups().pipe((0,E.s)(1)).subscribe({next:function(t){e(t.getGroups())},error:function(e){r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return me.apply(this,arguments)})},{key:"resolveMaterialGroupManagerByProductId",value:(fe=(0,n.A)(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.abrupt("return",this.resolveMaterialGroupManager(n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return fe.apply(this,arguments)})},{key:"resolveOffsetGroups",value:(he=(0,n.A)(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resolveConfigurableNode(t);case 2:if(n=e.sent){e.next=5;break}throw new Error("Failed to get configurable node");case 5:return e.next=7,n.resolveSceneOffsetManager();case 7:return r=e.sent,e.abrupt("return",r.getOffsets());case 9:case"end":return e.stop()}}),e,this)}))),function(e){return he.apply(this,arguments)})},{key:"resolveMaterials",value:(le=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=n.findProductNode(t);if(!i)return r("Could not find product node");Rt._.getInstance().resolveBootstrapData(i.productId).pipe((0,E.s)(1)).subscribe({next:function(t){var n=It.eE.getItems(t.getMaterials()),r={};n.forEach((function(e){r[e.id]=e})),e(r)},error:function(e){r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return le.apply(this,arguments)})},{key:"resolveMaterialManager",value:(ce=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){return n.findProductNode(t)?e(en.J.getManager(en.n.MaterialManager)):r("Could not find product node")})));case 1:case"end":return e.stop()}}),e)}))),function(e){return ce.apply(this,arguments)})},{key:"resolveTextures",value:(ue=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=n.findProductNode(t);if(!i)return r("Could not find product node");Rt._.getInstance().resolveBootstrapData(i.productId).pipe((0,E.s)(1)).subscribe({next:function(t){var n=It.eE.getItems(t.getMedia()),r={};n.forEach((function(e){r[e.id]=e})),e(r)},error:function(e){r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return ue.apply(this,arguments)})},{key:"resolveSvgElementBoundaries",value:(se=(0,n.A)(i().mark((function e(t,n,r){var a,o,s,u,c,l,h,f;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.findProductNode(r)){e.next=3;break}throw new Error("Could not find product node");case 3:if(o=a.getComponent("attributeManager")){e.next=6;break}throw new Error("Cound not find attribute manager");case 6:return e.next=8,(0,y._)(o.resolveAttributeManager());case 8:if(s=e.sent,u=s.getAttributeController(t)){e.next=12;break}throw new Error("Could not resolve attribute controller");case 12:if(u instanceof Er){e.next=14;break}throw new Error("Attribute controller is not an SVG Canvas attribute controller");case 14:if(c=u.getValue()){e.next=17;break}throw new Error("Could not resolve attribute value");case 17:if("number"==typeof(l=c.print_ready_file_id)){e.next=20;break}throw new Error("Could not resolve print-ready file id");case 20:return e.next=22,u.resolveSvgTextureController(l);case 22:return h=e.sent,e.next=25,h.getBoundaries(n);case 25:if(f=e.sent){e.next=28;break}throw new Error("Could not resolve boundary for element");case 28:return e.abrupt("return",f);case 29:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return se.apply(this,arguments)})},{key:"getAttributeById",value:(oe=(0,n.A)(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getProductAttributes();case 2:if(n=e.sent){e.next=5;break}throw new Error("Invalid product for retrieving attributes.");case 5:if(r=n.find((function(e){return e.id===t}))){e.next=8;break}throw new Error("Attribute not found on product.");case 8:return e.abrupt("return",r);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return oe.apply(this,arguments)})},{key:"getProductAttributes",value:(ae=(0,n.A)(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveAttributeManager(n);case 5:if(r=e.sent,a=r.getAttributes(),!Rc.getInstance().hasHook("product-attributes")){e.next=11;break}return e.next=10,Rc.getInstance().executeHook("product-attributes",a);case 10:a=e.sent;case 11:return e.abrupt("return",a);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return ae.apply(this,arguments)})},{key:"getMatgroupOptions",value:(ie=(0,n.A)(i().mark((function e(t){var n,r,a,o,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAttributeById(t);case 2:if((n=e.sent)&&"matgroup"===n.type){e.next=5;break}throw new Error("Material group attribute not found on product.");case 5:if((r=n.attribute_values)&&0!==r.length){e.next=8;break}throw new Error("Material group attribute not found on product.");case 8:if(a=r[0].attribute_value_valuable){e.next=11;break}throw new Error("Material group attribute not found on product.");case 11:if(o=a.material_group){e.next=14;break}throw new Error("Material group attribute not found on product.");case 14:if(s=o.materials){e.next=17;break}throw new Error("Material group attribute not found on product.");case 17:return e.abrupt("return",s.data.map((function(e){return e.attributes})));case 18:case"end":return e.stop()}}),e,this)}))),function(e){return ie.apply(this,arguments)})},{key:"getColorOptions",value:(ee=(0,n.A)(i().mark((function e(t){var n,r,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAttributeById(t);case 2:if((n=e.sent)&&"color"===n.type){e.next=5;break}throw new Error("Color attribute not found on product.");case 5:if((r=n.attribute_values)&&0!==r.length){e.next=8;break}throw new Error("Color attribute not found on product.");case 8:if(a=r[0].attribute_value_valuable){e.next=11;break}throw new Error("Color attribute not found on product.");case 11:if(o=a.colors){e.next=14;break}throw new Error("Color attribute not found on product.");case 14:return e.abrupt("return",o);case 15:case"end":return e.stop()}}),e,this)}))),function(e){return ee.apply(this,arguments)})},{key:"getQuestionOptions",value:(J=(0,n.A)(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAttributeById(t);case 2:if((n=e.sent)&&"question"===n.type){e.next=5;break}throw new Error("Question attribute not found on product.");case 5:if(r=n.attribute_values){e.next=8;break}throw new Error("Question attribute not found on product.");case 8:return e.abrupt("return",r);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return J.apply(this,arguments)})},{key:"setProductAttribute",value:(Z=(0,n.A)(i().mark((function e(t,n,r){var a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.findProductNode(r)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveAttributeManager(a);case 5:return o=e.sent,e.next=8,o.setValue(t,n,{emitEvent:!0,rebuild:!0});case 8:return e.abrupt("return",o.getAttribute(t));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return Z.apply(this,arguments)})},{key:"setProductAttributeNamed",value:($=(0,n.A)(i().mark((function e(t,n,r){var a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.findProductNode(r)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveAttributeManager(a);case 5:return o=e.sent,e.next=8,o.setValueByName(t,n,{emitEvent:!0,rebuild:!0});case 8:return e.abrupt("return",o.getValueByName(t));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return $.apply(this,arguments)})},{key:"setProductAttributeByKey",value:(Y=(0,n.A)(i().mark((function e(t,n,r){var a,o,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=String(t),t&&0!==a.length){e.next=3;break}throw new Error("Invalid attribute key.");case 3:if(o=this.findProductNode(r)){e.next=6;break}throw new Error("Could not find product node");case 6:return e.next=8,this.resolveAttributeManager(o);case 8:return(s=e.sent).setValueByKey(a,n,{emitEvent:!0,rebuild:!0}),e.abrupt("return",s.getValueByKey(a));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return Y.apply(this,arguments)})},{key:"resetProductAttribute",value:(X=(0,n.A)(i().mark((function e(t,n){var r,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=h.N5.resolveInt(t),Number.isFinite(r)){e.next=3;break}throw new Error("Invalid attribute id.");case 3:if(a=this.findProductNode(n)){e.next=6;break}throw new Error("Could not find product node");case 6:return e.next=8,this.resolveAttributeManager(a);case 8:return(o=e.sent).resetValue(t),e.abrupt("return",o.getAttribute(t));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return X.apply(this,arguments)})},{key:"getActiveMaterial",value:(W=(0,n.A)(i().mark((function e(t,n){var r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.findProductNode(n)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveMaterialGroupManager(r);case 5:return a=e.sent,e.abrupt("return",a.getActiveRefId(t));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return W.apply(this,arguments)})},{key:"setActiveMaterial",value:(q=(0,n.A)(i().mark((function e(t,n,r){var a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.findProductNode(r)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveMaterialGroupManager(a);case 5:return o=e.sent,e.next=8,o.setActiveMaterial(t,n);case 8:return e.abrupt("return",o.getActiveRefId(t));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return q.apply(this,arguments)})},{key:"applyActiveMaterial",value:(H=(0,n.A)(i().mark((function e(t,n,r){var a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.findProductNode(r)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveMaterialGroupManager(a);case 5:return o=e.sent,e.next=8,o.setActiveMaterialByMaterialId(t,n);case 8:return e.abrupt("return",o.getActiveRefId(t));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return H.apply(this,arguments)})},{key:"registerPriceCalculator",value:(z=(0,n.A)(i().mark((function e(t,n){var r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.findProductNode(n)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolvePriceManager(r);case 5:e.sent.registerPriceCalculator(t);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return z.apply(this,arguments)})},{key:"getPrice",value:(V=(0,n.A)(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolvePriceManager(n);case 5:return r=e.sent,v.UX.print("calculate price with manager: ",r),e.next=9,r.requestPrice();case 9:return a=e.sent,e.abrupt("return",a.totals.base);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return V.apply(this,arguments)})},{key:"getAllPrices",value:(U=(0,n.A)(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolvePriceManager(n);case 5:return r=e.sent,v.UX.print("calculate price with manager: ",r),e.next=9,r.requestPrice();case 9:return a=e.sent,e.abrupt("return",a.totals);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return U.apply(this,arguments)})},{key:"requestSupportedLocales",value:(j=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){Ac.getInstance().getSupportedLocales().then((function(t){e(t)})).catch((function(e){t(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return j.apply(this,arguments)})},{key:"setNodeProperty",value:(L=(0,n.A)(i().mark((function e(t,n,r){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){try{var a=R.K.sceneManager().findNodesOfType(Hs.i.TypeRTTI,(function(e){return e.getValue("name")===t}));a.forEach((function(e){e.setValue(n,r)})),e(a.length)}catch(e){i(e)}})));case 1:case"end":return e.stop()}}),e)}))),function(e,t,n){return L.apply(this,arguments)})},{key:"getSceneObj",value:(N=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){t("This API is obsolete.")})));case 1:case"end":return e.stop()}}),e)}))),function(){return N.apply(this,arguments)})},{key:"getActiveCamera",value:(F=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){try{var n=R.K.sceneManager().findNodesOfType(We.TypeRTTI);if(0===n.length)return t("No cameras in scene");var r=n[0],i=R.K.sceneManager().getActiveCameraId();if(i)for(var a=0;a<n.length;a++)if(n[a].getSceneObjectId()===i){r=n[a];break}e(r.serialize(!1))}catch(e){t(e)}})));case 1:case"end":return e.stop()}}),e)}))),function(){return F.apply(this,arguments)})},{key:"changeCameraZoom",value:(B=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){try{var r=R.K.sceneManager().getActiveCamera();if(!r)return n("No active camera in scene");var i=r.transform.position.clone().sub(r.target).normalize(),a=r.transform.position.distanceTo(r.target),o=r.getValue("min_zoom")||.001,s=r.getValue("max_zoom"),u=Math.min(s,Math.max(o,a+t));r.transform.position.copy(r.target.clone().addScaledVector(i,u)),r.transform.updateMatrix(),r.markNeedsRenderUpdate(),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)),e(u)}catch(e){n(e)}})));case 1:case"end":return e.stop()}}),e)}))),function(e){return B.apply(this,arguments)})},{key:"loadPreset",value:(P=(0,n.A)(i().mark((function e(t,n){var r,a,o,s,u,c=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node");case 3:return R.K.eventBus().dispatch(new K.r(Q.E.LoadConfigurationStarted)),e.prev=4,e.next=7,el.getInstance().find(n);case 7:o=e.sent,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),v.UX.error(e.t0);case 13:if(null!==(r=o)&&void 0!==r&&r.configuration){e.next=16;break}throw R.K.eventBus().dispatch(new K.r(Q.E.LoadConfigurationFinished)),new Error("preset not loaded");case 16:if((s=new A).sanitizeConfiguration(o.configuration),u=o.configuration.configured_products.find((function(e){return Number(e.catalogue_id)===a.productId}))){e.next=22;break}throw R.K.eventBus().dispatch(new K.r(Q.E.LoadConfigurationFinished)),new Error("preset doesn't container catalogue id");case 22:return R.K.stateRegistery().dispatch("reconfigure",!0),e.prev=23,e.next=26,s.load(a,u,(function(e){c.mAppViewer.propagateEvent("progress_reconfigure",Math.floor(100*e))}));case 26:R.K.stateRegistery().dispatch("reconfigure",!1),R.K.eventBus().dispatch(new K.r(Q.E.LoadConfigurationFinished)),e.next=36;break;case 30:throw e.prev=30,e.t1=e.catch(23),v.UX.error("Could not parse configuration of preset.",e.t1),R.K.stateRegistery().dispatch("reconfigure",!1),R.K.eventBus().dispatch(new K.r(Q.E.LoadConfigurationFinished)),e.t1;case 36:case"end":return e.stop()}}),e,this,[[4,10],[23,30]])}))),function(e,t){return P.apply(this,arguments)})},{key:"selectProductNode",value:(D=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){if(void 0===t)return n.mAppViewer.deselect(),e(void 0);var i=n.findProductNode(t);if(!i)return r("Could not find product node");n.mAppViewer.select(i),e(i)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return D.apply(this,arguments)})},{key:"deselect",value:(O=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){e(t.mAppViewer.deselect())})));case 1:case"end":return e.stop()}}),e)}))),function(){return O.apply(this,arguments)})},{key:"autoRotationYAxis",value:(I=(0,n.A)(i().mark((function e(t){var n,r,a,o=this,s=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=!(s.length>1&&void 0!==s[1])||s[1],r=s.length>2&&void 0!==s[2]?s[2]:1,a=s.length>3&&void 0!==s[3]?s[3]:360,e.abrupt("return",new Promise((function(e,i){var s=o.findProductNode(t);if(!s)return i("Could not find product node");o.mAppViewer.addPlayRotation(s,n,r,a),e(s)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return I.apply(this,arguments)})},{key:"deleteNode",value:(C=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=n.findProductNode(t);if(!i)return r("Could not find product node");var a=R.K.sceneManager().getRootProductNode();if(i.getSceneObjectId()===a.getSceneObjectId())return r("Unable to delete product node as it is root node.");n.mAppViewer.deselect(),R.K.sceneManager().removeNode(i),e(i)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return C.apply(this,arguments)})},{key:"resolveProductNodes",value:(S=(0,n.A)(i().mark((function e(){var t,n=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]&&n[0],e.abrupt("return",new Promise((function(e){var n=R.K.sceneManager().findNodesOfType(kt.i.TypeRTTI);if(t)return e(n);var r=[];n.forEach((function(e){var t=e.findParentOfType(ss.TypeRTTI);t&&!t.isViewVisible()||r.push(e)})),e(r)})));case 2:case"end":return e.stop()}}),e)}))),function(){return S.apply(this,arguments)})},{key:"getCatalogueProducts",value:(x=(0,n.A)(i().mark((function e(t,n,r,a){var o,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=null===(o=R.K.settingsManager())||void 0===o?void 0:o.getSceneSettingsRendererType(),e.abrupt("return",bc.getInstance().resolveProducts(t,n,["categories"],r,a,s));case 2:case"end":return e.stop()}}),e)}))),function(e,t,n,r){return x.apply(this,arguments)})},{key:"searchCatalogueProducts",value:(T=(0,n.A)(i().mark((function e(t,n,r){var a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=null===(a=R.K.settingsManager())||void 0===a?void 0:a.getSceneSettingsRendererType(),e.abrupt("return",bc.getInstance().search(t,n,["categories"],r,o));case 2:case"end":return e.stop()}}),e)}))),function(e,t,n){return T.apply(this,arguments)})},{key:"getCatalogueProductById",value:(w=(0,n.A)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",bc.getInstance().resolveProduct(t,n));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return w.apply(this,arguments)})},{key:"getCataloguePresentation",value:(k=(0,n.A)(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveCatalogueSettingsManager(n);case 5:return r=e.sent,e.next=8,r.resolveSettings().toPromise();case 8:return a=e.sent,e.abrupt("return",a.getProductPresentationSettings());case 10:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"usesCatalogueBrowser",value:(M=(0,n.A)(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveCatalogueSettingsManager(n);case 5:return r=e.sent,e.next=8,r.resolveSettings().toPromise();case 8:return a=e.sent,e.abrupt("return",!0===a.getCatalogueMeta().catalogBrowser);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return M.apply(this,arguments)})},{key:"getCameraTransform",value:(_=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){var n=R.K.sceneManager().getActiveCamera();if(!n)return t("Active camera not found.");n.updateMatrixLocal(!0),n.updateMatrixWorld(),e(n.transform.clone())})));case 1:case"end":return e.stop()}}),e)}))),function(){return _.apply(this,arguments)})},{key:"setCameraTransform",value:(b=(0,n.A)(i().mark((function e(t,n){var r=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var i=R.K.sceneManager().getActiveCamera();if(t.position&&i.transform.position.copy(new te.P(t.position.x,t.position.y,t.position.z)),t.rotation?i.transform.rotation.copy(new re.O(t.rotation.x,t.rotation.y,t.rotation.z)):t.quaternion&&i.transform.quaternion.copy(new ne.P(t.quaternion.x,t.quaternion.y,t.quaternion.z,t.quaternion.w)),t.scale&&i.transform.scale.copy(new te.P(t.scale.x,t.scale.y,t.scale.z)),n){var a=new te.P(n.x,n.y,n.z),o=r.mAppViewer.getClientViewer().getViewportRenderer().getComponent("controls");o&&o.isTypeName("ViewportControllerOrbitControls")&&o.updateTarget(a)}return i.markNeedsRenderUpdate(),e()})));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return b.apply(this,arguments)})},{key:"addProduct",value:(g=(0,n.A)(i().mark((function e(t,n,r){var a,o,s,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=null,!n||!n.presetId){e.next=7;break}return s=String(n.presetId),e.next=5,el.getInstance().find(s);case 5:(u=e.sent)&&u.configuration&&(o=u.configuration.configured_products[0]);case 7:return r&&o&&(o=Object.assign(o,r)),(c=R.K.sceneManager().createObject("product",void 0,t,!0,null!==(a=o)&&void 0!==a?a:r)).setValue("name","Product id:".concat(t)),(l=null==n?void 0:n.transform)&&(l.position&&c.transform.position.copy(new te.P(l.position.x,l.position.y,l.position.z)),l.rotation?c.transform.rotation.copy(new re.O(l.rotation.x,l.rotation.y,l.rotation.z)):l.quaternion&&c.transform.quaternion.copy(new ne.P(l.quaternion.x,l.quaternion.y,l.quaternion.z,l.quaternion.w)),l.scale&&c.transform.scale.copy(new te.P(l.scale.x,l.scale.y,l.scale.z))),r&&r.clipping_plane&&c.setValue("clipping_plane",r.clipping_plane),r&&r.place_holder&&c.setValue("place_holder",r.place_holder),R.K.commandManager().execute(new vc(c,R.K.sceneManager().getScene(),!1,!0)),e.abrupt("return",c.getObjectUUID());case 16:case"end":return e.stop()}}),e)}))),function(e,t,n){return g.apply(this,arguments)})},{key:"moveProduct",value:(d=(0,n.A)(i().mark((function e(t,n){var r=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var i=r.findProductNode(t);if(!i)throw new Error("Could not find product node.");if(n.position){var a=new te.P(Number(n.position.x),Number(n.position.y),Number(n.position.z));i.transform.position.copy(a)}if(n.rotation){var o=new re.O(Number(n.rotation.x),Number(n.rotation.y),Number(n.rotation.z));i.transform.rotation.copy(o)}else if(n.quaternion){var s=new ne.P(Number(n.quaternion.x),Number(n.quaternion.y),Number(n.quaternion.z),Number(n.quaternion.w));i.transform.quaternion.copy(s)}if(n.scale){var u=new te.P(Number(n.scale.x),Number(n.scale.y),Number(n.scale.z));i.transform.scale.copy(u)}i.transform.updateMatrix(),i.markNeedsRenderUpdate(),e()})));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return d.apply(this,arguments)})},{key:"removeProduct",value:(p=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=n.findProductNode(t);if(!i)return r("Could not find product node");var a=R.K.sceneManager().getRootProductNode();if(i.getSceneObjectId()===a.getSceneObjectId())return r("Unable to delete product node as it is root node.");R.K.sceneManager().removeNode(i,!1),e()})));case 1:case"end":return e.stop()}}),e)}))),function(e){return p.apply(this,arguments)})},{key:"dispatch",value:(f=(0,n.A)(i().mark((function e(t,n,r){var a=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){var o=a.findProductNode(r);try{switch(t){case"client_ready":l.N.completePromise(a.mAppViewer.onClientReady()).then((function(){e()}),(function(e){i(e)}));break;case"question_changed":if(!n||Number.isNaN(n.option_id))return i("Invalid payload: ".concat(JSON.stringify(n)));var s=h.N5.resolveInt(n.option_id),u=Boolean(n.visible),c=o?o.getSceneObjectId():void 0;R.K.eventBus().dispatch(new K.r(Q.E.ProductQuestionChanged,{question:s,visible:u,product_scene_id:c})),e();break;case"render_frame":window.setTimeout((function(){R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)),e()}),0);break;case"transformMode":var f=String(n);R.K.eventBus().dispatch(new K.r(Q.E.TransformModeChanged,f)),e();break;case"visibility":if(!o)return i("Could not find product node");switch(String(n.type)){case"lines":o.dispatchMessage(new m.Sc(n.visible,uc.TypeRTTI));break;case"fire":o.dispatchMessage(new m.Sc(n.visible,fc.TypeRTTI))}window.setTimeout((function(){R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)),e()}),0);break;case"drag":switch(String(n.type)){case"start":a.mAppViewer.getClientViewer().onItemDragStart(n.event);break;case"moved":a.mAppViewer.getClientViewer().onItemDragMove(n.event);break;case"end":a.mAppViewer.getClientViewer().onItemDragEnd(n.event)}window.setTimeout((function(){R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)),e()}),0);break;default:i("Unknown dispatch type: ".concat(t))}}catch(e){i(e)}})));case 1:case"end":return e.stop()}}),e)}))),function(e,t,n){return f.apply(this,arguments)})},{key:"findProductNode",value:function(e){var t,n=h.N5.resolveInt(e),r=h.N5.resolveUuid(e);return void 0===r&&void 0===n?R.K.sceneManager().getRootProductNode():(R.K.sceneManager().findNodesOfType(kt.i.TypeRTTI).every((function(e){return r&&e.getObjectUUID()===r?(t=e,!1):!(!r&&e.getSceneObjectId()===n)||(t=e,!1)})),t)}},{key:"resolveConfigurableNode",value:(o=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=n.findProductNode(t);if(!i)return r("Failed to get configurable node");i.onConfigurableNodeReady.pipe((0,E.s)(1)).subscribe({next:function(t){e(t)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})},{key:"resolveAttributeManager",value:(a=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.getComponent("attributeManager").resolveAttributeManager().pipe((0,E.s)(1)).subscribe({next:function(t){e(t)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"resolveMaterialGroupManager",value:(r=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.getComponent("materialGroupManager").resolveMaterialGroups().pipe((0,E.s)(1)).subscribe({next:function(t){e(t)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"resolvePriceManager",value:(t=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){e(t.getComponent("priceManager"))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"resolveCatalogueSettingsManager",value:(e=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){e(t.getComponent("catalogueSettings"))})));case 1:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)})}]);var e,t,r,a,o,f,p,d,g,b,_,M,k,w,T,x,S,C,I,O,D,P,B,F,N,L,j,U,V,z,H,q,W,X,Y,$,Z,J,ee,ie,ae,oe,se,ue,ce,le,he,fe,me}();function rl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rl=function(){return!!e})()}function il(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var al=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,rl()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"lightTechnique",Ot.UP.rectArea),(0,c.A)(n,"mWidth",10),(0,c.A)(n,"mHeight",10),n.mName="LightEntityRectArea",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){var n=Object.assign(il(t,"serialize",this,3)([e]),{type:"rectAreaLight"});return n.properties=Object.assign(n.properties,{light_width:this.mWidth,light_height:this.mHeight}),n}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"width":case"light_width":return this.mWidth=parseFloat(n),!0;case"height":case"light_height":return this.mHeight=parseFloat(n),!0}return il(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=il(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"width":case"light_width":return this.mWidth;case"height":case"light_height":return this.mHeight}return null}},{key:"width",get:function(){return this.mWidth},set:function(e){this.mWidth=e,this.markNeedsRenderUpdate()}},{key:"height",get:function(){return this.mHeight},set:function(e){this.mHeight=e,this.markNeedsRenderUpdate()}}])}(jt);function ol(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ol=function(){return!!e})()}(0,c.A)(al,"TypeRTTI",new le.O("LightEntityRectArea",jt.TypeRTTI));var sl=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,ol()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"renderTechnique",Ot._1.primitive_sphere),n.mName="PrimitiveEntitySphere",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,se.A)((0,oe.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"sphere"});var n,r,i,a,o}}])}(ac);function ul(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ul=function(){return!!e})()}(0,c.A)(sl,"TypeRTTI",new le.O("PrimitiveEntitySphere",ac.TypeRTTI));var cl=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,ul()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"renderTechnique",Ot._1.primitive_plane),n.mName="PrimitiveEntityPlane",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,se.A)((0,oe.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"plane"});var n,r,i,a,o}}])}(ac);function ll(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ll=function(){return!!e})()}(0,c.A)(cl,"TypeRTTI",new le.O("PrimitiveEntityPlane",ac.TypeRTTI));var hl=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,ll()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"renderTechnique",Ot._1.primitive_box),n.mName="PrimitiveEntityBox",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,se.A)((0,oe.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"box"});var n,r,i,a,o}}])}(ac);function fl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fl=function(){return!!e})()}(0,c.A)(hl,"TypeRTTI",new le.O("PrimitiveEntityBox",ac.TypeRTTI));var ml=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,fl()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"renderTechnique",Ot._1.effect_water),n.mName="ShaderEntityWater",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,se.A)((0,oe.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"water"});var n,r,i,a,o}}])}(lc);function pl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pl=function(){return!!e})()}function dl(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(ml,"TypeRTTI",new le.O("ShaderEntityWater",lc.TypeRTTI));var vl=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,pl()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"renderTechnique",Ot._1.effect_glare),(0,c.A)(n,"mEdgesRebuild",!1),(0,c.A)(n,"mEdges",4),(0,c.A)(n,"mSize",1),(0,c.A)(n,"mBlur",2),(0,c.A)(n,"mExtension",0),(0,c.A)(n,"mColor",Ft.v.White()),(0,c.A)(n,"mFlareColor",Ft.v.White()),(0,c.A)(n,"mAlpha",1),(0,c.A)(n,"mAngle",1),n.mName="ShaderEntityGlare",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"edges":return this.mEdges=parseInt(n,10),this.markEdgesRebuild(),!0;case"size":return this.mSize=parseFloat(n),this.markEdgesRebuild(),!0;case"blur":return this.mBlur=parseFloat(n),!0;case"extension":return this.mExtension=parseFloat(n),!0;case"alpha":return this.mAlpha=parseFloat(n),!0;case"angle":return this.mAngle=parseFloat(n),!0;case"color":return n instanceof Ft.v?this.mColor.copy(n):this.mColor.set(n),!0;case"flare":case"flareColor":return n instanceof Ft.v?this.mFlareColor.copy(n):this.mFlareColor.set(n),!0}return dl(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=dl(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"edges":return this.mEdges;case"size":return this.mSize;case"blur":return this.mBlur;case"extension":return this.mExtension;case"alpha":return this.mAlpha;case"angle":return this.mAngle;case"color":return this.mColor;case"flare":case"flareColor":return this.mFlareColor}return null}},{key:"serialize",value:function(e){var n=Object.assign(dl(t,"serialize",this,3)([e]),{type:"glare"});return n.properties=Object.assign(n.properties,{edges:this.mEdges,size:this.mSize,blur:this.mBlur,extension:this.mExtension,alpha:this.mAlpha,angle:this.mAngle,color:this.mColor.getHexString(),flareColor:this.mFlareColor.getHexString()}),n}},{key:"edges",get:function(){return this.mEdges},set:function(e){this.mEdges=e,this.markNeedsRenderUpdate()}},{key:"size",get:function(){return this.mSize},set:function(e){this.mSize=e,this.markNeedsRenderUpdate()}},{key:"blur",get:function(){return this.mBlur},set:function(e){this.mBlur=e,this.markNeedsRenderUpdate()}},{key:"extension",get:function(){return this.mExtension},set:function(e){this.mExtension=e,this.markNeedsRenderUpdate()}},{key:"alpha",get:function(){return this.mAlpha},set:function(e){this.mAlpha=e,this.markNeedsRenderUpdate()}},{key:"angle",get:function(){return this.mAngle},set:function(e){this.mAngle=e,this.markNeedsRenderUpdate()}},{key:"color",get:function(){return this.mColor},set:function(e){this.mColor.copy(e),this.markNeedsRenderUpdate()}},{key:"flareColor",get:function(){return this.mFlareColor},set:function(e){this.mFlareColor.copy(e),this.markNeedsRenderUpdate()}},{key:"needsEdgesRebuild",value:function(){return this.mEdgesRebuild}},{key:"setNeedsEdgesRebuild",value:function(e){this.mEdgesRebuild=e,this.markNeedsRenderUpdate()}},{key:"markEdgesRebuild",value:function(){this.setNeedsEdgesRebuild(!0)}}])}(lc);function yl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yl=function(){return!!e})()}(0,c.A)(vl,"TypeRTTI",new le.O("ShaderEntityGlare",lc.TypeRTTI));var gl=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,yl()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"renderTechnique",Ot._1.effect_flare),n.mName="ShaderEntityFlare",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,se.A)((0,oe.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"flare"});var n,r,i,a,o}}])}(lc);function bl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bl=function(){return!!e})()}function Al(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(gl,"TypeRTTI",new le.O("ShaderEntityFlare",lc.TypeRTTI));var _l=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,bl()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"renderTechnique",Ot._1.effect_skycube),(0,c.A)(n,"mTextureIds",{}),n.mName="ShaderEntitySkyCube",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"skycube_tex_0":return this.mTextureIds[0]=(0,P.isNullOrUndefined)(n)?null:parseInt(n,10),!0;case"skycube_tex_1":return this.mTextureIds[1]=(0,P.isNullOrUndefined)(n)?null:parseInt(n,10),!0;case"skycube_tex_2":return this.mTextureIds[2]=(0,P.isNullOrUndefined)(n)?null:parseInt(n,10),!0;case"skycube_tex_3":return this.mTextureIds[3]=(0,P.isNullOrUndefined)(n)?null:parseInt(n,10),!0;case"skycube_tex_4":return this.mTextureIds[4]=(0,P.isNullOrUndefined)(n)?null:parseInt(n,10),!0;case"skycube_tex_5":return this.mTextureIds[5]=(0,P.isNullOrUndefined)(n)?null:parseInt(n,10),!0}return Al(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Al(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"skycube_tex_0":return this.mTextureIds[0];case"skycube_tex_1":return this.mTextureIds[1];case"skycube_tex_2":return this.mTextureIds[2];case"skycube_tex_3":return this.mTextureIds[3];case"skycube_tex_4":return this.mTextureIds[4];case"skycube_tex_5":return this.mTextureIds[5]}return null}},{key:"getTextureIds",value:function(){return this.mTextureIds}},{key:"serialize",value:function(e){var n=Object.assign(Al(t,"serialize",this,3)([e]),{type:"skycube"});return n.properties=Object.assign(n.properties,{skycube_tex_0:this.mTextureIds[0],skycube_tex_1:this.mTextureIds[1],skycube_tex_2:this.mTextureIds[2],skycube_tex_3:this.mTextureIds[3],skycube_tex_4:this.mTextureIds[4],skycube_tex_5:this.mTextureIds[5]}),n}}])}(lc);function Ml(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ml=function(){return!!e})()}function kl(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(_l,"TypeRTTI",new le.O("ShaderEntitySkyCube",lc.TypeRTTI));var wl=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,Ml()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"renderTechnique",Ot._1.effect_skyequirect),(0,c.A)(n,"mTextureId",void 0),n.mName="ShaderEntitySkyEquirect",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){return"skycube_tex_0"===e?(this.mTextureId=(0,P.isNullOrUndefined)(n)?null:parseInt(n,10),!0):kl(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=kl(t,"proxyGetValue",this,3)([e]);return null!==n?n:"skycube_tex_0"===e?this.mTextureId:null}},{key:"getTextureId",value:function(){return this.mTextureId}},{key:"serialize",value:function(e){var n=Object.assign(kl(t,"serialize",this,3)([e]),{type:"skyequirect"});return n.properties=Object.assign(n.properties,{skycube_tex_0:this.mTextureId}),n}}])}(lc);function Tl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Tl=function(){return!!e})()}function xl(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(wl,"TypeRTTI",new le.O("ShaderEntitySkyEquirect",lc.TypeRTTI));var Sl,Cl,El=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Tl()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mTarget",new te.P(0,0,1)),(0,c.A)(e,"mClippingPlaneUuid",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"onDetached",value:function(e){xl(t,"onDetached",this,3)([e]),this.detachClippingPlaneFromProduct()}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"position_x":case"position_y":case"position_z":case"position":this.updatePlane();break;case"target":return n instanceof te.P?this.mTarget.copy(n):Array.isArray(n)&&n.length>2&&this.mTarget.fromArray(n),this.updatePlane(),!0;case"clip_target_x":case"target_x":return this.mTarget.x=parseFloat(n),this.updatePlane(),!0;case"clip_target_y":case"target_y":return this.mTarget.y=parseFloat(n),this.updatePlane(),!0;case"clip_target_z":case"target_z":return this.mTarget.z=parseFloat(n),this.updatePlane(),!0}return xl(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=xl(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"target":return this.mTarget;case"target_x":return this.mTarget.x;case"target_y":return this.mTarget.y;case"target_z":return this.mTarget.z}return null}},{key:"detachClippingPlaneFromProduct",value:function(){if(this.mClippingPlaneUuid){var e=this.findParentOfType(kt.i.TypeRTTI);if(e){var t=e.getComponent("clippingController");t&&(t.removeClippingPlane(this.mClippingPlaneUuid),delete this.mClippingPlaneUuid)}}}},{key:"updatePlane",value:function(){var e=this.findParentOfType(kt.i.TypeRTTI);if(e){var t=e.getComponent("clippingController");if(t){var n=new te.P;this.transform.getWorldPosition(n);var r=this.getValue("target"),i=n.clone().sub(r);i.normalize(),this.mClippingPlaneUuid||(this.mClippingPlaneUuid=t.addClippingPlane(new eu.Z)),t.setFromNormalAndCoplanarPoint(this.mClippingPlaneUuid,i,n)}}}},{key:"onBeforeSceneUpdate",value:function(e){xl(t,"onBeforeSceneUpdate",this,3)([e]),this.updatePlane()}},{key:"serialize",value:function(e){var n=Object.assign(xl(t,"serialize",this,3)([e]),{type:"global_clipper"});return n.properties=Object.assign(n.properties,{clip_target_x:this.mTarget.x,clip_target_y:this.mTarget.y,clip_target_z:this.mTarget.z}),n}}])}(ce.S);function Rl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rl=function(){return!!e})()}function Il(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(El,"TypeRTTI",new le.O("ClippingEntity",ce.S.TypeRTTI)),(Cl=Sl||(Sl={})).RELATIVE="relative",Cl.FIXED="fixed",Cl.PROJECTION="projection";var Ol=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,Rl()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"onEdit",void 0),(0,c.A)(n,"renderTechnique",Ot._1.draw_ui),(0,c.A)(n,"mPositionType",Sl.FIXED),(0,c.A)(n,"mLocked",!1),(0,c.A)(n,"mEditable",!1),n.mName="UIEntity",n.mLayers.enable(2),n.onEdit=new M.B,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"position_type":return n&&(this.mPositionType=n),!0;case"locked":return this.mLocked=(0,h.Hn)(n),!0;case"editable":return this.mEditable=(0,h.Hn)(n),!0}return Il(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Il(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"position_type":return this.mPositionType;case"locked":return this.mLocked;case"editable":return this.mEditable}return null}},{key:"serialize",value:function(e){return Object.assign(Il(t,"serialize",this,3)([e]),{position_type:this.mPositionType?this.mPositionType:Sl.FIXED,locked:this.mLocked})}},{key:"makeEditable",value:function(){this.mEditable=!0,this.markNeedsRenderUpdate()}},{key:"makeUnEditable",value:function(){this.mEditable=!1,this.markNeedsRenderUpdate()}},{key:"editable",get:function(){return this.mEditable}},{key:"locked",get:function(){return this.mLocked},set:function(e){this.mLocked=e,this.markNeedsRenderUpdate()}},{key:"positionType",get:function(){return this.mPositionType},set:function(e){this.mPositionType=e,this.markNeedsRenderUpdate()}}])}(iu.a);function Dl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dl=function(){return!!e})()}function Pl(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Ol,"TypeRTTI",new le.O("UiEntity",iu.a.TypeRTTI));var Bl=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,Dl()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mTitle",void 0),(0,c.A)(n,"mMargin",5),(0,c.A)(n,"mColor",new Ft.v("#f06")),(0,c.A)(n,"mHoverColor",new Ft.v("#ca095e")),(0,c.A)(n,"mFontSize",16),(0,c.A)(n,"mTextColor",new Ft.v("000000")),n.mName="UiEntityButton",n.mTitle="Title",n.setValue("options",{}),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"color":return this.mColor.set(n),!0;case"hover":return this.mHoverColor.set(n),!0;case"textColor":return this.mTextColor.set(n),!0;case"fontSize":return this.mFontSize=parseInt(n,10),!0;case"margin":return this.mMargin=parseFloat(n),!0;case"title":return this.mTitle=n,!0;case"ui_options":case"options":try{var i=null;(i="string"==typeof n?JSON.parse(n):n).title&&(this.mTitle=i.title),void 0!==i.margin&&(this.mMargin=i.margin),void 0!==i.color&&this.mColor.set(i.color),void 0!==i.hover&&this.mHoverColor.set(i.hover),void 0!==i.fontSize&&(this.mFontSize=i.fontSize),void 0!==i.textColor&&this.mTextColor.set(i.textColor)}catch(e){return!1}return!0}return Pl(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){switch(e){case"title":return this.mTitle;case"margin":return this.mMargin;case"color":return this.mColor;case"hover":return this.mHoverColor;case"textColor":return this.mTextColor;case"fontSize":return this.mFontSize;case"ui_options":case"options":return{title:this.mTitle,margin:this.mMargin,color:this.mColor.getHexString(),hover:this.mHoverColor.getHexString(),fontSize:this.mFontSize,textColor:this.mTextColor.getHexString()}}return Pl(t,"proxyGetValue",this,3)([e])}},{key:"serialize",value:function(e){var n={title:this.mTitle,margin:this.mMargin,color:this.mColor.getHexString(),hover:this.mHoverColor.getHexString(),fontSize:this.mFontSize,textColor:this.mTextColor.getHexString()};return Object.assign(Pl(t,"serialize",this,3)([e]),{type:"uix_button",ui_options:JSON.stringify(n)})}}])}(Ol);function Fl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fl=function(){return!!e})()}function Nl(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Bl,"TypeRTTI",new le.O("UiEntityButton",Ol.TypeRTTI));var Ll=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,Fl()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mImageId",-1),(0,c.A)(n,"mSize",new ee.I(100,100)),n.mName="UiEntityImage",n.setValue("options",{}),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"image":case"image_id":return this.mImageId=(0,h.kf)(n)?parseInt(n,10):-1,!0;case"width":return this.mSize.x=parseFloat(n),!0;case"height":return this.mSize.y=parseFloat(n),!0;case"size":return n&&n instanceof ee.I?this.mSize.copy(n):n instanceof te.P||n instanceof Is.I?this.mSize.set(n.x,n.y):Array.isArray(n)&&n.length>1?this.mSize.fromArray(n):n&&!0===n.isVector2&&this.mSize.copy(n),!0;case"ui_options":case"options":try{var i=null;i="string"==typeof n?JSON.parse(n):n,i=Object.assign({image:-1,width:100,height:100},i),this.mImageId=i.image,this.mSize.copy(new ee.I(i.width,i.height))}catch(e){return!1}return!0}return Nl(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Nl(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"image":case"image_id":return this.mImageId;case"size":return this.mSize;case"width":return this.mSize.x;case"height":return this.mSize.y;case"ui_options":case"options":return{image:this.mImageId,width:this.mSize.x,height:this.mSize.y}}return null}},{key:"serialize",value:function(e){var n={image:this.mImageId,width:this.mSize.x,height:this.mSize.y};return Object.assign(Nl(t,"serialize",this,3)([e]),{type:"uix_image",ui_options:JSON.stringify(n)})}},{key:"imageId",get:function(){return this.mImageId},set:function(e){this.mImageId=e,this.markNeedsRenderUpdate()}}])}(Ol);function jl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jl=function(){return!!e})()}(0,c.A)(Ll,"TypeRTTI",new le.O("UiEntityImage",Ol.TypeRTTI));var Ul=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),(n=(0,ae.A)(r,jl()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a))).mName="UiEntityTag",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,se.A)((0,oe.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"uix_tag"});var n,r,i,a,o}}])}(Bl);function Vl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vl=function(){return!!e})()}function zl(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Ul,"TypeRTTI",new le.O("UiEntityTag",Bl.TypeRTTI));var Hl=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,Vl()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mPanelColor",new Ft.v("#f06")),(0,c.A)(n,"mLinkColor",new Ft.v("#00f")),(0,c.A)(n,"mLinkHoverColor",new Ft.v("#0000a0")),(0,c.A)(n,"mMargin",20),(0,c.A)(n,"mSize",new ee.I(200,200)),(0,c.A)(n,"mHtmlText",""),n.mName="UiEntityText",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"text":case"htmlText":return this.mHtmlText=n,!0;case"panelColor":return this.mPanelColor.set(n),!0;case"linkColor":return this.mLinkColor.set(n),!0;case"linkHover":return this.mLinkHoverColor.set(n),!0;case"margin":return this.mMargin=parseInt(n,10),!0;case"width":return this.mSize.x=parseInt(n,10),!0;case"height":return this.mSize.y=parseInt(n,10),!0;case"size":return n&&n instanceof ee.I?this.mSize.copy(n):n instanceof te.P||n instanceof Is.I?this.mSize.set(n.x,n.y):Array.isArray(n)&&n.length>1?this.mSize.fromArray(n):n&&!0===n.isVector2&&this.mSize.copy(n),!0;case"ui_options":case"options":try{var i=null;(i="string"==typeof n?JSON.parse(n):n).text&&(this.mHtmlText=i.text),i.size&&i.size instanceof ee.I?this.mSize.copy(i.size):(void 0!==i.width&&(this.mSize.x=i.width),void 0!==i.height&&(this.mSize.y=i.height)),void 0!==i.margin&&(this.mMargin=i.margin),void 0!==i.panelColor&&this.mPanelColor.set(i.panelColor),void 0!==i.linkColor&&this.mLinkColor.set(i.linkColor),void 0!==i.linkHover&&this.mLinkHoverColor.set(i.linkHover)}catch(e){return v.UX.error("UiEntityText: Unable to parse options:",e),!1}return!0}return zl(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=zl(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"htmlText":case"text":return this.mHtmlText;case"panelColor":return this.mPanelColor;case"linkColor":return this.mLinkColor;case"linkHover":return this.mLinkHoverColor;case"margin":return this.mMargin;case"ui_options":case"options":return{text:this.mHtmlText,panelColor:this.mPanelColor.getHexString(),linkColor:this.mLinkColor.getHexString(),linkHover:this.mLinkHoverColor.getHexString(),margin:this.mMargin,width:this.mSize.x,height:this.mSize.y};case"width":return this.mSize.x;case"height":return this.mSize.y;case"size":return this.mSize}return null}},{key:"serialize",value:function(e){var n={text:this.mHtmlText,panelColor:this.mPanelColor.getHexString(),linkColor:this.mLinkColor.getHexString(),linkHover:this.mLinkHoverColor.getHexString(),margin:this.mMargin,width:this.mSize.x,height:this.mSize.y};return Object.assign(zl(t,"serialize",this,3)([e]),{type:"uix_text",ui_options:JSON.stringify(n)})}}])}(Ol);function Gl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ql(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ql(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ql(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}(0,c.A)(Hl,"TypeRTTI",new le.O("UiEntityText",Ol.TypeRTTI));var Wl=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"calculate",value:(t=(0,n.A)(i().mark((function e(t,n,r,a){var o,s,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=r.getComponent("materialGroupManager"),e.next=3,(0,y._)(s.resolveMaterialGroups());case 3:return u=e.sent,c=u.getGroups(),l=0,c.forEach((function(e){var t=u.getActiveRefModel(e.id);t&&(0,h.kf)(t.price)&&(l+=Number(t.price))})),v.UX.print("Calculated material price:",l),t.totals=t.totals||{},t.totals.base=(null!==(o=t.totals.base)&&void 0!==o?o:0)+l,e.abrupt("return",t);case 11:case"end":return e.stop()}}),e)}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"breakDown",value:(e=(0,n.A)(i().mark((function e(t,n,r,a,o){var s,u,c,l,f,m,p,d;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=t.getComponent("materialGroupManager"),e.next=3,(0,y._)(s.resolveMaterialGroups());case 3:u=e.sent,c=u.getGroups(),l=[],f=Gl(c),e.prev=7,f.s();case 9:if((m=f.n()).done){e.next=19;break}if(p=m.value,(d=u.getActiveRefModel(p.id))&&(0,h.kf)(d.price)){e.next=14;break}return e.abrupt("continue",17);case 14:if(!n.excludePriceZero||0!==d.price){e.next=16;break}return e.abrupt("continue",17);case 16:l.push({id:d.id,price:d.price,name:d.name,material_id:d.material_id,material_name:d.material_name});case 17:e.next=9;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(7),f.e(e.t0);case 24:return e.prev=24,f.f(),e.finish(24);case 27:return e.abrupt("return",{materials:l});case 28:case"end":return e.stop()}}),e,null,[[7,21,24,27]])}))),function(t,n,r,i,a){return e.apply(this,arguments)})},{key:"getBreakDownName",value:function(){return"materials"}}]);var e,t}();__webpack_require__(84864),__webpack_require__(57465),__webpack_require__(87745);function Kl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Xl(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xl(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Xl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Yl=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mPricingRulesBreakDown",[])}),[{key:"calculate",value:(t=(0,n.A)(i().mark((function e(t,n,r,a){var o,s,u,c,l=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.getComponent("attributeManager"),e.next=3,(0,y._)(o.resolveAttributeManager());case 3:return s=e.sent,u=this.getApplicablePricingGroups(n),(c=t.totals||{}).base=c.base||0,u.sort((function(e,t){return e.priority-t.priority})),u.forEach((function(e){var n=l.applyPricingRules(e,t.articles,s);Object.keys(n).forEach((function(e){c[e]=c[e]||0,c[e]+=n[e]}))})),t.totals=c,e.abrupt("return",t);case 11:case"end":return e.stop()}}),e,this)}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"mapUnitToRatio",value:function(e){if(e)switch(e.toLowerCase()){case"km":return.001;case"hm":return.01;case"dam":return.1;case"m":return 1;case"dm":return 10;case"cm":return 100;case"mm":return 1e3}return 1}},{key:"applyPricingRules",value:function(e,t,n){var r=this,i=this.getApplicablePricingRules(e,t,n);this.mPricingRulesBreakDown=[],i.sort((function(e,t){return e.priority-t.priority}));var a={};i.forEach((function(e){a[e.priority]=a[e.priority]||[],a[e.priority].push(e)}));var o={base:0};return Object.keys(a).forEach((function(e){var t=Number(e);a[t].forEach((function(e){var t={};(0,h.kf)(e.adjustment)&&(t.base=e.adjustment),Array.isArray(e.pricing_rule_adjustment_fields)&&e.pricing_rule_adjustment_fields.forEach((function(e){e.pivot&&(0,h.kf)(e.pivot.adjustment)&&(t[e.name]=parseFloat(e.pivot.adjustment))}));var i=Object.keys(t),a=0;switch(e.type){case"compound":i.forEach((function(e){o[e]=o[e]||0,o[e]+=t[e],a+=t[e]}));break;case"rate":i.forEach((function(e){o[e]=o[e]||0,o[e]*=t[e],a+=o[e]*t[e]}));break;case"unit":if(null===e.attribute_id||void 0===e.attribute_id)break;var s=n.getAttributeController(e.attribute_id);if(!s)break;var u=s.getValueName();if(!(0,h.kf)(u))break;var c=1;if(s.getAttribute().attribute_values.length>0){var l=s.getAttribute().attribute_values[0].attribute_value_valuable;l&&(c=r.mapUnitToRatio(l.unit))}var f=r.mapUnitToRatio(e.unit),m=parseFloat(u);m*=f/c,i.forEach((function(e){o[e]=o[e]||0,o[e]+=m*t[e],a+=m*t[e]}))}r.mPricingRulesBreakDown.push({id:e.id,sku_pattern:e.sku_pattern,type:e.type,adjustment_price:a,pricing_fields:e.pricing_rule_adjustment_fields})}))})),o}},{key:"getApplicablePricingGroups",value:function(e){var t=e.price_matrix||[];return t=t.filter((function(t){Array.isArray(t.pricing_classes)||(t.pricing_classes=[]);var n=t.pricing_classes.filter((function(e){return"catalogue"===e.type}));return 0!==n.length&&!n.every((function(t){return e.modifier_classes.findIndex((function(e){return e.id===t.id}))<0}))}))}},{key:"getApplicablePricingRules",value:function(e,t,n){var r=this,i=e.pricing_rules||[],a=new Date,o=new Date(a.getFullYear(),a.getMonth(),a.getDate());i=(i=i.filter((function(e){var t=null!==e.starts_at&&void 0!==e.starts_at,n=null!==e.ends_at&&void 0!==e.ends_at,r=!t||new Date(e.starts_at.replace(/-/g,"/"))<=o,i=!n||new Date(e.ends_at.replace(/-/g,"/"))>=o;return r&&i}))).filter((function(e){if(null===e.condition_attribute_id||void 0===e.condition_attribute_id)return!0;var t=n.getAttributeController(e.condition_attribute_id);return t?t.compareValue(e.condition_attribute_value):(v.UX.warn("Could not verify condition."),!1)}));var s=[],u={};t.forEach((function(e){i.forEach((function(t){r.ruleMatchesModel(t,e)&&(u[t.id]=u[t.id]||0,u[t.id]+=1,s.push(t))}))}));var c={};return s=s.filter((function(e){var t=!0;return(0,h.kf)(e.components_limit)&&e.components_limit>1&&(t=u[e.id]>=e.components_limit),t&&e.unique&&(t=!0!==c[e.id],c[e.id]=!0),t}))}},{key:"ruleMatchesModel",value:function(e,t){if(null===t.price_sku||void 0===t.price_sku)return!1;if(null===e.sku_pattern||void 0===e.sku_pattern||"*"===e.sku_pattern||e.sku_pattern===t.price_sku)return!0;var n=!1;try{n=new RegExp("^".concat(e.sku_pattern.split("*").join(".*"),"$")).test(t.price_sku)}catch(e){v.UX.warn("Could not match pattern:",e)}return n}},{key:"breakDown",value:(e=(0,n.A)(i().mark((function e(t,n,r,a,o){var s,u,c,l,h,f,m,p;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=t.getComponent("attributeManager"),e.next=3,(0,y._)(s.resolveAttributeManager());case 3:u=e.sent,c=this.getApplicablePricingGroups(r),l=[],c.sort((function(e,t){return e.priority-t.priority})),h=Kl(c),e.prev=8,h.s();case 10:if((f=h.n()).done){e.next=20;break}if(m=f.value,this.applyPricingRules(m,a.articles,u),this.mPricingRulesBreakDown.length){e.next=15;break}return e.abrupt("continue",18);case 15:p=this.mPricingRulesBreakDown,!0===n.excludePriceZero&&(p=this.mPricingRulesBreakDown.filter((function(e){return e.adjustment_price>0}))),p.length&&l.push(p);case 18:e.next=10;break;case 20:e.next=25;break;case 22:e.prev=22,e.t0=e.catch(8),h.e(e.t0);case 25:return e.prev=25,h.f(),e.finish(25);case 28:return e.abrupt("return",{pricing_rules:l});case 29:case"end":return e.stop()}}),e,this,[[8,22,25,28]])}))),function(t,n,r,i,a){return e.apply(this,arguments)})},{key:"getBreakDownName",value:function(){return"pricing_rules"}}]);var e,t}();__webpack_require__(87220);function $l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$l(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ql=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"calculate",value:(e=(0,n.A)(i().mark((function e(t,n,r,a){var s,u,c,l,f,m,p,d,g,b,A,_,M,k,w,T,x,S,C,E,R;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"==typeof(l=n.settings.api_url)&&0!==l.length){e.next=4;break}return t.totals=t.totals||{},e.abrupt("return",t);case 4:return f=n.catalogue,m={product:{id:f.id,url_name:f.url_name,name:f.name,active:null===(s=f.active)||void 0===s||s,price:null!==(u=f.price)&&void 0!==u?u:0,sku:null!==(c=f.sku)&&void 0!==c?c:""},attributes:[],materials:[],components:[]},p=r.getComponent("attributeManager"),d=r.getComponent("materialGroupManager"),g=r.getComponent("articleListManager"),e.next=11,(0,y._)(gs([p.resolveAttributeManager(),d.resolveMaterialGroups()]));case 11:return b=e.sent,A=(0,o.A)(b,2),_=A[0],M=A[1],k=function(e){return"boolean"==typeof e.visible?e.visible:0!==e.visibility},w=_.getAttributeControllers(),m.attributes=w.map((function(e){var t=Zl({},e.getAttribute());return t.visible=k(t),Array.isArray(t.entity_properties)?(t.entity_properties.forEach((function(e){Array.isArray(e.values)&&e.values.length>0&&(!Array.isArray(e.entity_property_values)||e.entity_property_values.length<=0)&&(e.entity_property_values=e.values)})),t):t})),T=M.getGroups(),m.materials=T.map((function(e){return{group:e,activeRefModel:M.getActiveRefModel(e.id)}})).filter((function(e){return e.activeRefModel})).map((function(e){return Zl({},e.group)})),e.next=22,g.getModels();case 22:return x=e.sent,m.components=x.map((function(e){return{id:e.modelId,type:"configurable",name:e.name,description:e.description,sku:e.sku,price:e.price}})),S=J.k.getInstance().getAcceptLanguage(),C=J.k.uniqueInstance(),S&&(C.getHttpInstance().defaults.headers.common["Accept-Language"]=S),e.prev=27,e.next=30,C.post(l,m,{timeout:1e4});case 30:return E=e.sent,R=(0,h.kf)(E.data.price)?Number.parseFloat(E.data.price):0,v.UX.print("PriceApiCalculator: Price over API: ",R),t.totals=t.totals||{},t.totals.base+=R,e.abrupt("return",t);case 38:throw e.prev=38,e.t0=e.catch(27),v.UX.error("PriceApiCalculator: Something went wrong during retrieving price over API:",e.t0),e.t0;case 42:case"end":return e.stop()}}),e,null,[[27,38]])}))),function(t,n,r,i){return e.apply(this,arguments)})},{key:"breakDown",value:function(e,t,n,r,i){}},{key:"getBreakDownName",value:function(){return"price_api"}}]);var e}(),Jl=function(){function e(){(0,s.A)(this,e),(0,c.A)(this,"mCache",{})}return(0,u.A)(e,[{key:"getPrice",value:(a=(0,n.A)(i().mark((function e(t,n){var r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=f.V.Md5("".concat(t,"/").concat(JSON.stringify(n))),e.abrupt("return",this.resolveCache(r,t,n));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"request",value:(r=(0,n.A)(i().mark((function e(t,n){var r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=et.w.makeApiRoute("script_engine/catalogue/".concat(t,"/price/get")),e.next=3,J.k.getInstance().post(r,n).catch((function(e){return e.response})).then((function(e){return e.data}));case 3:if(!(a=e.sent).error){e.next=6;break}throw a;case 6:return e.abrupt("return",a);case 7:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})},{key:"resolveCache",value:(t=(0,n.A)(i().mark((function e(t,n,r){var a,o,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Date.now(),!(o=this.mCache[t])){e.next=5;break}return o.timestamp=a,e.abrupt("return",o.value);case 5:return s=this.request(n,r),this.mCache[t]={hash:t,timestamp:a,value:s},e.next=9,s;case 9:return this.clearOldCache(),e.abrupt("return",s);case 11:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"clearOldCache",value:function(){var t=this,n=e.MAX_CACHE,r=Object.entries(this.mCache);r.length<=n||r.sort((function(e,t){var n=(0,o.A)(e,2)[1];return(0,o.A)(t,2)[1].timestamp-n.timestamp})).splice(n).forEach((function(e){var n=(0,o.A)(e,1)[0];return delete t.mCache[n]}))}}],[{key:"getInstance",value:function(){return null===this._instance&&(this._instance=new this),this._instance}}]);var t,r,a}();(0,c.A)(Jl,"MAX_CACHE",100),(0,c.A)(Jl,"_instance",null);var eh=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mPricingFields",void 0)}),[{key:"calculate",value:(f=(0,n.A)(i().mark((function e(t,n,r,a){var o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.catalogue.id,e.next=3,this.getPrice(o,r,t.articles);case 3:return this.mPricingFields=e.sent,v.UX.print("Price over script engine:",this.mPricingFields),t.totals=t.totals||{},this.applyPricingFields(this.mPricingFields,t.totals),e.abrupt("return",t);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return f.apply(this,arguments)})},{key:"applyPricingFields",value:function(e,t){Object.keys(e).forEach((function(n){h.N5.isNumeric(e[n])&&(t[n]=t[n]||0,t[n]+=Number.parseFloat(e[n]))}))}},{key:"buildRequestPayload",value:(l=(0,n.A)(i().mark((function e(t,n){var r,a,s,u,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.resolveSerializedAttributes(t),this.resolveSerializedMaterials(t),J.k.getInstance().getAcceptLanguage()]);case 2:return r=e.sent,a=(0,o.A)(r,3),s=a[0],u=a[1],c=a[2],e.abrupt("return",{attributes:s,materials:u,articles:n,locale:c});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"resolveSerializedAttributes",value:(a=(0,n.A)(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.getComponent("attributeManager"),e.next=3,(0,y._)(n.resolveAttributeManager());case 3:return r=e.sent,e.abrupt("return",r.serialize({discard_hidden:!1,include_keys:!0,calculate_approximations:!1}));case 5:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"resolveSerializedMaterials",value:(r=(0,n.A)(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.getComponent("materialGroupManager"),e.abrupt("return",n.serialize());case 2:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"getPrice",value:(t=(0,n.A)(i().mark((function e(t,n,r){var a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.buildRequestPayload(n,r);case 2:return a=e.sent,e.abrupt("return",Jl.getInstance().getPrice(t,a));case 4:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"breakDown",value:(e=(0,n.A)(i().mark((function e(t,n,r,a,o){var s,u,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.calculate(a,r,t,o);case 2:return s=e.sent,u={pricingFields:this.mPricingFields},c=Object.assign(s,u),e.abrupt("return",{script_engine:c});case 6:case"end":return e.stop()}}),e,this)}))),function(t,n,r,i,a){return e.apply(this,arguments)})},{key:"getBreakDownName",value:function(){return"script_engine"}}]);var e,t,r,a,l,f}(),th=__webpack_require__(90593),nh=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"calculate",value:(t=(0,n.A)(i().mark((function e(t,n,r,a){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r=n.catalogue,i=0;(0,h.kf)(r.price)&&(i=+r.price),v.UX.print("base price"),t.totals=t.totals||{},t.totals.base=t.totals.base||0,t.totals.base+=i,e(t)})));case 1:case"end":return e.stop()}}),e)}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"getBreakDownName",value:function(){return"base"}},{key:"breakDown",value:(e=(0,n.A)(i().mark((function e(t,n,r,a,o){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var t=r.catalogue,n=0;(0,h.kf)(t.price)&&(n=+t.price),e({base:n})})));case 1:case"end":return e.stop()}}),e)}))),function(t,n,r,i,a){return e.apply(this,arguments)})}]);var e,t}();function rh(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ih(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ih(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ih(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ah=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"calculate",value:(t=(0,n.A)(i().mark((function e(t,n,r,a){var o,s,u,c,l,f,m;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.getComponent("attributeManager"),e.next=3,(0,y._)(o.resolveAttributeManager());case 3:s=e.sent,u=s.getAttributeControllers(),c=0,l=rh(u),e.prev=7,m=i().mark((function e(){var t,n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("question"===(t=f.value).getAttributeType()&&t.isVisible()){e.next=3;break}return e.abrupt("return",0);case 3:if(null!==(n=t.getAttribute()).selected_value_id&&void 0!==n.selected_value_id){e.next=6;break}return e.abrupt("return",0);case 6:(r=n.attribute_values.find((function(e){return e.id===n.selected_value_id})))&&(0,h.kf)(r.price)&&(c+=parseFloat(r.price));case 8:case"end":return e.stop()}}),e)})),l.s();case 10:if((f=l.n()).done){e.next=17;break}return e.delegateYield(m(),"t0",12);case 12:if(0!==e.t0){e.next=15;break}return e.abrupt("continue",15);case 15:e.next=10;break;case 17:e.next=22;break;case 19:e.prev=19,e.t1=e.catch(7),l.e(e.t1);case 22:return e.prev=22,l.f(),e.finish(22);case 25:return t.totals=t.totals||{},t.totals.base=t.totals.base||0,t.totals.base+=c,e.abrupt("return",t);case 29:case"end":return e.stop()}}),e,null,[[7,19,22,25]])}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"breakDown",value:(e=(0,n.A)(i().mark((function e(t,n,r,a,o){var s,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=t.getComponent("attributeManager"),e.next=3,(0,y._)(s.resolveAttributeManager());case 3:return u=e.sent,c=u.getAttributeControllers(),l=[],c.forEach((function(e){if("question"===e.getAttributeType()&&e.isVisible()){var t=e.getAttribute();if(null!==t.selected_value_id&&void 0!==t.selected_value_id){var r=t.attribute_values.find((function(e){return e.id===t.selected_value_id}));r&&(0,h.kf)(r.price)&&(!0===n.excludePriceZero&&0===r.price||l.push({attribute_id:t.id,attribute_name:t.name,attribute_key:t.key,attribute_value_id:r.id,attribute_value_name:r.name,attribute_value_key:r.key,attribute_value_price:r.price}))}}})),e.abrupt("return",{attributes:l});case 8:case"end":return e.stop()}}),e)}))),function(t,n,r,i,a){return e.apply(this,arguments)})},{key:"getBreakDownName",value:function(){return"attributes"}}]);var e,t}();function oh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oh=function(){return!!e})()}var sh=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["priceManager"],r=(0,oe.A)(r),e=(0,ae.A)(n,oh()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"mPriceDataLoader",null),(0,c.A)(e,"mCustomPriceCalculators",[]),(0,c.A)(e,"mConfigurableNode",null),(0,c.A)(e,"mPricingSettings",null),(0,c.A)(e,"mPriceMatrix",null),(0,c.A)(e,"mCatalogue",null),(0,c.A)(e,"mModifierClasses",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"isAttachable",value:function(e){return e.isDerivedOfTypeName("ProductNode")}},{key:"OnAttached",value:function(){}},{key:"OnDetached",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mPriceDataLoader&&this.mPriceDataLoader.error("Detached"),this.mPriceDataLoader=null}},{key:"_depResolveConfigurableNode",value:function(){var e=this;return this.getParentObject().onConfigurableNodeReady.pipe((0,th.w)(7e3),(0,E.s)(1),(0,k.M)((function(t){e.mConfigurableNode=t})))}},{key:"_depResolveCatalogueSettings",value:function(){return this.getParentObject().getComponent("catalogueSettings").resolveSettings()}},{key:"_depLoadCatalogueClasses",value:(p=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=t.getParentObject();Rt._.getInstance().resolveBootstrapData(r.productId).pipe((0,E.s)(1)).subscribe({next:function(n){v.UX.print("bootstrap got catalogue classes");var r=n.getCatalogueClasses(),i=It.eE.getItems(r);t.mModifierClasses=Array.isArray(i)?i:[],e(t.mModifierClasses)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return p.apply(this,arguments)})},{key:"_depLoadPricingSettings",value:(m=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=t.getParentObject();Rt._.getInstance().resolveBootstrapData(r.productId).pipe((0,E.s)(1)).subscribe({next:function(n){t.mPricingSettings=n.getPricingSettings(),e(t.mPricingSettings)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return m.apply(this,arguments)})},{key:"_depLoadPricingMatrix",value:(f=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=t.getParentObject();Rt._.getInstance().resolveBootstrapData(r.productId).pipe((0,E.s)(1)).subscribe({next:function(n){var r=n.getPricingGroups();t.mPriceMatrix=It.eE.getItemsWithRelations(r),e(t.mPriceMatrix)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return f.apply(this,arguments)})},{key:"_depLoadCatalogue",value:(l=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=t.getParentObject();Rt._.getInstance().resolveBootstrapData(r.productId).pipe((0,E.s)(1)).subscribe({next:function(n){t.mCatalogue=n.getCatalogue(),e(t.mCatalogue)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return l.apply(this,arguments)})},{key:"_resolvePricingData",value:function(){var e=this;return this.mPriceDataLoader||(this.mPriceDataLoader=new L.m,(0,sn.p)([this._depResolveConfigurableNode(),this._depLoadCatalogue(),this._depLoadCatalogueClasses(),this._depLoadPricingSettings(),this._depResolveCatalogueSettings(),this._depLoadPricingMatrix()]).pipe((0,E.s)(1)).subscribe({next:function(t){v.UX.print("pricing data finished dependencies"),e.mPriceDataLoader&&e.mPriceDataLoader.next({settings:e.mPricingSettings,catalogue:e.mCatalogue,price_matrix:e.mPriceMatrix,modifier_classes:e.mModifierClasses})},error:function(t){v.UX.error("Resolving pricing data failed: ",t),e.mPriceDataLoader&&(e.mPriceDataLoader.error("Failed resolve pricing data"),e.mPriceDataLoader=null)}})),this.mPriceDataLoader}},{key:"registerPriceCalculator",value:function(e){this.mCustomPriceCalculators.push(e)}},{key:"getApplicableCalculators",value:function(e){var t=e.price_calculators,n=[];return(t.attribute_pricing||t.pricing_matrix)&&n.push(new nh),t.attribute_pricing&&n.push(new ah,new Wl),t.pricing_matrix&&n.push(new Yl),t.external_api&&n.push(new Ql),t.script_engine&&n.push(new eh),n.push.apply(n,(0,a.A)(this.mCustomPriceCalculators)),n}},{key:"requestPrice",value:(o=(0,n.A)(i().mark((function e(){var t,r=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getParentObject(),e.next=3,(0,y._)(t.awaitArticlesFinished());case 3:return e.abrupt("return",new Promise((function(e,a){var o;r._resolvePricingData().subscribe({next:(o=(0,n.A)(i().mark((function n(o){var s,u,c,l;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return s=t.getComponent("articleListManager"),n.next=3,s.getModels();case 3:return u=n.sent,n.next=6,s.getArticles();case 6:c=n.sent,l=r.getApplicableCalculators(o.settings),r.requestCompoundPrice(l,(function(t){t.totals=t.totals||{},t.totals.base=t.totals.base||0,Object.keys(t.totals).forEach((function(e){h.N5.isNumeric(t.totals[e])&&(t.totals[e]=parseFloat(parseFloat(t.totals[e]).toFixed(2)))})),e(t)}),(function(e){a(e)}),{totals:{base:0},models:u,articles:c,catalogue:o.catalogue},o,r.getParentObject(),r.mConfigurableNode);case 9:case"end":return n.stop()}}),n)}))),function(e){return o.apply(this,arguments)}),error:function(e){a(e)}})})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"requestCompoundPrice",value:function(e,t,n,r,i,a,o){var s=this;if(0!==e.length){var u=e.shift();Promise.resolve(u.calculate(r,i,a,o)).then((function(r){s.requestCompoundPrice(e,t,n,r,i,a,o)}),(function(e){n(e)}))}else t(r)}},{key:"requestPriceBreakDown",value:(r=(0,n.A)(i().mark((function e(){var t,r=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getParentObject(),e.next=3,(0,y._)(t.awaitArticlesFinished());case 3:return e.abrupt("return",new Promise((function(e,a){var o;r._resolvePricingData().subscribe({next:(o=(0,n.A)(i().mark((function n(a){var o,s,u,c;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=t.getComponent("articleListManager"),n.next=3,o.getModels();case 3:return s=n.sent,n.next=6,o.getArticles();case 6:u=n.sent,c=r.getApplicableCalculators(a.settings),e({calculators:c,models:s,articles:u,pricingData:a,parentObject:r.getParentObject(),configurableNode:r.mConfigurableNode});case 9:case"end":return n.stop()}}),n)}))),function(e){return o.apply(this,arguments)}),error:function(e){a(e)}})})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}]);var r,o,l,f,m,p}(he.$),uh=__webpack_require__(32203),ch=__webpack_require__(87641),lh=__webpack_require__(5148);function hh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hh=function(){return!!e})()}var fh=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,hh()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=Number(this.getMetadata().value_camera),n="no"!==this.getMetadata().camera_openview;return Number.isFinite(t)&&R.K.messenger().send(new m.Eg(t,!0,n)),[]}}])}(lh.Z);function mh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mh=function(){return!!e})()}var ph=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,mh()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=Number(this.getMetadata().value_view);return Number.isFinite(t)&&(v.UX.print("select view id: ",t),R.K.messenger().send(new m.y0(t))),[]}}])}(lh.Z);function dh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dh=function(){return!!e})()}var vh=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,dh()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this,n=[],r=this.getMetadata();if(void 0!==r.value_option_list&&null!==r.value_option_list)try{n=JSON.parse(r.value_option_list)}catch(e){v.UX.print("Failed to parse select option rule:",e)}else void 0!==r.value_option&&null!==r.value_option&&n.push(r.value_option);var i=[];if(n.forEach((function(e){var t=e.split(":");if(2===t.length||3===t.length)try{var n=null;if(3===t.length){var r=t[2].match(/^(\d+)\((.*)\)$/);3===r.length&&(n=r[2])}var a=i.find((function(e){return e.product_uuid===n}));a||(a={product_uuid:n,option_list:[]},i.push(a)),a.option_list.push({question_id:parseInt(t[0],10),option_id:t[1]})}catch(e){v.UX.error("failed to read select option rule: ",e)}})),i.length>0){var a=[];return i.forEach((function(e){a.push(t.applyAttribute(e.product_uuid,e.option_list))})),new Promise((function(e,t){if(0===a.length)return e([]);gs(a).pipe((0,E.s)(1)).subscribe({next:function(t){e([])},error:function(e){t(e)}})}))}return[]}},{key:"applyAttribute",value:(r=(0,n.A)(i().mark((function e(t,r){var a=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var s,u=null;if(null==t)u=a.getProcessManager().getProductNode();else{var c=R.K.sceneManager().findNodesOfTypeName("ProductNode",(function(e){return e.getValue("object_uuid")===t}));c.length>0&&(u=c[0])}if(null===u)return o("product with uuid '"+t+"' not found");u.getComponent("attributeManager").resolveAttributeManager().subscribe({next:(s=(0,n.A)(i().mark((function t(n){var a,o;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=[],r.forEach((function(e){var t=n.getValue(e.question_id);null!=t&&t.attribute_value_id!=e.option_id&&a.push({q:e.question_id,o:e.option_id})})),o=0;case 3:if(!(o<a.length)){t.next=9;break}return t.next=6,n.setValue(a[o].q,a[o].o,{emitEvent:!0,rebuild:o===a.length-1});case 6:o++,t.next=3;break;case 9:e(!0);case 10:case"end":return t.stop()}}),t)}))),function(e){return s.apply(this,arguments)}),error:function(e){o(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})}]);var r}(lh.Z);function yh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yh=function(){return!!e})()}var gh=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,yh()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this,r=[];if(!(0,P.isNullOrUndefined)(this.getMetadata().select_color_edit_list))try{r=JSON.parse(this.getMetadata().select_color_edit_list)}catch(e){}return r&&r.length>0?new Promise((function(e,a){t.getProcessManager().getProductNode().getComponent("attributeManager").resolveAttributeManager().subscribe(function(){var t=(0,n.A)(i().mark((function t(n){var a,o;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=[],r.forEach((function(e){var t=e.question_id||null,r=e.color_id||null;if(!(0,P.isNullOrUndefined)(t)&&!(0,P.isNullOrUndefined)(r)){var i=n.getValue(t);(0,P.isNullOrUndefined)(i)||i.attribute_value_id==r||a.push({q:t,o:r})}})),o=0;case 3:if(!(o<a.length)){t.next=9;break}return t.next=6,n.setValue(a[o].q,a[o].o,{emitEvent:!0,rebuild:o===a.length-1});case 6:o++,t.next=3;break;case 9:e([]);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),(function(e){a(e)}))})):[]}}])}(lh.Z);function bh(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ah(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ah(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ah(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_h=function(){return!!e})()}var Mh=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,_h()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"onMatManagerSubject",new M.B),(0,c.A)(e,"mMaterialGroupManager",void 0),(0,c.A)(e,"destroy$$",new M.B),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){var e=this;this.getProcessManager().getProductNode().getComponent("materialGroupManager").resolveMaterialGroups().pipe((0,ls.Q)(this.destroy$$)).subscribe({next:function(t){e.mMaterialGroupManager=t,e.onMatManagerSubject.next(t)},error:function(){e.onMatManagerSubject.error("Failed to get material manager")}})}},{key:"onDestroy",value:function(){this.destroy$$.next(),this.destroy$$.complete()}},{key:"onHandleInPort",value:(a=(0,n.A)(i().mark((function e(t){var n,r=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[];try{n=JSON.parse(this.getMetadata().value_matgroup_list||null)}catch(e){v.UX.warn(e)}if(!n&&this.getMetadata().value_matgroup&&n.push(this.getMetadata().value_matgroup),!this.mMaterialGroupManager){e.next=7;break}return e.next=6,this.setMaterials(n);case 6:return e.abrupt("return",[]);case 7:return e.abrupt("return",new Promise((function(e,t){r.onMatManagerSubject.pipe((0,j.$)(),(0,ls.Q)(r.destroy$$)).subscribe({next:function(){r.setMaterials(n).then((function(){e([])})).catch((function(e){return t(e)}))},error:function(e){t(e)}})})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"setMaterials",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=bh(t),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=16;break}if(0!==(a=r.value).length){e.next=7;break}return e.abrupt("return");case 7:if(2===(o=a.split(":")).length){e.next=10;break}return e.abrupt("return");case 10:return s=Number(o[0]),u=Number(o[1]),e.next=14,this.mMaterialGroupManager.setActiveMaterial(s,u);case 14:e.next=3;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(1),n.e(e.t0);case 21:return e.prev=21,n.f(),e.finish(21);case 24:case"end":return e.stop()}}),e,this,[[1,18,21,24]])}))),function(e){return r.apply(this,arguments)})}]);var r,a}(lh.Z),kh=__webpack_require__(1106);function wh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wh=function(){return!!e})()}var Th=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,wh()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"onOffsetManagerSubject",null),(0,c.A)(e,"mSceneOffsetManager",null),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){var e=this,t=this.getProcessManager().getProductNode();this.onOffsetManagerSubject=new M.B,this.mSubscriptions.push(t.onConfigurableNodeReady.subscribe((function(t){t.resolveSceneOffsetManager().then((function(t){if(e.mSubscriptions.length)return e.mSceneOffsetManager||(e.mSceneOffsetManager=t,e.onOffsetManagerSubject.next(t)),t}),(function(){!e.mSceneOffsetManager&&e.onOffsetManagerSubject&&e.onOffsetManagerSubject.error("failed to get offset manager")}))})))}},{key:"onDestroy",value:function(){this.onOffsetManagerSubject&&(this.onOffsetManagerSubject.error("destroyed"),this.onOffsetManagerSubject=null),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"onHandleInPort",value:function(e){var t=this,n=Number(this.getMetadata().value_offset);return Number.isFinite(n)?(this.mSceneOffsetManager&&this.mSceneOffsetManager.showOffsetNode(n),new Promise((function(e,r){t.onOffsetManagerSubject.pipe((0,j.$)()).subscribe({next:function(){t.mSceneOffsetManager.showOffsetNode(n),e([])},error:function(e){r(e)}})}))):[]}}])}(lh.Z);function xh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xh=function(){return!!e})()}var Sh=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,xh()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_question;if(!(0,P.isNullOrUndefined)(t)){var n=this.getProcessManager().getProductNode();R.K.messenger().send(new m.P9(n.getSceneObjectId(),n.getObjectUUID(),t,!0))}return[]}}])}(lh.Z);function Ch(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ch=function(){return!!e})()}var Eh=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Ch()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_selected_color_question,n={};try{n=JSON.parse(this.getMetadata().value_selected_colors)}catch(e){}var r="all";if((0,P.isNullOrUndefined)(this.getMetadata().visibility_condition)||(r=this.getMetadata().visibility_condition),!(0,P.isNullOrUndefined)(t)){var i=this.getProcessManager().getProductNode();return new Promise((function(e,a){i.getComponent("attributeManager").resolveAttributeManager().subscribe((function(i){var a=i.getAttributeController(t),o=a.getAttribute();(0,P.isNullOrUndefined)(o)||o.attribute_values[0].attribute_value_valuable.colors.forEach((function(e){var t=!0;switch(r){case"visible":t=!0!==n[e.color];break;case"hidden":t=!0===n[e.color]}t&&(a.setVisibility(!n[e.color],{color:e.color}),a.broadcastAttributeUpdated())}));e([])}),(function(e){a(e)}))}))}return[]}}])}(lh.Z);function Rh(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ih(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ih(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ih(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Oh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Oh=function(){return!!e})()}var Dh=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Oh()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"onMatManagerSubject",new L.m),(0,c.A)(e,"mMaterialGroupManager",null),(0,c.A)(e,"destroy$$",new M.B),(0,c.A)(e,"materialGroupGroupId",""),(0,c.A)(e,"visibilityCondition","all"),(0,c.A)(e,"options",[]),(0,c.A)(e,"folders",[]),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){var e=this,t=this.getProcessManager().getProductNode().getComponent("materialGroupManager");try{var n,r,i,a,o,s;this.materialGroupGroupId=null!==(n=this.getMetadata().value_selected_material)&&void 0!==n?n:"",this.visibilityCondition=null!==(r=this.getMetadata().visibility_condition)&&void 0!==r?r:"all";var u=null!==(i=JSON.parse(null!==(a=this.getMetadata().value_selected_matrefs)&&void 0!==a?a:null))&&void 0!==i?i:{},c=null!==(o=JSON.parse(null!==(s=this.getMetadata().value_selected_matref_folders)&&void 0!==s?s:null))&&void 0!==o?o:{};Object.keys(u).forEach((function(e){!1===Boolean(u[e])&&delete u[e]})),this.options=Object.keys(u).map((function(e){return Number(e)})),this.folders=Object.keys(c).map((function(e){return Number(e)}))}catch(e){}t.resolveMaterialGroups().pipe((0,ls.Q)(this.destroy$$)).subscribe({next:function(t){e.mMaterialGroupManager=t,e.onMatManagerSubject.next(t)},error:function(){e.onMatManagerSubject.error("Failed to get material manager")}})}},{key:"onDestroy",value:function(){this.destroy$$.next(),this.destroy$$.complete()}},{key:"onHandleInPort",value:function(e){var t=this;return this.mMaterialGroupManager?(this.runVisibilityCheck(),[]):new Promise((function(e,n){t.onMatManagerSubject.pipe((0,j.$)(),(0,ls.Q)(t.destroy$$)).subscribe({next:function(){t.runVisibilityCheck(),e([])},error:function(e){return n(e)}})}))}},{key:"runVisibilityCheck",value:function(){var e=this.mMaterialGroupManager.getGroupByGroupId(this.materialGroupGroupId);if(e){if("hidden"!==this.visibilityCondition){var t="visible"===this.visibilityCondition?this.options:[],n="visible"===this.visibilityCondition?this.folders:[];this.mMaterialGroupManager.resetVisibilityOverwrites(e.id,t),this.mMaterialGroupManager.resetFolderVisibilityOverwrites(e.id,n)}if("visible"!==this.visibilityCondition){var r,i=Rh(this.options);try{for(i.s();!(r=i.n()).done;){var a=r.value;this.mMaterialGroupManager.setMaterialVisibility(e.id,a,!1,!0)}}catch(e){i.e(e)}finally{i.f()}var o,s=Rh(this.folders);try{for(s.s();!(o=s.n()).done;){var u=o.value;this.mMaterialGroupManager.setMaterialVisibilityByFolderId(e.id,u,!1,!0)}}catch(e){s.e(e)}finally{s.f()}}if("hidden"!==this.visibilityCondition){var c,l=Rh(this.mMaterialGroupManager.getAvailableReferences(e.id));try{for(l.s();!(c=l.n()).done;){var h=c.value;this.options.includes(h.id)||this.folders.includes(h.material_folder_id)||this.mMaterialGroupManager.setMaterialVisibility(e.id,h.id,!0,!0,!1)}}catch(e){l.e(e)}finally{l.f()}this.mMaterialGroupManager.setMaterialVisibilityGlobalOverwrite(e.id,!0)}}}}])}(lh.Z);function Ph(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ph=function(){return!!e})()}var Bh=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Ph()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getVisibilityAttributes",value:function(e){if("question"===e.type)return e.attribute_values.map((function(e){return e.id}));if(["svg_image_selector","svg_element","svg_element_selector"].includes(e.type))try{return e.attribute_values[0].attribute_value_valuable.attributes.map((function(e){return e.key}))}catch(e){v.UX.print("failed to get svg attribute keys: ",e)}return[]}},{key:"onHandleInPort",value:function(e){var t=this,n=this.getMetadata().value_selected_question,r={};try{r=JSON.parse(this.getMetadata().value_selected_options)}catch(e){v.UX.error("Failed to parse selected options: ",e)}var i="all";if((0,P.isNullOrUndefined)(this.getMetadata().visibility_condition)||(i=this.getMetadata().visibility_condition),!(0,P.isNullOrUndefined)(n)){var a=this.getProcessManager().getProductNode();return new Promise((function(e,o){a.getComponent("attributeManager").resolveAttributeManager().subscribe((function(o){var s=o.getRawAttributes().find((function(e){return e.id==n}));(0,P.isNullOrUndefined)(s)||t.getVisibilityAttributes(s).forEach((function(e){var t=!0;switch(i){case"visible":t=!0!==r[e];break;case"hidden":t=!0===r[e]}t&&R.K.messenger().send(new m.P9(a.getSceneObjectId(),a.getObjectUUID(),n,!0!==r[e],e))}));e([])}),(function(e){o(e)}))}))}return[]}}])}(lh.Z);function Fh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fh=function(){return!!e})()}var Nh=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Fh()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t={};try{t=JSON.parse(this.getMetadata().value_selected_question)}catch(e){}var n="all";if((0,P.isNullOrUndefined)(this.getMetadata().visibility_condition)||(n=this.getMetadata().visibility_condition),Object.keys(t).length>0){var r=this.getProcessManager().getProductNode();return new Promise((function(e,i){r.getComponent("attributeManager").resolveAttributeManager().subscribe((function(i){i.getRawAttributes().forEach((function(e){var i=!0;switch(n){case"visible":i=!0!==t[e.id];break;case"hidden":i=!0===t[e.id]}i&&R.K.messenger().send(new m.P9(r.getSceneObjectId(),r.getObjectUUID(),e.id,!0!==t[e.id]))})),e([])}),(function(e){i(e)}))}))}return[]}}])}(lh.Z);function Lh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lh=function(){return!!e})()}var jh=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Lh()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_matgroup_id,n="hidden"!==this.getMetadata().price_visibility,r=this.getProcessManager().getProductNode();return null!=t&&R.K.messenger().send(new m.TD(t,n,r)),[]}}])}(lh.Z);function Uh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Uh=function(){return!!e})()}var Vh=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Uh()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=parseInt(this.getMetadata().value_selected_question,10),n={};try{n=JSON.parse(this.getMetadata().value_selected_options)}catch(e){}var r="all";if((0,P.isNullOrUndefined)(this.getMetadata().option_disabled_condition)||(r=this.getMetadata().option_disabled_condition),!(0,P.isNullOrUndefined)(t)){var i=this.getProcessManager().getProductNode().getComponent("attributeManager");return new Promise((function(e,a){i.resolveAttributeManager().subscribe((function(i){var a=i.getAttributeController(t);if(!(0,P.isNullOrUndefined)(a)){var o=a.getAttribute();(0,P.isNullOrUndefined)(o)||o.attribute_values.forEach((function(e){var t=!0;switch(r){case"enabled":t=!0===n[e.id]&&!0!==e.disabled;break;case"disabled":t=!0!==n[e.id]&&!0===e.disabled}if(t){var i=!0===n[e.id];a.setDisabled(i,{option_id:e.id}),a.broadcastAttributeUpdated()}})),e([])}}),(function(e){a(e)}))}))}return[]}}])}(lh.Z),zh=__webpack_require__(98843);function Hh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Hh=function(){return!!e})()}var Gh=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Hh()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){return[new zh.i(e.type,e.data,this,"forward")]}}])}(lh.Z);function qh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qh=function(){return!!e})()}var Wh=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,qh()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_node_id;if((0,P.isNullOrUndefined)(t))return[];var n=R.K.sceneManager().findNodesOfType(Hs.i.TypeRTTI,(function(e){return e.getSceneObjectId()==t}))[0];if(!(0,P.isNullOrUndefined)(n)){var r=this.getValue(e.data);r=this.fixFloat(r),n.setValue("title",r)}return[]}},{key:"getValue",value:function(e){switch(e.attribute_type){case"operable_numbers_input":case"text_to_image":case"text_input":return e.attribute_value_name}return(0,P.isNullOrUndefined)(e.value)?"":e.value}},{key:"fixFloat",value:function(e){var t=Number(e);return isNaN(t)||t*Math.pow(10,2)%1==0?e:t.toFixed(2)}}])}(lh.Z);__webpack_require__(28543);function Kh(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Xh(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xh(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Xh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Yh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yh=function(){return!!e})()}var $h=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Yh()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c,l,h,f,m;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!(0,P.isNullOrUndefined)(this.getMetadata().value_input_list))try{n=JSON.parse(this.getMetadata().value_input_list)}catch(e){v.UX.error(e)}return r=t.data.value,a=[],o=this.transformNewValue(r),s=this.getProcessManager().getProductNode(),u=s.getComponent("attributeManager"),e.next=9,(0,y._)(u.resolveAttributeManager());case 9:c=e.sent,l=Kh(n),e.prev=11,l.s();case 13:if((h=l.n()).done){e.next=21;break}return f=h.value,m=Number(f),e.next=18,c.setValue(m,o);case 18:a.push(new zh.i("input",{attribute_id:m,value:o},this,"input_id"));case 19:e.next=13;break;case 21:e.next=26;break;case 23:e.prev=23,e.t0=e.catch(11),l.e(e.t0);case 26:return e.prev=26,l.f(),e.finish(26);case 29:return e.abrupt("return",a);case 30:case"end":return e.stop()}}),e,this,[[11,23,26,29]])}))),function(e){return r.apply(this,arguments)})},{key:"transformNewValue",value:function(e){var t="string"==typeof e||"number"==typeof e?e:"",n=this.getMetadata().value_text||"";if(!n)return"";var r,i=Kh((0,a.A)(n.matchAll(/{value(?:\|(\d+))?}/gi)));try{for(i.s();!(r=i.n()).done;){var o=r.value,s=o[0],u=Math.max(Number(o[1])||0,0);n=h.N5.isNumeric(t)?n.replace(s,Number(t).toFixed(u)):n.replace(s,String(t))}}catch(e){i.e(e)}finally{i.f()}return n}}]);var r}(lh.Z);function Zh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zh=function(){return!!e})()}var Qh=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Zh()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=null;try{t=JSON.parse(this.getMetadata().material_reference)}catch(e){}var n=this.getMetadata().material_hex_color;if(!(0,P.isNullOrUndefined)(t)&&h.N5.isNumeric(t.material_id)&&(0,P.isString)(n)){var r=this.getProcessManager().getProductNode(),i=en.J.getManager(en.n.MaterialManager),a=(0,P.isString)(n)&&n.length>0?n.substr(0,7):"";i.setColorOverwrite(t.material_id,a,r.getSceneObjectId())}return[]}}])}(lh.Z);function Jh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jh=function(){return!!e})()}var ef=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Jh()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"onMatManagerSubject",void 0),(0,c.A)(e,"mMaterialGroupManager",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){var e=this;this.onMatManagerSubject=new M.B;var t=this.getProcessManager().getProductNode().getComponent("materialGroupManager");this.mSubscriptions.push(t.resolveMaterialGroups().subscribe({next:function(t){e.mMaterialGroupManager||(e.mMaterialGroupManager=t,e.onMatManagerSubject.next(t))},error:function(){!e.mMaterialGroupManager&&e.onMatManagerSubject&&e.onMatManagerSubject.error("Failed to get material manager")}}))}},{key:"onDestroy",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.onMatManagerSubject&&(this.onMatManagerSubject.error("destroyed"),delete this.onMatManagerSubject)}},{key:"onHandleInPort",value:function(){var e=this,t=null,n=null,r=null;try{(t=JSON.parse(this.getMetadata().value_mat_or_matgroup_mat_value||"null"))||(t=JSON.parse(this.getMetadata().material_reference||"null")),n=JSON.parse(this.getMetadata().value_mat_or_matgroup_group_value||"null"),r=JSON.parse(this.getMetadata().material_maps)}catch(e){v.UX.error(e)}if(!r||!Array.isArray(r))return[];var i=this.getProcessManager().getProductNode();if(t&&h.N5.isNumeric(t.material_id)){for(var a=en.J.getManager(en.n.MaterialManager),o=[],s=0;s<r.length;s++)o.push(a.setMapOverwrite(t.material_id,r[s].type,r[s].textureId,i.getSceneObjectId()));l.N.resolveArray(o,(function(){v.UX.print("Texture on material applied using material-map-rule!")}))}if(null!=n){if(!this.mMaterialGroupManager)return new Promise((function(t,a){e.onMatManagerSubject.pipe((0,j.$)()).subscribe({next:function(){for(var a=[],o=0;o<r.length;o++)a.push(e.mMaterialGroupManager.setMapOverwrite(n,r[o].type,r[o].textureId,i.getSceneObjectId()));l.N.resolveArray(a,(function(){return v.UX.print("Texture on material group applied using (promise) material-group-map-rule!"),t([])}))},error:function(e){return a(e)}})}));for(var u=[],c=0;c<r.length;c++)u.push(this.mMaterialGroupManager.setMapOverwrite(n,r[c].type,r[c].textureId,i.getSceneObjectId()));l.N.resolveArray(u,(function(){v.UX.print("Texture on material group applied using material-group-map-rule!")}))}return[]}}])}(lh.Z);function tf(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return nf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nf(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function nf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rf=function(){return!!e})()}var af=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,rf()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c,l,f,m,p,d,v,g,b;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!(0,P.isNullOrUndefined)(this.getMetadata().value_input_list))try{n=JSON.parse(this.getMetadata().value_input_list)}catch(e){}return r=0,(0,P.isNullOrUndefined)(this.getMetadata().operand_value)||(r=parseInt(this.getMetadata().operand_value,10)),a=[],o=this.getProcessManager().getProductNode(),s=o.getComponent("attributeManager"),e.next=9,(0,y._)(s.resolveAttributeManager());case 9:u=e.sent,c=t.data?t.data.value:void 0,l=this.getMetadata().value_text,f=this.transformNewValue(l,c),m=h.N5.isNumeric(f)?Number(f):void 0,p=tf(n),e.prev=15,p.s();case 17:if((d=p.n()).done){e.next=27;break}return v=d.value,g=Number(v),(b={})[r]={value:m},e.next=24,u.setValue(g,b);case 24:a.push(new zh.i("input",{attribute_id:g,value:m},this,"input_id"));case 25:e.next=17;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(15),p.e(e.t0);case 32:return e.prev=32,p.f(),e.finish(32);case 35:return e.abrupt("return",a);case 36:case"end":return e.stop()}}),e,this,[[15,29,32,35]])}))),function(e){return r.apply(this,arguments)})},{key:"transformNewValue",value:function(e,t){var n=null!=t?t:"";if(e){var r,i=tf((0,a.A)(e.matchAll(/{value(?:\|(\d+))?}/gi)));try{for(i.s();!(r=i.n()).done;){var o=r.value,s=o[0],u=Math.max(Number(o[1])||0,0);e=h.N5.isNumeric(n)?e.replace(s,Number(n).toFixed(u)):e.replace(s,String(n))}}catch(e){i.e(e)}finally{i.f()}return e}}}]);var r}(lh.Z);function of(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(of=function(){return!!e})()}var sf=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,of()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=[];if(!(0,P.isNullOrUndefined)(this.getMetadata().value_input_list))try{t=JSON.parse(this.getMetadata().value_input_list)}catch(e){}var n="disabled";(0,P.isNullOrUndefined)(this.getMetadata().minmax_min_change_type)||(n=this.getMetadata().minmax_min_change_type);var r="disabled";(0,P.isNullOrUndefined)(this.getMetadata().minmax_max_change_type)||(r=this.getMetadata().minmax_max_change_type);var i=null;(0,P.isNullOrUndefined)(this.getMetadata().minmax_min_change_value)||(i=this.getMetadata().minmax_min_change_value);var a=null;(0,P.isNullOrUndefined)(this.getMetadata().minmax_max_change_value)||(a=this.getMetadata().minmax_max_change_value);var o=0;return(0,P.isNullOrUndefined)(this.getMetadata().operand_value)||(o=parseInt(this.getMetadata().operand_value,10)),this.getProcessManager().getProductNode().getComponent("attributeManager").resolveAttributeManager().subscribe((function(e){t.forEach((function(t){var s=e.getAttributeController(t);if(!(0,P.isNullOrUndefined)(s)){var u=s.getAttribute(),c=u.attribute_values;if(c.length>0){var l=c[0];switch(u.type){case"text_input":var h=l.attribute_value_valuable;switch(n){case"null":h.min=null;break;case"update":h.min=i}switch(r){case"null":h.max=null;break;case"update":h.max=a}s.broadcastAttributeUpdated();break;case"operable_numbers_input":var f=l.attribute_value_valuable;if(o<f.operands.length){switch(n){case"null":f.operands[o].min_value=null;break;case"update":f.operands[o].min_value=i}switch(r){case"null":f.operands[o].max_value=null;break;case"update":f.operands[o].max_value=a}}s.broadcastAttributeUpdated()}}}}))}),(function(e){})),[]}}])}(lh.Z);function uf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(uf=function(){return!!e})()}function cf(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var lf=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,uf()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mDestroyed$",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){cf(t,"onInit",this,3)([]),this.mDestroyed$=new M.B}},{key:"onDestroy",value:function(){cf(t,"onDestroy",this,3)([]),this.mDestroyed$&&(this.mDestroyed$.next(),this.mDestroyed$.complete(),delete this.mDestroyed$)}},{key:"onHandleInPort",value:function(e){var t=null;if(null!==this.getMetadata().value_update_attribute_id&&void 0!==this.getMetadata().value_update_attribute_id&&(t=parseInt(this.getMetadata().value_update_attribute_id,10)),null===t)return[];var n=null;null!==this.getMetadata().value_update_attribute_name&&void 0!==this.getMetadata().value_update_attribute_name&&(n=this.getMetadata().value_update_attribute_name);var r=null;if(null!==this.getMetadata().value_update_attribute_valuable&&void 0!==this.getMetadata().value_update_attribute_valuable)try{r=JSON.parse(this.getMetadata().value_update_attribute_valuable)}catch(e){}return this.getProcessManager().getProductNode().getComponent("attributeManager").resolveAttributeManager().pipe((0,ls.Q)(this.mDestroyed$)).subscribe({next:function(e){var i=e.getAttributeController(t);if(i){var a=i.getAttribute();(0,h.uI)(n)&&(a.name=n),r&&(a.attribute_values=a.attribute_values||[],0===a.attribute_values.length&&a.attribute_values.push({attribute_value_valuable:{}}),a.attribute_values[0].attribute_value_valuable=Object.assign(a.attribute_values[0].attribute_value_valuable,r)),i.broadcastAttributeUpdated()}},error:function(){}}),[]}}])}(lh.Z);function hf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hf=function(){return!!e})()}var ff=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,hf()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=[];if(!(0,P.isNullOrUndefined)(this.getMetadata().value_input_list))try{t=JSON.parse(this.getMetadata().value_input_list)}catch(e){}var n="min";(0,P.isNullOrUndefined)(this.getMetadata().selected_range)||(n=this.getMetadata().selected_range);var r=0;(0,P.isNullOrUndefined)(this.getMetadata().operand_value)||(r=parseInt(this.getMetadata().operand_value,10));var i=null;switch(e.data.attribute_type){case"operable_numbers_input":case"text_to_image":case"text_input":i=e.data.attribute_value_name;break;default:i=e.data.value}return i=h.N5.isNumeric(i)?parseFloat(i):null,this.getProcessManager().getProductNode().getComponent("attributeManager").resolveAttributeManager().subscribe((function(e){t.forEach((function(t){var a=e.getAttributeController(t);if(!(0,P.isNullOrUndefined)(a)){var o=a.getAttribute(),s=o.attribute_values;if(s.length>0){var u=s[0];switch(o.type){case"text_input":var c=u.attribute_value_valuable;switch(n){case"min":c.min=i;break;case"max":c.max=i}a.broadcastAttributeUpdated();break;case"operable_numbers_input":var l=u.attribute_value_valuable;if(r<l.operands.length)switch(n){case"min":l.operands[r].min_value=i;break;case"max":l.operands[r].max_value=i}a.broadcastAttributeUpdated()}}}}))}),(function(){})),[]}}])}(lh.Z);function mf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mf=function(){return!!e})()}var pf=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,mf()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t="";if("string"===e.type||"input"===e.type)switch(e.data.attribute_type){case"operable_numbers_input":case"text_to_image":case"text_input":t+=e.data.attribute_value_name;break;default:t+=(0,P.isNullOrUndefined)(e.data.value)?"":e.data.value}return t+=this.getMetadata().value_text,[new zh.i("string",{value:t},this,"text")]}}])}(lh.Z),df=__webpack_require__(71390);function vf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vf=function(){return!!e})()}var yf=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,vf()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){try{var t=this.getMetadata().value_string||"DEBUG";v.UX.info("[".concat(t,"]"),e)}catch(e){v.UX.error("Debug node encountered an error.",e)}return[Object.assign(e,{client:this,outPort:"forward"})]}}])}(lh.Z);function gf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gf=function(){return!!e})()}var bf=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,gf()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"onOffsetManagerSubject",null),(0,c.A)(e,"mSceneOffsetManager",null),(0,c.A)(e,"mDestroyed",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){var e,t=this,r=this.getProcessManager().getProductNode();this.onOffsetManagerSubject=new M.B,this.mDestroyed=new M.B,r.onConfigurableNodeReady.pipe((0,ls.Q)(this.mDestroyed)).subscribe({next:(e=(0,n.A)(i().mark((function e(n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.resolveSceneOffsetManager();case 2:t.mSceneOffsetManager=e.sent,t.onOffsetManagerSubject.next(t.mSceneOffsetManager);case 4:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)}),error:function(e){t.onOffsetManagerSubject.error("Failed to get offset manager!")}})}},{key:"onDestroy",value:function(){this.onOffsetManagerSubject&&(this.onOffsetManagerSubject.error("destroyed"),this.onOffsetManagerSubject=null),this.mDestroyed&&(this.mDestroyed.next(),this.mDestroyed.complete(),delete this.mDestroyed)}},{key:"onHandleInPort",value:function(e){var t=this,n=Number(this.getMetadata().value_offset);return Number.isFinite(n)?null!==this.mSceneOffsetManager?(this.mSceneOffsetManager.hideOffsetNode(n),[]):new Promise((function(e,r){t.onOffsetManagerSubject.pipe((0,j.$)(),(0,ls.Q)(t.mDestroyed)).subscribe({next:function(){t.mSceneOffsetManager.hideOffsetNode(n),e([])},error:function(e){r(e)}})})):[]}}])}(lh.Z);function Af(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Af=function(){return!!e})()}var _f=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Af()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=Number(this.getMetadata().value_question);if(Number.isFinite(t)){var n=this.getProcessManager().getProductNode();R.K.messenger().send(new m.P9(n.getSceneObjectId(),n.getObjectUUID(),t,!1))}return[]}}])}(lh.Z);function Mf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Mf=function(){return!!e})()}var kf=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Mf()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_text;return R.K.eventBus().dispatch(new K.r(Q.E.Warning,{type:"alert",message:t})),[]}}])}(lh.Z);function wf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wf=function(){return!!e})()}var Tf=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,wf()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_text;return R.K.eventBus().dispatch(new K.r(Q.E.Warning,{type:"toast",message:t})),[]}}])}(lh.Z);function xf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xf=function(){return!!e})()}var Sf=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,xf()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_text;return R.K.eventBus().dispatch(new K.r(Q.E.Warning,{type:"warning",message:t})),[]}}])}(lh.Z);function Cf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cf=function(){return!!e})()}var Ef=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Cf()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"destroy$$",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){var e=this;this.destroy$$=new M.B,this.getProcessManager().getProductNode().getComponent("materialGroupManager").resolveMaterialGroups().pipe((0,E.s)(1),(0,ls.Q)(this.destroy$$)).subscribe({next:function(t){t.onMaterialChanged.pipe((0,ls.Q)(e.destroy$$)).subscribe({next:function(t){e.feedInPort(new zh.i("matgroup",t,e,"material"))}})},error:function(){}})}},{key:"onDestroy",value:function(){this.destroy$$&&(this.destroy$$.next(),this.destroy$$.complete(),delete this.destroy$$)}},{key:"onHandleInPort",value:function(e){return[e]}}])}(lh.Z);function Rf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rf=function(){return!!e})()}var If=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Rf()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscriptions",[]),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){var e=this,t=this.getProcessManager().getProductNode().getComponent("attributeManager");this.mSubscriptions.push(t.resolveAttributeManager().subscribe((function(t){e.mSubscriptions.push(t.onAttributeChanged.subscribe((function(t){e.feedInPort(new zh.i("options",t,e,"options"))})))})))}},{key:"onDestroy",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"onHandleInPort",value:function(e){return[e]}}])}(lh.Z);function Of(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Of=function(){return!!e})()}var Df=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Of()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscription",void 0),(0,c.A)(e,"mProductSceneId",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){var e=this;this.mProductSceneId=this.getProcessManager().getProductNode().getSceneObjectId(),this.mSubscription=R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductQuestionChanged),(function(t){var n=t.getData();n.visible&&n.product_scene_id==e.mProductSceneId&&e.feedInPort(new zh.i("question_id",n.question,e,"question_id"))}))}},{key:"onDestroy",value:function(){this.mSubscription&&(this.mSubscription.unsubscribe(),delete this.mSubscription)}},{key:"onHandleInPort",value:function(e){return v.UX.print("question changed process:",e),[e]}}])}(lh.Z);function Pf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pf=function(){return!!e})()}var Bf=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Pf()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscription",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){var e=this;this.mSubscription=R.K.eventBus().subscribe(K.r.getTopicName(Q.E.BuildUpdated),(function(t){v.UX.print("Scene built"),e.feedInPort(new zh.i("boolean",!0,e,"change"))}))}},{key:"onDestroy",value:function(){this.mSubscription.unsubscribe()}},{key:"onHandleInPort",value:function(e){return[e]}}])}(lh.Z);function Ff(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ff=function(){return!!e})()}var Nf=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Ff()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){var e=this;this.getProcessManager().getProductNode().getComponent("attributeManager").resolveAttributeManager().pipe((0,j.$)()).subscribe({next:function(){e.feedInPort(new zh.i("boolean",!0,e,"ready"))}})}},{key:"onHandleInPort",value:function(e){return[e]}}])}(lh.Z);function Lf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lf=function(){return!!e})()}var jf=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Lf()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscription",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){var e=this;this.mSubscription=R.K.renderer().getRenderEngine().getUiRenderer().onUiSelected.subscribe((function(t){e.feedInPort(new zh.i("ui",t,e,"click"))}))}},{key:"onDestroy",value:function(){this.mSubscription.unsubscribe()}},{key:"onHandleInPort",value:function(e){return[e]}}])}(lh.Z);function Uf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Uf=function(){return!!e})()}var Vf=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Uf()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscription",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){var e=this,t=this.getProcessManager().getProductNode().getComponent("attributeManager");this.mSubscription=t.onAttributeChanged.subscribe((function(t){var n=t.attribute_type;"text_input"!==n&&"text_to_image"!==n&&"operable_numbers_input"!==n||e.feedInPort(new zh.i("input",t,e,"input_id"))}))}},{key:"onDestroy",value:function(){this.mSubscription.unsubscribe()}},{key:"onHandleInPort",value:function(e){return v.UX.print("input changed process:",e),[e]}}])}(lh.Z);function zf(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Hf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hf(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Hf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Gf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gf=function(){return!!e})()}var qf=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Gf()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c,l,h,f,m,p,d,g;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!(0,P.isNullOrUndefined)(this.getMetadata().value_input_list))try{n=JSON.parse(this.getMetadata().value_input_list)}catch(e){}return r=0,(0,P.isNullOrUndefined)(this.getMetadata().operand_value)||(r=parseInt(this.getMetadata().operand_value,10)),a=[],o=this.getProcessManager().getProductNode(),s=o.getComponent("attributeManager"),e.next=9,(0,y._)(s.resolveAttributeManager());case 9:u=e.sent,c=zf(n);try{for(c.s();!(l=c.n()).done;)h=l.value,f=Number(h),(m=u.getAttribute(f))&&"operable_numbers_input"===m.type&&Array.isArray(m.attribute_values)&&m.attribute_values.length>0&&(p=m.attribute_values[0].attribute_value_valuable)&&Array.isArray(p.operands)&&r<p.operands.length&&(d=p.operands[r],v.UX.print("operand value:",d),g={attribute_id:f,value:d.value},a.push(new zh.i("input",g,this,"value")))}catch(e){c.e(e)}finally{c.f()}return e.abrupt("return",a);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]);var r}(lh.Z);function Wf(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Kf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kf(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Kf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Xf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xf=function(){return!!e})()}var Yf=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Xf()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c,l,h,f,m;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!(0,P.isNullOrUndefined)(this.getMetadata().value_input_list))try{n=JSON.parse(this.getMetadata().value_input_list)}catch(e){}return r=[],a=this.getProcessManager().getProductNode(),o=a.getComponent("attributeManager"),e.next=7,(0,y._)(o.resolveAttributeManager());case 7:s=e.sent,u=Wf(n);try{for(u.s();!(c=u.n()).done;)l=c.value,h=Number(l),f=s.getValueName(h),(0,P.isNullOrUndefined)(f)||(m={attribute_id:h,value:f},r.push(new zh.i("input",m,this,"value")))}catch(e){u.e(e)}finally{u.f()}return e.abrupt("return",r);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]);var r}(lh.Z);function $f(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Zf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zf(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Zf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Qf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qf=function(){return!!e})()}var Jf=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Qf()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c,l,f,m,p,d,g,b,A,_;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!(0,P.isNullOrUndefined)(this.getMetadata().value_input_list))try{n=JSON.parse(this.getMetadata().value_input_list)}catch(e){}return r=0,(0,P.isNullOrUndefined)(this.getMetadata().operand_value)||(r=parseInt(this.getMetadata().operand_value,10)),a=[],o=this.getProcessManager().getProductNode(),s=o.getComponent("attributeManager"),e.next=9,(0,y._)(s.resolveAttributeManager());case 9:u=e.sent,c=$f(n);try{for(c.s();!(l=c.n()).done;)if(f=l.value,m=Number(f),(p=u.getAttribute(m))&&"operable_numbers_input"===p.type&&Array.isArray(p.attribute_values)&&p.attribute_values.length>0&&(d=p.attribute_values[0].attribute_value_valuable)&&Array.isArray(d.operands)&&r<d.operands.length){for(g=0,b=0;b<=r;b++)A=d.operands[b].value,h.N5.isNumeric(A)&&(g+=parseFloat(A));v.UX.print("operand sum:",g),_={attribute_id:m,value:g},a.push(new zh.i("input",_,this,"value"))}}catch(e){c.e(e)}finally{c.f()}return e.abrupt("return",a);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]);var r}(lh.Z);function em(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return tm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tm(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function tm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nm=function(){return!!e})()}var rm=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,nm()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c,l,h,f,m,p,d,g,b,A,_;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!(0,P.isNullOrUndefined)(this.getMetadata().value_input_list))try{n=JSON.parse(this.getMetadata().value_input_list)}catch(e){}return r=0,(0,P.isNullOrUndefined)(this.getMetadata().operand_value)||(r=parseInt(this.getMetadata().operand_value,10)),a="min",(0,P.isNullOrUndefined)(this.getMetadata().selected_range)||(a=this.getMetadata().selected_range),o=[],s=this.getProcessManager().getProductNode(),u=s.getComponent("attributeManager"),e.next=11,(0,y._)(u.resolveAttributeManager());case 11:c=e.sent,l=em(n),e.prev=13,l.s();case 15:if((h=l.n()).done){e.next=24;break}if(f=h.value,m=Number(f),(p=c.getAttribute(m))&&Array.isArray(p.attribute_values)&&0!==p.attribute_values.length){e.next=21;break}return e.abrupt("return");case 21:"operable_numbers_input"===p.type?(d=p.attribute_values[0].attribute_value_valuable)&&Array.isArray(d.operands)&&r<d.operands.length&&(g=d.operands[r],v.UX.print("operand minmax:",g),b={attribute_id:m,value:"min"===a?g.min_value:g.max_value},o.push(new zh.i("input",b,this,"value"))):"text_input"===p.type&&(A=p.attribute_values[0].attribute_value_valuable)&&(v.UX.print("input minmax:",A),_={attribute_id:m,value:"min"===a?A.min:A.max},o.push(new zh.i("input",_,this,"value")));case 22:e.next=15;break;case 24:e.next=29;break;case 26:e.prev=26,e.t0=e.catch(13),l.e(e.t0);case 29:return e.prev=29,l.f(),e.finish(29);case 32:return e.abrupt("return",o);case 33:case"end":return e.stop()}}),e,this,[[13,26,29,32]])}))),function(e){return r.apply(this,arguments)})}]);var r}(lh.Z);__webpack_require__(32637);function im(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(im=function(){return!!e})()}var am=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,im()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:(o=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c,l,h,f;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=this.getMetadata().selected_text_input,Number.isInteger(n)?(r=[n],a="maximum"):(r=n.selection||[],a=n.calculation||"maximum"),e.next=5,this.getAttributeManager();case 5:for(o=e.sent,s=[],u=0;u<r.length;u++)c=Number(r[u].id),l=Number(r[u].factor),s[u]=this.resolveAttributeWidth(o,c,Number.isNaN(l)?1:l);return e.next=10,Promise.all(s);case 10:h=e.sent.filter((function(e){return void 0!==e})),e.t0=a,e.next="minimum"===e.t0?14:"average"===e.t0?16:19;break;case 14:return f=h.reduce((function(e,t){return Math.min(e,t)})),e.abrupt("break",21);case 16:return f=h.reduce((function(e,t){return e+t})),f/=h.length,e.abrupt("break",21);case 19:return f=h.reduce((function(e,t){return Math.max(e,t)})),e.abrupt("break",21);case 21:return e.abrupt("return",[new zh.i("number",{value:f},this,"value")]);case 24:return e.prev=24,e.t1=e.catch(0),v.UX.error("Unable to process rule.",e.t1),e.abrupt("return",[]);case 28:case"end":return e.stop()}}),e,this,[[0,24]])}))),function(e){return o.apply(this,arguments)})},{key:"resolveAttributeWidth",value:(a=(0,n.A)(i().mark((function e(t,n){var r,a,o,s,u,c=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=c.length>2&&void 0!==c[2]?c[2]:1,!Number.isNaN(n)){e.next=3;break}return e.abrupt("return",void 0);case 3:return(a=t.getAttributeController(n)).updateValues(),e.next=7,a.dispatchToRenderer();case 7:return o=a.getResourceController(),s=a.resolveValuable(),u=a.getValue(),e.abrupt("return",o.getTextWidth(s,u)*r);case 11:case"end":return e.stop()}}),e)}))),function(e,t){return a.apply(this,arguments)})},{key:"getAttributeManager",value:(r=(0,n.A)(i().mark((function e(){var t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getProcessManager().getProductNode(),n=t.getComponent("attributeManager"),e.abrupt("return",(0,y._)(n.resolveAttributeManager()));case 3:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}]);var r,a,o}(lh.Z);function om(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(om=function(){return!!e})()}var sm=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,om()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_camera,n=R.K.sceneManager().getActiveCameraId();return(0,P.isNullOrUndefined)(t)||t!=n?[new zh.i("number",t,this,"no")]:[new zh.i("number",t,this,"yes")]}}])}(lh.Z);function um(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(um=function(){return!!e})()}var cm=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,um()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_view,n=R.K.sceneManager().getActiveView();return(0,P.isNullOrUndefined)(t)||(0,P.isNullOrUndefined)(n)||t!=n.getSceneObjectId()?[new zh.i("number",t,this,"no")]:[new zh.i("number",t,this,"yes")]}}])}(lh.Z);function lm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lm=function(){return!!e})()}var hm=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,lm()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"onMatManagerSubject",new M.B),(0,c.A)(e,"mMaterialGroupManager",void 0),(0,c.A)(e,"mDestroy$",new M.B),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){var e=this;this.getProcessManager().getProductNode().getComponent("materialGroupManager").resolveMaterialGroups().pipe((0,ls.Q)(this.mDestroy$)).subscribe({next:function(t){e.mMaterialGroupManager||(e.mMaterialGroupManager=t,e.onMatManagerSubject.next(t))},error:function(){e.mMaterialGroupManager||e.onMatManagerSubject.error("Failed to get material manager")}})}},{key:"onDestroy",value:function(){this.mDestroy$.next(),this.mDestroy$.complete(),this.onMatManagerSubject.complete()}},{key:"onHandleInPort",value:function(e){var t,n=this,r=[];if(this.getMetadata().value_matgroup_list)try{r=JSON.parse(this.getMetadata().value_matgroup_list)}catch(e){}else{if(!this.getMetadata().value_matgroup)return;r.push(this.getMetadata().value_matgroup)}var i=null!==(t=this.getMetadata().option_condition)&&void 0!==t?t:"any";return this.mMaterialGroupManager?this.decideActiveMaterial(r,i,e.data):new Promise((function(t,a){n.onMatManagerSubject.pipe((0,j.$)()).subscribe({next:function(){t(n.decideActiveMaterial(r,i,e.data))},error:function(e){a(e)}})}))}},{key:"decideActiveMaterial",value:function(e,t,n){var r=this,i=0,a=0;e.forEach((function(e){i+=1;var t=e.split(":");if(2===t.length&&h.N5.isNumeric(t[0])&&h.N5.isNumeric(t[1])){var n=parseInt(t[0],10),o=parseInt(t[1],10);r.mMaterialGroupManager.getActiveRefId(n)===o&&(a+=1)}}));var o="no";switch(t){case"any":a>0&&(o="yes");break;case"all":a===i&&(o="yes");break;case"none":0===a&&(o="yes")}return[new zh.i("matgroup",n,this,o)]}}])}(lh.Z);function fm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fm=function(){return!!e})()}var mm=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,fm()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"onOffsetManagerSubject",void 0),(0,c.A)(e,"mSceneOffsetManager",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){var e=this,t=this.getProcessManager().getProductNode();this.onOffsetManagerSubject=new M.B,this.mSubscriptions.push(t.onConfigurableNodeReady.subscribe((function(t){t.resolveSceneOffsetManager().then((function(t){if(e.mSubscriptions.length)return e.mSceneOffsetManager||(e.mSceneOffsetManager=t,e.onOffsetManagerSubject.next(t)),t}),(function(){!e.mSceneOffsetManager&&e.onOffsetManagerSubject&&e.onOffsetManagerSubject.error("failed to get offset manager")}))})))}},{key:"onDestroy",value:function(){this.onOffsetManagerSubject&&(this.onOffsetManagerSubject.error("destroyed"),delete this.onOffsetManagerSubject),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"onHandleInPort",value:function(e){var t=this,n=Number(this.getMetadata().value_offset),r=this.getMetadata().value_level||0,i=this.getMetadata().value_vec_x||0,a=this.getMetadata().value_vec_y||0,o=this.getMetadata().value_vec_z||0;if(!Number.isFinite(n))return[new zh.i(e.type,e.data,this,"no")];var s=new te.P(i,a,o);return this.mSceneOffsetManager?this.decideVectorSame(n,r,s,e.data):new Promise((function(i,a){t.onOffsetManagerSubject.pipe((0,j.$)()).subscribe({next:function(){i(t.decideVectorSame(n,r,s,e.data))},error:function(e){a(e)}})}))}},{key:"decideVectorSame",value:function(e,t,n,r){var i=this.mSceneOffsetManager.getOffsetVector(e,t),a=i&&n.sub(i).lengthSq()<1;return[new zh.i("offsets",r,this,a?"yes":"no")]}}])}(lh.Z);function pm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pm=function(){return!!e})()}var dm=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,pm()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this,n=[];if((0,P.isNullOrUndefined)(this.getMetadata().value_option_list))(0,P.isNullOrUndefined)(this.getMetadata().value_option)||n.push(this.getMetadata().value_option);else try{n=JSON.parse(this.getMetadata().value_option_list)}catch(e){}var r=[];n.forEach((function(e){var t=e.split(":");if(2===t.length||3===t.length)try{var n=null;if(3===t.length){var i=t[2].match(/^(\d+)\((.*)\)$/);3===i.length&&(n=i[2])}var a=r.find((function(e){return e.product_uuid===n}));(0,P.isNullOrUndefined)(a)&&(a={product_uuid:n,option_list:[]},r.push(a)),a.option_list.push({question_id:parseInt(t[0],10),option_id:parseInt(t[1],10)})}catch(e){}}));var i="any";(0,P.isNullOrUndefined)(this.getMetadata().option_condition)||(i=this.getMetadata().option_condition);var a=[];return r.forEach((function(e){a.push(t.checkAttributeCondition(e.product_uuid,e.option_list,i))})),new Promise((function(n,r){if(0===a.length)return r("not products");gs(a).pipe((0,E.s)(1)).subscribe((function(r){var a=r.length,o=r.filter((function(e){return!0===e})).length,s="no";switch(i){case"any":o>0&&(s="yes");break;case"all":case"none":o===a&&(s="yes")}n([new zh.i(e.type,e.data,t,s)])}),(function(e){r(e)}))}))}},{key:"checkAttributeCondition",value:(r=(0,n.A)(i().mark((function e(t,n,r){var a=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){var o=null;if((0,P.isNullOrUndefined)(t))o=a.getProcessManager().getProductNode();else{var s=R.K.sceneManager().findNodesOfTypeName("ProductNode",(function(e){return e.getValue("object_uuid")===t}));s.length>0&&(o=s[0])}if(null===o)return i("product with uuid '"+t+"' not found");o.getComponent("attributeManager").resolveAttributeManager().subscribe((function(t){var i=0,a=0;n.forEach((function(e){i+=1;var n=t.getValue(e.question_id);(0,P.isNullOrUndefined)(n)||n.attribute_value_id!=e.option_id||(a+=1)}));var o=!1;switch(r){case"any":a>0&&(o=!0);break;case"all":a===i&&(o=!0);break;case"none":0===a&&(o=!0)}e(o)}),(function(e){i(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e,t,n){return r.apply(this,arguments)})}]);var r}(lh.Z);function vm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vm=function(){return!!e})()}var ym=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,vm()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){try{var t=JSON.parse(this.getMetadata().value_string_list);if(!(0,P.isUndefined)(t)&&t.findIndex((function(t){return t===e.data}))>=0)return[new zh.i("string",e.data,this,"yes")]}catch(e){}return[new zh.i("string",e.data,this,"no")]}}])}(lh.Z);function gm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gm=function(){return!!e})()}var bm=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,gm()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=[];if((0,P.isNullOrUndefined)(this.getMetadata().value_matgroup_list))(0,P.isNullOrUndefined)(this.getMetadata().value_matgroup)||t.push(this.getMetadata().value_matgroup);else try{t=JSON.parse(this.getMetadata().value_matgroup_list)}catch(e){}var n="any";(0,P.isNullOrUndefined)(this.getMetadata().option_condition)||(n=this.getMetadata().option_condition);var r=0,i=0;"matgroup"===e.type&&t.forEach((function(t){r+=1;var n=t.split(":");2===n.length&&e.data.id==n[0]&&e.data.ref_id==n[1]&&(i+=1)}));var a="no";switch(n){case"any":i>0&&(a="yes");break;case"all":i===r&&(a="yes");break;case"none":0===i&&(a="yes")}return[new zh.i(e.type,e.data,this,a)]}}])}(lh.Z);function Am(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Am=function(){return!!e})()}var _m=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Am()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:(a=(0,n.A)(i().mark((function e(t){var n,r,a,o,s=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],(0,P.isNullOrUndefined)(this.getMetadata().value_option_list))(0,P.isNullOrUndefined)(this.getMetadata().value_option)||n.push(this.getMetadata().value_option);else try{n=JSON.parse(this.getMetadata().value_option_list)}catch(e){}return r=[],n.forEach((function(e){var t=e.split(":");if(2===t.length||3===t.length)try{var n=null;if(3===t.length){var i=t[2].match(/^(\d+)\((.*)\)$/);3===i.length&&(n=i[2])}var a=r.find((function(e){return e.product_uuid===n}));(0,P.isNullOrUndefined)(a)&&(a={product_uuid:n,option_list:[]},r.push(a)),a.option_list.push({question_id:parseInt(t[0],10),option_id:parseInt(t[1],10)})}catch(e){}})),a="any",(0,P.isNullOrUndefined)(this.getMetadata().option_condition)||(a=this.getMetadata().option_condition),o=[],r.forEach((function(e){o.push(s.checkAttributeSelected(e.product_uuid,e.option_list,a,t))})),e.abrupt("return",new Promise((function(e,n){if(0==o.length)return n("no products");gs(o).pipe((0,E.s)(1)).subscribe((function(n){var r=n.length,i=n.filter((function(e){return!0===e})).length,o="no";switch(a){case"any":i>0&&(o="yes");break;case"all":case"none":i===r&&(o="yes")}e([new zh.i(t.type,t.data,s,o)])}),(function(e){n(e)}))})));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"checkAttributeSelected",value:(r=(0,n.A)(i().mark((function e(t,n,r,a){var o=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){var s=null;if((0,P.isNullOrUndefined)(t))s=o.getProcessManager().getProductNode();else{var u=R.K.sceneManager().findNodesOfTypeName("ProductNode",(function(e){return e.getValue("object_uuid")===t}));u.length>0&&(s=u[0])}if(null===s)return i("product with uuid '"+t+"' not found");var c=0,l=0;if("options"===a.type){var h=a.data;v.UX.print("comparing option condition against event:",h),n.forEach((function(e){c+=1,e.question_id==h.attribute_id&&e.option_id==h.attribute_value_id&&(l+=1)}))}var f=!1;switch(r){case"any":l>0&&(f=!0);break;case"all":l===c&&(f=!0);break;case"none":0===l&&(f=!0)}e(f)})));case 1:case"end":return e.stop()}}),e)}))),function(e,t,n,i){return r.apply(this,arguments)})}]);var r,a}(lh.Z);function Mm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Mm=function(){return!!e})()}var km=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Mm()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_question;return(0,P.isNullOrUndefined)(t)||t!=e.data?[new zh.i("question_id",e.data,this,"no")]:[new zh.i("question_id",e.data,this,"yes")]}}])}(lh.Z);function wm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wm=function(){return!!e})()}var Tm=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,wm()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=[];if(!(0,P.isNullOrUndefined)(this.getMetadata().value_input_list))try{t=JSON.parse(this.getMetadata().value_input_list)}catch(e){}var n="any";(0,P.isNullOrUndefined)(this.getMetadata().option_condition)||(n=this.getMetadata().option_condition);var r=0,i=0;"input"===e.type&&t.forEach((function(t){r+=1,e.data.attribute_id===Number(t)&&(i+=1)}));var a="no";switch(n){case"any":i>0&&(a="yes");break;case"all":i===r&&(a="yes");break;case"none":0===i&&(a="yes")}return[new zh.i(e.type,e.data,this,a)]}}])}(lh.Z);function xm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xm=function(){return!!e})()}var Sm=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,xm()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=parseFloat(this.getMetadata().compare_value)||0,n=this.getMetadata().compare_function||"=",r=this.getValue(e),i=this.compare(t,n,r)?"yes":"no",a=e.type,o=e.data;return[new zh.i(a,o,this,i)]}},{key:"getValue",value:function(e){var t=e.type,n=e.data;switch(t){case"input":return this.getValueFromInput(n);case"number":return n.value;default:return NaN}}},{key:"getValueFromInput",value:function(e){switch(e.attribute_type){case"operable_numbers_input":case"text_to_image":case"text_input":return parseFloat(e.attribute_value_name);default:return parseFloat(e.value)}}},{key:"compare",value:function(e,t,n){switch(t){case"=":case"==":return e==n;case">":return e>n;case"<":return e<n;case">=":return e>=n;case"<=":return e<=n;case"!=":return e!=n;default:return!1}}}])}(lh.Z);function Cm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cm=function(){return!!e})()}var Em=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Cm()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_string;return(0,P.isUndefined)(t)||t!==e.data?[new zh.i("string",e.data,this,"no")]:[new zh.i("string",e.data,this,"yes")]}}])}(lh.Z);function Rm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rm=function(){return!!e})()}var Im=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Rm()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_question;return(0,P.isNullOrUndefined)(t)||t!=e.data.attribute_id?[new zh.i("attribute_id",e.data,this,"no")]:[new zh.i("attribute_id",e.data,this,"yes")]}}])}(lh.Z);function Om(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Om=function(){return!!e})()}var Dm=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Om()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_string;return(0,P.isNullOrUndefined)(e.data)||e.data.attribute_value_name!=t?[new zh.i(e.type,e.data,this,"no")]:[new zh.i(e.type,e.data,this,"yes")]}}])}(lh.Z);function Pm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pm=function(){return!!e})()}var Bm=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Pm()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t=[];if(!(0,P.isNullOrUndefined)(this.getMetadata().value_object_list))try{t=JSON.parse(this.getMetadata().value_object_list)}catch(e){}var n="any";(0,P.isNullOrUndefined)(this.getMetadata().option_condition)||(n=this.getMetadata().option_condition);var r=0,i=0;if("ui"===e.type){var a=e.data;t.forEach((function(e){var t=Number(e);r+=1,t===a.getSceneObjectId()&&(i+=1)}))}var o="no";switch(n){case"any":i>0&&(o="yes");break;case"all":i===r&&(o="yes");break;case"none":0===i&&(o="yes")}return[new zh.i(e.type,e.data,this,o)]}}])}(lh.Z);function Fm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fm=function(){return!!e})()}var Nm=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Fm()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:function(e){var t="no";return!0===R.K.stateRegistery().get("reconfigure")&&(t="yes"),[new zh.i(e.type,e.data,this,t)]}}])}(lh.Z);function Lm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lm=function(){return!!e})()}var jm=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Lm()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mDebounceTimout",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:(r=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){v.UX.print("Debounce rule called."),void 0!==n.mDebounceTimout&&(v.UX.print("Debounced!"),window.clearTimeout(n.mDebounceTimout),delete n.mDebounceTimout);var r=n.getMetadata().value_mstime||0;v.UX.print("Debounce wait another:",r),n.mDebounceTimout=window.setTimeout((function(){delete n.mDebounceTimout,v.UX.print("Debounce execute"),e([new zh.i(t.type,t.data,n,"forward")])}),r)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})}]);var r}(lh.Z);function Um(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Um=function(){return!!e})()}var Vm=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Um()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:(r=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r=n.getMetadata().value_mstime||0;window.setTimeout((function(){e([new zh.i(t.type,t.data,n,"forward")])}),r)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})}]);var r}(lh.Z);function zm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zm=function(){return!!e})()}var Hm=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,zm()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){}},{key:"onDestroy",value:function(){}},{key:"onHandleInPort",value:function(){var e=this.getMetadata();return R.K.eventBus().dispatch(new K.r(Q.E.PlaySound,e.sound)),[]}}])}(lh.Z);__webpack_require__(2945);function Gm(){window.location.href.startsWith("data:text/html,<script>")&&(window.URL=window.URL||window.webkitURL,window.xpvJail={workers:{},handleJailMessage:function(e,t){var n=t.data,r=n.type,i=n.content;switch(r){case"function-call":window.parent.postMessage({messageId:t.data.messageId,scriptId:e,sandboxId:window.xpvJail.workers[e].sandbox,type:r,content:i},"*");break;case"finished":window.xpvJail.killScript(e),window.xpvJail.workers[e].resolver(i),delete window.xpvJail.workers[e]}},runScriptInJail:function(e,t,n,r,i){var a=this.constructJail(e,i,r,n);return new Promise((function(r,i){try{if(!window.Worker)return void i({cause:"web-workers-not-supported"});var o=new Worker(function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"application/javascript";try{t=new Blob([e],{type:n})}catch(n){window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder;var r=new BlobBuilder;r.append(e),t=r.getBlob()}return window.URL.createObjectURL(t)}(a));window.xpvJail.workers[e]={executor:o,resolver:function(e){r(e)},rejector:i,sandbox:t};var s=function(e){var t=e;if(!(e instanceof ErrorEvent)){if("error"!==e.data.type)return;t=e.data.content}console.warn("[jail] Went wrong in jail",n),i(t)};o.addEventListener("error",s),o.addEventListener("message",s),o.addEventListener("message",window.xpvJail.handleJailMessage.bind(null,e))}catch(e){i(e)}}))},killScript:function(e){void 0!==window.xpvJail.workers[e]&&(window.xpvJail.workers[e].executor.onerror=void 0,window.xpvJail.workers[e].executor.onmessage=void 0,window.xpvJail.workers[e].executor.terminate())},constructJail:function(e,t,n,r){var i="<script>/* runs inside the worker */\n                var _app = {\n                    scriptId: '10000000-1000-4000-8000-100000000000',\n                    _flyingMessages: {},\n                    postMessageWithResult(type, content = undefined) {\n                        var uuidv4 = function() {\n                            var crypto = self.crypto || self.msCrypto || false;\n                            if (crypto) {\n                                return ('' + 1e7 + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function(c) {\n                                    return Number(c) ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (Number(c) / 4)));\n                                }).toString(16);\n                            } else {\n                                return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n                                    const r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;\n                                    return v.toString(16);\n                                });\n                            }\n                        };\n                        var id = uuidv4();\n                        while (this._flyingMessages[id] !== undefined) {\n                            id = uuidv4();\n                        }\n                        this._flyingMessages[id] = null; /* ensure no-one else gets this key. */\n                        return new Promise(function(resolve, reject) {\n                            this._flyingMessages[id] = function(msgContent, success = true) {\n                                return success ? resolve(msgContent) : reject(msgContent);\n                            };\n                            self.postMessage({\n                                scriptId: this.scriptId,\n                                messageId: id,\n                                type,\n                                content\n                            });\n                        });\n                    },\n                    postMessage(type, content = undefined) { self.postMessage({ type, content }); },\n                    message(content) { this.postMessage('message', content); },\n                    handleIncomingMessage(message) {\n                        var { id, success, content } = message.data;\n                        var resolver = this._flyingMessages[id];\n                        if (resolver) resolver(content, success || false);\n                    },\n                    ready() { this.postMessage('ready'); },\n                    result(value) { this.postMessage('finished', value); },\n                };\n                self.addEventListener('message', function(msg) {\n                    return _app.handleIncomingMessage(msg);\n                });\n                _app.ready();\n            ";i=i.substr(i.indexOf("<script>")+8);for(var a="_app.scriptId = '".concat(e,"';\n"),o=0;o<t.length;o++){var s=t[o];a+="_app.".concat(s," = function() {\n")+"\tlet args = Array.prototype.slice.call(arguments);\n"+"\treturn this.postMessageWithResult('function-call',{name:'".concat(s,"', arguments: args});")+"};\n"}var u="const _ctx = ".concat(JSON.stringify(n),";");return"".concat(i,";\n").concat(a,";\n").concat(u,";\n").concat(r,";\n                Promise.resolve(run())\n                    .catch(function(error) { return _app.postMessage('error', error); })\n                    .then(function(result) { return _app.result(result); });")}},window.addEventListener("message",(function(e){var t=e.data;switch(t.type){case"run-script":window.xpvJail.runScriptInJail(t.messageId,t.sandboxId,atob(t.content.code),t.content.context,t.content.interactions).then((function(n){var r={messageId:t.messageId,type:"script-finished",content:n};window.parent.postMessage(r,e.origin)}));break;case"kill-script":window.xpvJail.killScript(t.content);break;case"function-result":window.xpvJail.workers[t.scriptId]?window.xpvJail.workers[t.scriptId].executor.postMessage({id:t.messageId,success:!0,content:t.content}):console.warn("[jail] Worker doesn't exist anymore, did you forget to await a function result?")}})),window.parent.postMessage({type:"ready"},"*"))}var qm=function(){function e(){(0,s.A)(this,e),(0,c.A)(this,"sandboxId",void 0);var t=e.generateUniqueUuidForObject(e.interactions);e.interactions[t]={},this.sandboxId=t,e.sandbox||(e.ready=new Promise((function(t){return e.flyingMessages.ready=t})),e.sandbox=document.createElement("iframe"),e.sandbox.setAttribute("sandbox","allow-scripts"),e.sandbox.style.display="none",e.sandbox.src="data:text/html,<script>(".concat(Gm,")()<\/script>"),window.addEventListener("message",(function(t){t.source===e.sandbox.contentWindow&&e.messageListener(t.data)})),document.body.appendChild(e.sandbox))}return(0,u.A)(e,[{key:"executeScript",value:(r=(0,n.A)(i().mark((function t(n){var r,a,o=arguments;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},a=o.length>2&&void 0!==o[2]?o[2]:200,t.abrupt("return",e.sendResponseExpectingMessage({sandboxId:this.sandboxId,type:"run-script",content:{code:n,context:r,interactions:Object.keys(e.interactions[this.sandboxId]||{})}},a));case 3:case"end":return t.stop()}}),t,this)}))),function(e){return r.apply(this,arguments)})},{key:"registerInteractions",value:function(t){e.interactions[this.sandboxId]=t}}],[{key:"generateUniqueUuidForObject",value:function(e){for(var t=f.V.uuidV4();void 0!==e[t];)v.UX.warn("Uuid collision detected... generating another one."),t=f.V.uuidV4();return t}},{key:"messageListener",value:function(t){var n;"function-call"!==t.type?("script-finished"===t.type&&void 0!==t.messageId&&(e.flyingMessages[t.messageId](t.content),delete e.flyingMessages[t.messageId]),"ready"===t.type&&(v.UX.print("[jail] Ready to be used!"),e.flyingMessages.ready(t.content),delete e.flyingMessages.ready)):Promise.resolve((n=e.interactions[t.sandboxId])[t.content.name].apply(n,(0,a.A)(t.content.arguments))).then((function(n){var r={sandboxId:t.sandboxId,scriptId:t.scriptId,messageId:t.messageId,type:"function-result",content:n};e.sendMessage(r)}))}},{key:"sendMessage",value:function(t){e.sandbox.contentWindow.postMessage(t,"*")}},{key:"sendResponseExpectingMessage",value:(t=(0,n.A)(i().mark((function t(n){var r,a,o=arguments;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:200,a=e.generateUniqueUuidForObject(e.flyingMessages),e.flyingMessages[a]=null,t.next=5,e.ready;case 5:return t.abrupt("return",new Promise((function(t,i){var o=Object.assign(n,{messageId:a}),s=window.setTimeout((function(){i("Script didn't finish in time\n"),e.sendMessage({sandboxId:n.sandboxId,type:"kill-script",content:a}),delete e.flyingMessages[a]}),r);e.flyingMessages[a]=function(e){window.clearTimeout(s),t(e)},e.sandbox.contentWindow.postMessage(o,"*")})));case 6:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})}]);var t,r}();function Wm(e,t){return(0,fn.T)(t)?mn(e,t,1):mn(e,1)}function Km(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Xm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xm(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Xm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ym(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ym=function(){return!!e})()}(0,c.A)(qm,"ready",void 0),(0,c.A)(qm,"sandbox",void 0),(0,c.A)(qm,"flyingMessages",{}),(0,c.A)(qm,"interactions",{});var $m=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Ym()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"flow",new M.B),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){}},{key:"onDestroy",value:function(){}},{key:"executeInSandbox",value:(a=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c,l,h,f,m;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getMetadata().script||"",r=new qm,e.prev=2,o=this.getProcessManager().getProductNode(),s=o.getComponent("attributeManager"),e.next=7,s.resolveAttributeManager().toPromise();case 7:u=e.sent,c=[],l=u.getAttributeControllers(),h=Km(l);try{for(h.s();!(f=h.n()).done;)m=f.value,c.push(m.getAttribute())}catch(e){h.e(e)}finally{h.f()}return e.next=14,r.executeScript(n,{nodeInput:t.data,attributes:c},3e4);case 14:a=e.sent,e.next=20;break;case 17:e.prev=17,e.t0=e.catch(2),v.UX.error(e.t0);case 20:return e.abrupt("return",[new zh.i("all",{value:a},this,"output")]);case 21:case"end":return e.stop()}}),e,this,[[2,17]])}))),function(e){return a.apply(this,arguments)})},{key:"onHandleInPort",value:(r=(0,n.A)(i().mark((function e(t){var n,r=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Promise((function(e){r.flow.pipe(Wm((function(e){return(0,xn.H)(r.executeInSandbox(e))})),(0,E.s)(1)).subscribe((function(t){e(t)}))})),this.flow.next(t),e.abrupt("return",n);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]);var r,a}(lh.Z);function Zm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zm=function(){return!!e})()}var Qm=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Zm()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){}},{key:"onDestroy",value:function(){}},{key:"onHandleInPort",value:function(e){var t=this,n=this.getMetadata().value_question;if((0,P.isNullOrUndefined)(n))return[];var r=this.getProcessManager().getProductNode().getComponent("attributeManager");return new Promise((function(e,i){r.resolveAttributeManager().subscribe((function(r){var i=r.getValue(n);(0,P.isNullOrUndefined)(i)&&e([]),e([new zh.i("input",{attribute_id:n,value:i.value},t,"value")])}),(function(e){return i(e)}))}))}}])}(lh.Z);function Jm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ep(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jm(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function tp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tp=function(){return!!e})()}var np=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,tp()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onInit",value:function(){}},{key:"onDestroy",value:function(){}},{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_question,n=this.getMetadata().color;if(!t||!n)return[];var r=this.getProcessManager().getProductNode().getComponent("attributeManager");return new Promise((function(i,a){r.resolveAttributeManager().subscribe((function(r){var a=r.getAttributeController(t);a.setValue(ep(ep({},a.getValue()),{},(0,c.A)({},n.type,e.data.value))),i([])}),(function(e){return a(e)}))}))}}])}(lh.Z);function rp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rp=function(){return!!e})()}var ip=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,rp()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"onHandleInPort",value:(a=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,s=JSON.parse(null!==(n=null===(r=this.getMetadata())||void 0===r?void 0:r.value_selected_palletization_attribute)&&void 0!==n?n:null),u=JSON.parse(null!==(a=null===(o=this.getMetadata())||void 0===o?void 0:o.value_selected_colors)&&void 0!==a?a:null),!s||!u){e.next=8;break}return c=this.getProcessManager().getProductNode(),e.next=7,this.processAttributeColorsBasedOnVisibilityRules(c,s,u);case 7:return e.abrupt("return",e.sent);case 8:e.next=12;break;case 10:e.prev=10,e.t0=e.catch(0);case 12:return e.abrupt("return",[]);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(e){return a.apply(this,arguments)})},{key:"processAttributeColorsBasedOnVisibilityRules",value:(r=(0,n.A)(i().mark((function e(t,n,r){var a,o,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.getComponent("attributeManager"),e.next=3,(0,y._)(a.resolveAttributeManager());case 3:return o=e.sent,(s=o.getAttributeController(n)).getAttribute()&&s.setVisibilityPalletizationColors(r),e.abrupt("return",[]);case 8:case"end":return e.stop()}}),e)}))),function(e,t,n){return r.apply(this,arguments)})}]);var r,a}(lh.Z),ap=function(){function e(){(0,s.A)(this,e)}return(0,u.A)(e,null,[{key:"processes",value:function(){var t={};return Object.keys(e).forEach((function(n){var r=e[n];void 0!==r&&("string"==typeof r.name||r.name instanceof String)&&(t[r.name]=r.process)})),t}}])}();(0,c.A)(ap,"CHECKS_ACTION_HIDE_OFFSET",{name:"checks/action/hide-offset",process:bf}),(0,c.A)(ap,"ACTIONS_HIDE_QUESTION",{name:"actions/hide/question",process:_f}),(0,c.A)(ap,"ACTIONS_MESSAGE_ALERT",{name:"actions/message/alert",process:kf}),(0,c.A)(ap,"ACTIONS_MESSAGE_TOAST",{name:"actions/message/toast",process:Tf}),(0,c.A)(ap,"ACTIONS_MESSAGE_WARNING",{name:"actions/message/warning",process:Sf}),(0,c.A)(ap,"ACTIONS_ROTATE_OFFSET",{name:"actions/rotate/offset",process:ch.w}),(0,c.A)(ap,"ACTIONS_SELECT_CAMERA",{name:"actions/select/camera",process:fh}),(0,c.A)(ap,"ACTIONS_SELECT_VIEW",{name:"actions/select/view",process:ph}),(0,c.A)(ap,"ACTIONS_SELECT_OPTION",{name:"actions/select/option",process:vh}),(0,c.A)(ap,"ACTIONS_SELECT_COLOR",{name:"actions/select/color",process:gh}),(0,c.A)(ap,"ACTIONS_SET_MATGROUP",{name:"actions/set/matgroup",process:Mh}),(0,c.A)(ap,"ACTIONS_SET_OFFSET",{name:"actions/set/offset",process:kh.V}),(0,c.A)(ap,"CHECKS_ACTION_SHOW_OFFSET",{name:"checks/action/show-offset",process:Th}),(0,c.A)(ap,"ACTIONS_SHOW_QUESTION",{name:"actions/show/question",process:Sh}),(0,c.A)(ap,"ACTIONS_VISIBILITY_COLOR",{name:"actions/visibility/color",process:Eh}),(0,c.A)(ap,"ACTIONS_VISIBILITY_MATGROUP",{name:"actions/visibility/material",process:Dh}),(0,c.A)(ap,"ACTIONS_VISIBILITY_OPTIONS",{name:"actions/visibility/option",process:Bh}),(0,c.A)(ap,"ACTIONS_VISIBILITY_QUESTION",{name:"actions/visibility/question",process:Nh}),(0,c.A)(ap,"ACTIONS_VISIBILITY_MATPRICE",{name:"actions/visibility/matprice",process:jh}),(0,c.A)(ap,"ACTIONS_DISABLE_OPTIONS",{name:"actions/visibility/disable-option",process:Vh}),(0,c.A)(ap,"ACTIONS_PLAY_SOUND",{name:"actions/play/sound",process:Hm}),(0,c.A)(ap,"ACTIONS_VISIBILITY_PALLETIZATION_COLORS",{name:"actions/visibility/palletization-colors",process:ip}),(0,c.A)(ap,"BROADCAST_MATGROUP",{name:"broadcast/matgroup",process:Ef}),(0,c.A)(ap,"BROADCAST_OPTION",{name:"broadcast/option",process:If}),(0,c.A)(ap,"BROADCAST_QUESTION",{name:"broadcast/question",process:Df}),(0,c.A)(ap,"BROADCAST_SCENE_BUILT",{name:"broadcast/scene/built",process:Bf}),(0,c.A)(ap,"BROADCAST_SCENE_INITIALIZED",{name:"broadcast/scene/initialized",process:Nf}),(0,c.A)(ap,"BROADCAST_UI_CLICKED",{name:"broadcast/ui/clicked",process:jf}),(0,c.A)(ap,"BROADCAST_INPUT",{name:"boardcast/input",process:Vf}),(0,c.A)(ap,"BROADCAST_OPERABLE_VALUE",{name:"broadcast/operation",process:qf}),(0,c.A)(ap,"BROADCAST_VALUE",{name:"broadcast/value",process:Qm}),(0,c.A)(ap,"BROADCAST_VALUE_NAME",{name:"broadcast/value-name",process:Yf}),(0,c.A)(ap,"BROADCAST_OPERABLE_SUM",{name:"sum/operation",process:Jf}),(0,c.A)(ap,"BORADCAST_INPUT_MIN_MAX",{name:"broadcast/minmax",process:rm}),(0,c.A)(ap,"BROADCAST_TEXT_WIDTH",{name:"broadcast/text-width",process:am}),(0,c.A)(ap,"CHECKS_ACTIVE_CAMERA",{name:"checks/active-camera",process:sm}),(0,c.A)(ap,"CHECKS_ACTIVE_VIEW",{name:"checks/active-view",process:cm}),(0,c.A)(ap,"CHECKS_ACTIVE_MATGROUP",{name:"checks/active-matgroup",process:hm}),(0,c.A)(ap,"CHECKS_ACTIVE_OFFSET",{name:"checks/active-offset",process:mm}),(0,c.A)(ap,"CHECKS_ACTIVE_OPTION",{name:"checks/active-option",process:dm}),(0,c.A)(ap,"CHECKS_LIST",{name:"checks/list",process:ym}),(0,c.A)(ap,"CHECKS_MAT_REFERENCE",{name:"checks/matref",process:bm}),(0,c.A)(ap,"CHECKS_OPTION",{name:"checks/option",process:_m}),(0,c.A)(ap,"CHECKS_QUESTION",{name:"checks/question",process:km}),(0,c.A)(ap,"CHECKS_INPUT",{name:"checks/input",process:Tm}),(0,c.A)(ap,"CHECKS_OPERABLE_VALUE",{name:"checks/operation",process:Sm}),(0,c.A)(ap,"CHECKS_STRING",{name:"checks/string",process:Em}),(0,c.A)(ap,"CHECKS_ATTRIBUTE_TRIGGERED",{name:"checks/attribute-triggered",process:Im}),(0,c.A)(ap,"CHECKS_ATTRIBUTE_VALUE_NAME",{name:"checks/attribute-value-name",process:Dm}),(0,c.A)(ap,"CHECKS_UI",{name:"checks/ui",process:Bm}),(0,c.A)(ap,"CHECKS_ACTIVE_RECONFIGURE",{name:"checks/reconfigure",process:Nm}),(0,c.A)(ap,"ACTIONS_FORWARD",{name:"action/forward",process:Gh}),(0,c.A)(ap,"ACTIONS_SET_LINE_TITLE",{name:"action/set-line-title",process:Wh}),(0,c.A)(ap,"ACTIONS_SET_INPUT",{name:"action/set-input",process:$h}),(0,c.A)(ap,"ACTIONS_SET_COLOR",{name:"action/set-color",process:Qh}),(0,c.A)(ap,"ACTIONS_SET_MAP",{name:"action/set-map",process:ef}),(0,c.A)(ap,"ACTIONS_SET_GRADIENT_COLOR",{name:"action/set-gradient-color",process:np}),(0,c.A)(ap,"ACTIONS_SET_OPERABLE",{name:"action/set-operable",process:af}),(0,c.A)(ap,"ACTIONS_CHANGE_INPUT_MINMAX",{name:"action/change-minmax",process:sf}),(0,c.A)(ap,"ACTIONS_UPDATE_ATTRIBUTE",{name:"action/update-attribute",process:lf}),(0,c.A)(ap,"ACTIONS_SET_INPUT_MINMAX",{name:"action/set-minmax",process:ff}),(0,c.A)(ap,"ACTIONS_SET_TEXT",{name:"action/set-text",process:pf}),(0,c.A)(ap,"ACTIONS_ARITHMETIC",{name:"action/arithmetic",process:df.Z}),(0,c.A)(ap,"ACTIONS_EXECUTE_SCRIPT",{name:"action/script-execute",process:$m}),(0,c.A)(ap,"UTIL_DEBUG",{name:"util/debug",process:yf}),(0,c.A)(ap,"UTIL_DEBOUNCE",{name:"util/debounce",process:jm}),(0,c.A)(ap,"UTIL_TIMEOUT",{name:"util/timeout",process:Vm});var op=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mProcesses",[]),(0,c.A)(this,"mConnections",[]),(0,c.A)(this,"mNodeFactories",{}),(0,c.A)(this,"mProductNode",void 0),(0,c.A)(this,"mLoadHash",0),(0,c.A)(this,"onLoadFinished",new M.B),this.mNodeFactories=ap.processes(),this.mProductNode=t}),[{key:"load",value:(e=(0,n.A)(i().mark((function e(){var t,n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=++this.mLoadHash,e.abrupt("return",new Promise((function(e,r){Rt._.getInstance().resolveBootstrapData(n.mProductNode.productId).pipe((0,E.s)(1)).subscribe({next:function(i){if(t!==n.mLoadHash)throw new Error("cancelled");try{i.getRules().forEach((function(e){n.loadGraph(e)})),n.onLoadFinished.next(!0)}catch(e){return n.onLoadFinished.next(!1),r(e)}e(n)},error:function(e){n.onLoadFinished.next(!1),r(e)}})})));case 2:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"unload",value:function(){this.mLoadHash+=1,this.mProcesses.splice(0).forEach((function(e){return e.onDestroy()})),this.mConnections.splice(0),this.onLoadFinished.unsubscribe()}},{key:"getProductNode",value:function(){return this.mProductNode}},{key:"loadGraph",value:function(e){var t=this,n=e.processes;Array.isArray(n)&&n.forEach((function(e){var n=e.meta||{};t.addNode(e.pid,e.component,n)}));var r=e.connections;Array.isArray(r)&&r.forEach((function(e){var n=e.meta||{};null!==e.source_data&&void 0!==e.source_data?t.addInitial(e.source_data,e.target_pid,e.target_port,n):t.addEdge(e.source_pid,e.source_port,e.target_pid,e.target_port,n)}))}},{key:"addNode",value:function(e,t,n){var r=this.mNodeFactories[t];if(r){var i=new r(e,this,n);this.mProcesses.push(i),i.onInit()}}},{key:"addEdge",value:function(e,t,n,r,i){var a=this.mProcesses.find((function(t){return t.getPid()===e})),o=this.mProcesses.find((function(e){return e.getPid()===n}));a&&o?(a.attachOutPort(t,o,r),o.attachInPort(r,a,t),this.mConnections.push(new uh.e(a,t,o,r))):v.UX.error("failed to add edge: ",a,o)}},{key:"addInitial",value:function(e,t,n,r){}}]);var e}();function sp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(sp=function(){return!!e})()}var up=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["processManager"],r=(0,oe.A)(r),e=(0,ae.A)(n,sp()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mProcessManager",void 0),(0,c.A)(e,"mResolvePromise",null),(0,c.A)(e,"mLoaded",!1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"resolveManager",value:(r=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mLoaded){e.next=2;break}return e.abrupt("return",Promise.resolve(this.mProcessManager));case 2:if(v.UX.print("Initializing process manager for product:",this.mProcessManager.getProductNode().name),!this.mResolvePromise){e.next=5;break}return e.abrupt("return",this.mResolvePromise);case 5:return v.UX.print("Loading process manager for product:",this.mProcessManager.getProductNode().name),this.mResolvePromise=new Promise((function(e,n){t.mProcessManager.load().then((function(){return t.mResolvePromise=null,t.mLoaded=!0,v.UX.print("Process manager loaded!"),e(t.mProcessManager)}),(function(e){return t.mResolvePromise=null,v.UX.error("Process manager failed to load:",e),n(e)}))})),e.abrupt("return",this.mResolvePromise);case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"OnAttached",value:function(){this.mProcessManager=new op(this.getParentObject()),this.registerMessageHandler(m.OZ.TypeRTTI,this.destroyProcessManager.bind(this))}},{key:"OnDetached",value:function(){this.mProcessManager&&(this.mProcessManager.unload(),delete this.mProcessManager),this.unregisterMessageHandler(m.OZ.TypeRTTI)}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(kt.i.TypeRTTI)}},{key:"destroyProcessManager",value:function(e){v.UX.print("Destroying process manager for product:",this.mProcessManager.getProductNode().name),this.mProcessManager&&this.mProcessManager.unload(),this.mLoaded=!1}}]);var r}(he.$);function cp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cp=function(){return!!e})()}(0,c.A)(up,"TypeRTTI",new le.O("ProcessManagerComponent",he.$.TypeRTTI));var lp=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["catalogueSettings"],r=(0,oe.A)(r),e=(0,ae.A)(n,cp()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mProductId",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"OnAttached",value:function(){var e=this.getParentObject();this.mProductId=e.productId}},{key:"resolveSettings",value:function(){var e=this.getParentObject().getValue("product_id");return v.UX.print("resolve settings for: ",e),U.getInstance().resolveCatalogueSettings(e)}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(kt.i.TypeRTTI)}},{key:"dispose",value:function(){void 0!==this.mProductId&&(U.getInstance().disposeCatalogue(this.mProductId),delete this.mProductId)}}])}(he.$);function hp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hp=function(){return!!e})()}var fp=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["propertyValue"],r=(0,oe.A)(r),e=(0,ae.A)(n,hp()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mValues",{}),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){}},{key:"OnDetached",value:function(){}},{key:"isAttachable",value:function(e){return!0}},{key:"setValue",value:function(e,t){this.mValues[e]=t}},{key:"getValue",value:function(e){return this.mValues[e]}},{key:"valueExists",value:function(e){return void 0!==this.mValues[e]}}])}(he.$);function mp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mp=function(){return!!e})()}function pp(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(fp,"TypeRTTI",new le.O("PropertyValueComponent",he.$.TypeRTTI));var dp=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,mp()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"renderTechnique",Ot._1.effect_ao_plane),(0,c.A)(n,"mClipDistance",.05),(0,c.A)(n,"mSamplingRadius",8),(0,c.A)(n,"mPower",.5),(0,c.A)(n,"mWidthFromRenderer",2),(0,c.A)(n,"mHeightFromRenderer",2),(0,c.A)(n,"mSubscriptions",[]),n.mName="ShaderEntityAoPlane",n.mPickable=!1,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"onAttached",value:function(e){var n=this;pp(t,"onAttached",this,3)([e]),this.mSubscriptions.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.NodeAdded),(function(){n.markNeedsRenderUpdate()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.NodeRemoved),(function(){n.markNeedsRenderUpdate()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.NodeChanged),(function(){n.markNeedsRenderUpdate()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ObjectTransformed),(function(){n.markNeedsRenderUpdate()})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.OffsetChanged),(function(e){window.setTimeout((function(){n.markNeedsRenderUpdate()}),0)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.OffsetVisibility),(function(e){window.setTimeout((function(){n.markNeedsRenderUpdate()}),0)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.RendererBuildFinished),(function(){n.markNeedsRenderUpdate()})))}},{key:"onDetached",value:function(e){pp(t,"onDetached",this,3)([e]),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"clip_distance":return this.mClipDistance=parseFloat(n),!0;case"sampling_radius":return this.mSamplingRadius=parseFloat(n),!0;case"power":return this.mPower=parseFloat(n),!0}return pp(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=pp(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"clip_distance":return this.mClipDistance;case"sampling_radius":return this.mSamplingRadius;case"power":return this.mPower;case"width":return this.mWidthFromRenderer;case"height":return this.mHeightFromRenderer}return null}},{key:"serialize",value:function(e){var n=Object.assign(pp(t,"serialize",this,3)([e]),{type:"ao_plane"});return n.properties=Object.assign(n.properties,{clip_distance:this.mClipDistance,sampling_radius:this.mSamplingRadius,power:this.mPower}),n}},{key:"clipDistance",get:function(){return this.mClipDistance},set:function(e){this.mClipDistance=e,this.markNeedsRenderUpdate()}},{key:"samplingRadius",get:function(){return this.mSamplingRadius},set:function(e){this.mSamplingRadius=e,this.markNeedsRenderUpdate()}},{key:"power",get:function(){return this.mPower},set:function(e){this.mPower=e,this.markNeedsRenderUpdate()}},{key:"width",set:function(e){this.mWidthFromRenderer=e,R.K.eventBus().dispatch(new K.r(Q.E.ModelAttributeChanged,{attribute:"width",model:this}))}},{key:"height",set:function(e){this.mHeightFromRenderer=e,R.K.eventBus().dispatch(new K.r(Q.E.ModelAttributeChanged,{attribute:"height",model:this}))}}])}(lc);(0,c.A)(dp,"TypeRTTI",new le.O("ShaderEntityAoPlane",lc.TypeRTTI));var vp=function(){return(0,u.A)((function e(t,n,r,i,a){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"Piece",l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null;(0,s.A)(this,e),(0,c.A)(this,"mSyncHash",void 0),(0,c.A)(this,"mModelId",void 0),(0,c.A)(this,"mName",void 0),(0,c.A)(this,"mDescription",void 0),(0,c.A)(this,"mSKU",void 0),(0,c.A)(this,"mPrice",void 0),(0,c.A)(this,"mUom",void 0),(0,c.A)(this,"mQuantity",void 0),(0,c.A)(this,"mParentSku",void 0),this.mModelId=t,this.mName=n,this.mDescription=r,this.mSKU=i,this.mPrice=a,this.mSyncHash=o,this.mUom=u,this.mQuantity=l,this.mParentSku=h}),[{key:"setSyncHash",value:function(e){this.mSyncHash=e}},{key:"getSyncHash",value:function(){return this.mSyncHash}},{key:"isInSyncWithHash",value:function(e){return this.mSyncHash===e}},{key:"modelId",get:function(){return this.mModelId}},{key:"name",get:function(){return this.mName}},{key:"description",get:function(){return this.mDescription}},{key:"sku",get:function(){return this.mSKU}},{key:"price",get:function(){return this.mPrice}},{key:"uom",get:function(){return this.mUom}},{key:"quantity",get:function(){return this.mQuantity}},{key:"parent_sku",get:function(){return this.mParentSku}},{key:"serialize",value:function(){return{id:this.mModelId,name:this.mName,description:this.mDescription,sku:this.mSKU,price:this.mPrice,uom:this.mUom,quantity:this.mQuantity,parent_sku:this.mParentSku}}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}}])}(),yp=__webpack_require__(83629);function gp(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return bp(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bp(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function bp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ap(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ap=function(){return!!e})()}var _p=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,Ap()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"sceneObject",void 0),(0,c.A)(n,"mSyncHash",new yp.Q),(0,c.A)(n,"mObjectModels",{}),n.sceneObject=e,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getObjectModel",value:function(e){return e in this.mObjectModels?this.mObjectModels[e]:null}},{key:"getObjectModels",value:function(){return this.mObjectModels}},{key:"syncObjectModels",value:(a=(0,n.A)(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.mSyncHash.newHash(),n=this.syncNewModels(t),n=this.detachOutOfSync()||n,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"syncNewModels",value:function(e){var t=this,n=!1;return h.N5.isArray(e)&&e.forEach((function(e){e.id in t.mObjectModels?t.mObjectModels[e.id].setSyncHash(t.mSyncHash.getHash()):(n=!0,t.mObjectModels[e.id]=new vp(e.id,e.Name,e.Description,e.SKU,e.Price,t.mSyncHash.getHash()),t.mObjectModels[e.id].onAttached())})),n}},{key:"detachOutOfSync",value:function(){var e=this,t=!1,n=new Array;return Object.keys(this.mObjectModels).forEach((function(r){var i=e.mObjectModels[r];i.isInSyncWithHash(e.mSyncHash.getHash())||(t=!0,i.onDetached(),n.push(r))})),n.forEach((function(t){delete e.mObjectModels[t]})),t}},{key:"buildArticles",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u,c,l,h,f,m,p,d,v=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,y._)(this.sceneObject.onConfigurableNodeReady);case 2:return n=e.sent,r=this.sceneObject.getComponent("attributeManager"),a=n.getComponent("buildConfigurable"),e.next=7,(0,y._)(r.resolveAttributeManager());case 7:o=e.sent,s=o.getMaterialGroupManager(),u=a.getBatches(),c=[],l=gp(u),e.prev=12,f=i().mark((function e(){var n,r,a,o,u,l,f,m;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=h.value,r=n.getComponent("materialGroupController")){e.next=4;break}return e.abrupt("return",0);case 4:if(a=r.getMaterialGroupId(),(o=s.getGroup(a))&&o.generate_code){e.next=8;break}return e.abrupt("return",0);case 8:u=n.getNodes(),l=gp(u),e.prev=10,m=i().mark((function e(){var n,r,u,l,h,m;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=f.value,u=r.models_id,l=t.find((function(e){return e.modelId===u}))){e.next=5;break}return e.abrupt("return",0);case 5:if(!(c.findIndex((function(e){return e.models_id===u&&e.material_group_id===a}))>=0)){e.next=8;break}return e.abrupt("return",0);case 8:h=s.getActiveGroupSKU(a),(m={models_id:u,models_sku:l.sku,models_name:l.name,models_description:l.description,models_price:null!==(n=l.price)&&void 0!==n?n:0,material_group_id:o.id,material_group_sku:h}).price_sku=v.generatePriceSku(m),c.push(m);case 12:case"end":return e.stop()}}),e)})),l.s();case 13:if((f=l.n()).done){e.next=20;break}return e.delegateYield(m(),"t0",15);case 15:if(0!==e.t0){e.next=18;break}return e.abrupt("continue",18);case 18:e.next=13;break;case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(10),l.e(e.t1);case 25:return e.prev=25,l.f(),e.finish(25);case 28:case"end":return e.stop()}}),e,null,[[10,22,25,28]])})),l.s();case 15:if((h=l.n()).done){e.next=22;break}return e.delegateYield(f(),"t0",17);case 17:if(0!==e.t0){e.next=20;break}return e.abrupt("continue",20);case 20:e.next=15;break;case 22:e.next=27;break;case 24:e.prev=24,e.t1=e.catch(12),l.e(e.t1);case 27:return e.prev=27,l.f(),e.finish(27);case 30:m=gp(t),e.prev=31,d=i().mark((function e(){var t,n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=p.value,!(c.findIndex((function(e){return e.models_id===n.modelId}))>=0)){e.next=4;break}return e.abrupt("return",1);case 4:(r={models_id:n.modelId,models_sku:n.sku,models_name:n.name,models_description:n.description,models_price:null!==(t=n.price)&&void 0!==t?t:0,material_group_id:-1,material_group_sku:null}).price_sku=v.generatePriceSku(r),c.push(r);case 7:case"end":return e.stop()}}),e)})),m.s();case 34:if((p=m.n()).done){e.next=40;break}return e.delegateYield(d(),"t2",36);case 36:if(!e.t2){e.next=38;break}return e.abrupt("continue",38);case 38:e.next=34;break;case 40:e.next=45;break;case 42:e.prev=42,e.t3=e.catch(31),m.e(e.t3);case 45:return e.prev=45,m.f(),e.finish(45);case 48:return e.abrupt("return",c);case 49:case"end":return e.stop()}}),e,this,[[12,24,27,30],[31,42,45,48]])}))),function(e){return r.apply(this,arguments)})},{key:"generatePriceSku",value:function(e){var t="";return e.models_sku&&(t+=e.models_sku),e.material_group_sku&&(t+=e.material_group_sku),(0,h.uI)(t)?t:null}}]);var r,a}(dn.p);function Mp(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return kp(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kp(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function kp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wp=function(){return!!e})()}function Tp(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(_p,"TypeRTTI",new le.O("ArticleListController",dn.p.TypeRTTI));var xp=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,wp()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mCache",{}),(0,c.A)(e,"mScriptModelHash",0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getName",value:function(){return"ScriptEngineController"}},{key:"getModels",value:(d=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.requestSKUs());case 1:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"getArticles",value:(p=(0,n.A)(i().mark((function e(){var t,n,r,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getModels();case 2:t=e.sent,n=[],r=Mp(t);try{for(r.s();!(a=r.n()).done;)o=a.value,n.push({models_id:o.modelId,models_name:o.name,models_description:o.description,models_sku:o.sku,models_price:o.price,material_group_id:-1,material_group_sku:null,price_sku:o.sku,uom:o.uom,quantity:o.quantity,parent_sku:o.parent_sku})}catch(e){r.e(e)}finally{r.f()}return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"syncObjectModels",value:(m=(0,n.A)(i().mark((function e(n){var r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Tp(t,"syncObjectModels",this,3)([n]);case 2:return r=e.sent,e.next=5,this.syncScriptModels();case 5:if(e.t0=e.sent,e.t0){e.next=8;break}e.t0=r;case 8:return r=e.t0,e.abrupt("return",r);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"syncScriptModels",value:(f=(0,n.A)(i().mark((function e(){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.requestSKUs();case 3:n=e.sent,e.next=9;break;case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",!0);case 9:return r=n.reduce((function(e,t){if(!t.sku)return e;for(var n=t.sku.length;n;)e=33*e^t.sku.charCodeAt(--n);return e}),t.MAGIC_HASH)>>>0,a=this.mScriptModelHash!==r,this.mScriptModelHash=r,e.abrupt("return",a);case 13:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return f.apply(this,arguments)})},{key:"getSerializedAttributes",value:(h=(0,n.A)(i().mark((function e(){var t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.sceneObject.getComponent("attributeManager"),e.next=3,(0,y._)(t.resolveAttributeManager());case 3:return n=e.sent,e.abrupt("return",{hash:n.hashConfiguration(),serialized:n.serialize({discard_hidden:!1,include_keys:!0,calculate_approximations:!1})});case 5:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"requestSKUs",value:(l=(0,n.A)(i().mark((function e(){var t,n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSerializedAttributes();case 2:return t=e.sent,n=t.hash,r=t.serialized,e.abrupt("return",this.cache(n,r));case 6:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"requestSKUsFromScriptEngine",value:(a=(0,n.A)(i().mark((function e(t){var n,r,a,o,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=et.w.makeApiRoute("script_engine/catalogue/".concat(this.sceneObject.productId,"/sku/get")),r=this.getObjectModels(),a=Object.keys(r).map((function(e){return r[e].serialize()})),o={models:a,attributes:t},e.next=6,J.k.getInstance().post(n,o).catch((function(e){return e.response})).then((function(e){return e.data}));case 6:if(!(s=e.sent).error){e.next=9;break}throw s;case 9:return e.abrupt("return",this.buildObjectModels(s));case 10:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"cache",value:(r=(0,n.A)(i().mark((function e(t,n){var r,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Date.now(),!(a=this.mCache[t])){e.next=5;break}return a.timestamp=r,e.abrupt("return",a.value);case 5:return o=this.requestSKUsFromScriptEngine(n),this.mCache[t]={hash:t,timestamp:r,value:o},e.next=9,o;case 9:return this.clearOldCache(),e.abrupt("return",o);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"clearOldCache",value:function(){var e=this,n=Object.entries(this.mCache);n.length<=t.MAX_CACHE||n.sort((function(e,t){var n=(0,o.A)(e,2)[1];return(0,o.A)(t,2)[1].timestamp-n.timestamp})).splice(t.MAX_CACHE).forEach((function(t){var n=(0,o.A)(t,1)[0];return delete e.mCache[n]}))}},{key:"buildObjectModels",value:function(e){var t=[],n=0;return e.forEach((function(e){var r,i,a;if("Meter"===e.uom)t.push(new vp(--n,null!==(r=e.name)&&void 0!==r?r:"",null!==(i=e.description)&&void 0!==i?i:"",e.sku,null!==(a=e.price)&&void 0!==a?a:0,null,e.uom,e.quantity,e.parent_sku));else for(var o=0;o<e.quantity;o++){var s,u,c;t.push(new vp(--n,null!==(s=e.name)&&void 0!==s?s:"",null!==(u=e.description)&&void 0!==u?u:"",e.sku,null!==(c=e.price)&&void 0!==c?c:0,null,"Piece",1,e.parent_sku))}})),t}}]);var r,a,l,h,f,m,p,d}(_p);function Sp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sp=function(){return!!e})()}(0,c.A)(xp,"TypeRTTI",new le.O("ArticleListScriptEngineController",_p.TypeRTTI)),(0,c.A)(xp,"MAX_CACHE",100),(0,c.A)(xp,"MAGIC_HASH",5381);var Cp=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,Sp()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getName",value:function(){return"objectModelController"}},{key:"getModels",value:(a=(0,n.A)(i().mark((function e(){var t,n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Object.keys(this.mObjectModels).map((function(e){return n.mObjectModels[e]})),e.abrupt("return",Promise.resolve(t));case 2:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"getArticles",value:(r=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getModels();case 2:return t=e.sent,e.abrupt("return",this.buildArticles(t));case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}]);var r,a}(_p);function Ep(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ep(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ep(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ip(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ip=function(){return!!e})()}(0,c.A)(Cp,"TypeRTTI",new le.O("ArticleListObjectModelController",_p.TypeRTTI));var Op=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["articleListManager"],r=(0,oe.A)(r),e=(0,ae.A)(n,Ip()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"onModelsChanged",new M.B),(0,c.A)(e,"mArticleController",void 0),(0,c.A)(e,"_destroy$$",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getModels",value:(p=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resolveController();case 2:return t=e.sent,e.abrupt("return",t.getModels());case 4:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"getArticles",value:(m=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resolveController();case 2:return t=e.sent,e.abrupt("return",t.getArticles());case 4:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"serialize",value:(f=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getArticles();case 2:return t=e.sent,e.abrupt("return",t.map((function(e){var t,n;return{id:e.models_id,name:e.models_name,description:e.models_description,price:null!==(t=e.models_price)&&void 0!==t?t:0,sku:e.price_sku,uom:null!==(n=e.uom)&&void 0!==n?n:"Piece",quantity:e.quantity,parent_sku:e.parent_sku}})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"getController",value:(h=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.resolveController());case 1:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"getObjectModel",value:(l=(0,n.A)(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resolveController();case 2:return n=e.sent,e.abrupt("return",n.getObjectModel(t));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"getObjectModels",value:(o=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resolveController();case 2:return t=e.sent,e.abrupt("return",t.getObjectModels());case 4:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"syncObjectModels",value:(a=(0,n.A)(i().mark((function e(t){var n,r,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resolveController();case 2:return n=e.sent,e.next=5,n.syncObjectModels(t);case 5:if(e.sent){e.next=8;break}return e.abrupt("return");case 8:return e.prev=8,r=this.getParentObject(),e.next=12,n.getModels();case 12:return a=e.sent,e.next=15,n.getArticles();case 15:o=e.sent,this.onModelsChanged.next({product_scene_object_id:r.getSceneObjectId(),product_id:r.productId,models:a.map((function(e){return e.serialize()})),articles:o}),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(8),this.onModelsChanged.next(Rp({},e.t0));case 22:case"end":return e.stop()}}),e,this,[[8,19]])}))),function(e){return a.apply(this,arguments)})},{key:"resolveController",value:(r=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mArticleController){e.next=6;break}return t=this.getParentObject(),e.next=4,(0,y._)(this.resolvePricingSettings());case 4:"script_engine"===e.sent.sku_calculator?this.mArticleController=new xp(t):this.mArticleController=new Cp(t);case 6:return e.abrupt("return",this.mArticleController);case 7:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"resolvePricingSettings",value:function(){var e=this.getParentObject();return Rt._.getInstance().resolveBootstrapData(e.productId).pipe((0,E.s)(1),(0,cn.T)((function(e){return e.getPricingSettings()})),(0,ls.Q)(this._destroy$$))}},{key:"OnAttached",value:function(){this._destroy$$=new M.B}},{key:"OnDetached",value:function(){this._destroy$$.next(),this._destroy$$.complete(),delete this._destroy$$}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(kt.i.TypeRTTI)}}]);var r,a,o,l,h,f,m,p}(he.$);function Dp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dp(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bp=function(){return!!e})()}function Fp(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Op,"TypeRTTI",new le.O("ArticleListManagerComponent",he.$.TypeRTTI));var Np=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,Bp()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"renderTechnique",Ot._1.effect_reflector),(0,c.A)(n,"mColor",Ft.v.White()),(0,c.A)(n,"mOpacity",1),n.mName="ShaderEntityReflector",n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"color":return n instanceof Ft.v?this.mColor.copy(n):this.mColor.set(n),!0;case"opacity":return this.mOpacity=parseFloat(n),!0}return Fp(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Fp(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"color":return this.mColor;case"opacity":return this.mOpacity;case"width":case"height":return 20}return null}},{key:"serialize",value:function(e){var n=Pp(Pp({},Fp(t,"serialize",this,3)([e])),{type:"reflector"});return n.properties=Pp(Pp({},n.properties),{color:this.color.getHexString(),opacity:this.opacity}),n}},{key:"color",get:function(){return this.mColor},set:function(e){this.mColor.copy(e),this.markNeedsRenderUpdate()}},{key:"opacity",get:function(){return this.mOpacity},set:function(e){this.mOpacity=e,this.markNeedsRenderUpdate()}}])}(lc);function Lp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lp(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Up(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Up=function(){return!!e})()}function Vp(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Np,"TypeRTTI",new le.O("ShaderEntityReflector",lc.TypeRTTI));var zp=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,Up()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mHtmlText",""),(0,c.A)(n,"mViewportPosition",te.P.Zero()),(0,c.A)(n,"mViewportRotation",new re.O),n.mName="UiEntityAnnotation",n.mTitle="A1",n.mMargin=2,n.mColor.set("#1f1e1e"),n.mHoverColor.set("#343232"),n.mFontSize=10,n.mTextColor.copy(Ft.v.White()),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"htmlText":return this.mHtmlText=n,!0;case"viewport":return this.setValue("viewport_position",n.position),this.setValue("viewport_rotation",n.rotation),!0;case"viewport_position":return n instanceof te.P?this.mViewportPosition.copy(n):Array.isArray(n)&&this.mViewportPosition.fromArray(n),!0;case"viewport_rotation":return n instanceof re.O?this.mViewportRotation.copy(n):n instanceof ne.P?this.mViewportRotation.setFromQuaternion(n):Array.isArray(n)&&this.mViewportRotation.fromArray(n),!0;case"ui_options":case"options":try{var i=null;(i="string"==typeof n?JSON.parse(n):n).title&&(this.mTitle=i.title),void 0!==i.margin&&(this.mMargin=i.margin),void 0!==i.color&&this.mColor.set(i.color),void 0!==i.hover&&this.mHoverColor.set(i.hover),void 0!==i.fontSize&&(this.mFontSize=i.fontSize),void 0!==i.textColor&&this.mTextColor.set(i.textColor),i.htmlText&&(this.mHtmlText=i.htmlText)}catch(e){return!1}return!0}return Vp(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){switch(e){case"htmlText":return this.mHtmlText;case"viewport":return{position:this.mViewportPosition,rotation:this.mViewportRotation};case"viewport_position":return this.mViewportPosition;case"viewport_rotation":return this.mViewportRotation;case"ui_options":case"options":return{title:this.mTitle,margin:this.mMargin,color:this.mColor.getHexString(),hover:this.mHoverColor.getHexString(),fontSize:this.mFontSize,textColor:this.mTextColor.getHexString(),htmlText:this.mHtmlText}}return Vp(t,"proxyGetValue",this,3)([e])}},{key:"serialize",value:function(e){var n=Vp(t,"serialize",this,3)([e]),r={title:this.mTitle,margin:this.mMargin,color:this.mColor.getHexString(),hover:this.mHoverColor.getHexString(),fontSize:this.mFontSize,textColor:this.mTextColor.getHexString(),htmlText:this.mHtmlText};return jp(jp({},n),{},{type:"uix_annotation",ui_options:JSON.stringify(r),properties:jp(jp({},n.properties),{viewport_position:this.mViewportPosition.toArray(),viewport_rotation:this.mViewportRotation.toArray()})})}}])}(Bl);(0,c.A)(zp,"TypeRTTI",new le.O("UiEntityAnnotation",Bl.TypeRTTI));var Hp=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mFactories",{})}),[{key:"registerFactory",value:function(e,t){e in this.mFactories&&v.UX.warn("Overwriting existing factory: ".concat(e)),this.mFactories[e]=t}},{key:"registerFactories",value:function(e){for(var t=0,n=Object.entries(e);t<n.length;t++){var r=(0,o.A)(n[t],2),i=r[0],a=r[1];this.registerFactory(i,a)}}},{key:"createObject",value:function(e){var t;if(!(e in this.mFactories))return null;for(var n=null,r=this.mFactories[e],i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];var u=(t=[]).concat.apply(t,(0,a.A)(o||[]));return n=Ye(r.factory,(0,a.A)(u)),(r.components||[]).forEach((function(e){n.addComponent(new e)})),n}}])}(),Gp=__webpack_require__(1393);function qp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qp=function(){return!!e})()}var Wp=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,qp()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"delta",void 0),n.delta=e,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(Gp.Q);function Kp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kp(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yp(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return $p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$p(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function $p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Zp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zp=function(){return!!e})()}(0,c.A)(Wp,"TypeRTTI",new le.O("MessageSceneAfterUpdate",Gp.Q.TypeRTTI));var Qp=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["offsetManager"],r=(0,oe.A)(r),e=(0,ae.A)(n,Zp()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mOffsets",[]),(0,c.A)(e,"mLoadingObserver",void 0),(0,c.A)(e,"onOffsetChanged",void 0),(0,c.A)(e,"onOffsetVisibility",void 0),(0,c.A)(e,"mEngineProgressObserver",new hs),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"mOffsetsNeedsUpdate",!1),(0,c.A)(e,"mBlockOffsetUpdate",!1),(0,c.A)(e,"mOnDetached$",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this.mOnDetached$=new M.B,this.mOffsets=[],this.onOffsetChanged=new M.B,this.onOffsetVisibility=new M.B,this.mEngineProgressObserver.attach(),this.observeEngineProgress(),this.registerMessageHandler(Wp.TypeRTTI,(function(t){return e.update(t)}))}},{key:"OnDetached",value:function(){this.onOffsetChanged.unsubscribe(),this.onOffsetVisibility.unsubscribe(),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.unregisterFromAllMessages(),this.mOffsets=[],this.mEngineProgressObserver.detach(),this.mOnDetached$.next(),this.mOnDetached$.complete()}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(Js._.TypeRTTI)}},{key:"observeEngineProgress",value:function(){var e=this;this.mEngineProgressObserver.onEngineIdle.pipe((0,ls.Q)(this.mOnDetached$)).subscribe((function(t){e.mBlockOffsetUpdate=!t}))}},{key:"update",value:function(e){if(this.mOffsetsNeedsUpdate&&!this.mBlockOffsetUpdate){var t,n=!0,r=Yp(this.mOffsets);try{for(r.s();!(t=r.n()).done;){var i=t.value;this.updateOffsetGroupLevel(i,e.delta)||(n=!1)}}catch(e){r.e(e)}finally{r.f()}this.mOffsetsNeedsUpdate=!n}}},{key:"load",value:function(){var e=this;if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.mLoadingObserver&&(this.mLoadingObserver.error("Disposed"),delete this.mLoadingObserver),this.mLoadingObserver)return this.mLoadingObserver.pipe((0,ku.u)());this.mLoadingObserver=new L.m(1);var t=this.getParentObject().findParentOfTypeName("ProductNode"),n=t.productId;return this.onOffsetChanged.subscribe({next:function(e){R.K.eventBus().dispatch(new K.r(Q.E.OffsetChanged,Xp({product_uuid:t.getObjectUUID(),product_scene_id:t.getSceneObjectId()},e)))}}),this.onOffsetVisibility.subscribe({next:function(e){R.K.eventBus().dispatch(new K.r(Q.E.OffsetVisibility,Xp({product_uuid:t.getObjectUUID(),product_scene_id:t.getSceneObjectId()},e)))}}),Rt._.getInstance().resolveBootstrapData(n).pipe((0,E.s)(1)).subscribe({next:function(t){if(e.mLoadingObserver)try{var n=t.getOffsetGroups();It.eE.getItems(n).forEach((function(t){t.levels={},t.levels[0]=new te.P(t.offset_vec_x,t.offset_vec_y,t.offset_vec_z),t.rotation=new ne.P;try{"string"==typeof t.matrix&&(t.matrix=JSON.parse(t.matrix))}catch(e){t.matrix=void 0}e.mOffsets.push({model:t,needs_update:!1,levels:Object.keys(t.levels).map((function(e){return{offset:t.levels[e].clone()}})),rotation:t.rotation.clone()})})),e.mLoadingObserver.next(e),e.mLoadingObserver.complete()}catch(t){e.mLoadingObserver.error(t)}},error:function(t){e.mLoadingObserver.error(t)}}),this.mLoadingObserver}},{key:"getOffsets",value:function(){return this.mOffsets.map((function(e){return e.model}))}},{key:"getOffset",value:function(e){var t;return null===(t=this.mOffsets.find((function(t){return t.model.id===e})))||void 0===t?void 0:t.model}},{key:"getOffsetByGroup",value:function(e){var t;return null===(t=this.mOffsets.find((function(t){return t.model.offset_id===e})))||void 0===t?void 0:t.model}},{key:"getAbsoluteOffsetMatrix",value:function(e){var t=this.getOffset(e),n=(new ie.k).identity();if(!t)return n;var r=new te.P;Object.keys(t.levels).forEach((function(e){r.add(t.levels[e])}));var i=new te.P,a=new ne.P,o=new te.P(1,1,1);t.matrix&&(new ie.k).set(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5],t.matrix[6],t.matrix[7],t.matrix[8],t.matrix[9],t.matrix[10],t.matrix[11],t.matrix[12],t.matrix[13],t.matrix[14],t.matrix[15]).decompose(i,a,o);return n.multiply((new ie.k).makeTranslation(i.x,i.y,i.z)),n.multiply((new ie.k).makeRotationFromQuaternion(a.multiply(t.rotation))),n.multiply((new ie.k).makeScale(o.x,o.y,o.z)),n.premultiply((new ie.k).makeTranslation(r.x,r.y,r.z)),n}},{key:"getOffsetVector",value:function(e,t){var n=this.mOffsets.find((function(t){return t.model.id===e}));if(n)return n.levels[t]||(n.levels[t]={offset:new te.P}),n.levels[t].offset}},{key:"getOffsetRotation",value:function(e){var t=this.getOffset(e);if(t)return t.rotation}},{key:"getOffsetVisibility",value:function(e){var t=this.getOffset(e);return t&&!1!==t.visible}},{key:"getOffsetVectorByGroup",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.getOffsetByGroup(e);if(n)return this.getOffsetVector(n.id,t)}},{key:"setOffset",value:function(e,t,n){var r=this.mOffsets.find((function(t){return t.model.id===e}));r&&(r.levels[t]||(r.levels[t]={offset:new te.P}),r.levels[t].animation&&delete r.levels[t].animation,r.levels[t].offset.copy(n),r.needs_update=!0,this.mOffsetsNeedsUpdate=!0)}},{key:"setOffsetAnimation",value:function(e,t,n){var r=this.mOffsets.find((function(t){return t.model.id===e}));r&&(r.levels[t].animation=n,r.needs_update=!0,this.mOffsetsNeedsUpdate=!0)}},{key:"setOffsetRotation",value:function(e,t){var n=this.mOffsets.find((function(t){return t.model.id===e}));n&&(n.rotation_animation&&delete n.rotation_animation,n.rotation.copy(t),n.needs_update=!0,this.mOffsetsNeedsUpdate=!0)}},{key:"setOffsetRotationAnimation",value:function(e,t){var n=this.mOffsets.find((function(t){return t.model.id===e}));n&&(n.rotation_animation=t,n.needs_update=!0,this.mOffsetsNeedsUpdate=!0)}},{key:"hideOffsetNode",value:function(e){this.getOffset(e).visible=!1,this.onOffsetVisibility.next({id:e,visible:!1})}},{key:"showOffsetNode",value:function(e){this.getOffset(e).visible=!0,this.onOffsetVisibility.next({id:e,visible:!0})}},{key:"setOffsetByGroup",value:function(e,t,n){var r=this.getOffsetByGroup(e);r&&this.setOffset(r.id,t,n)}},{key:"updateOffsetGroupLevel",value:function(e,t){if(!e.needs_update)return!0;var n=!0;if(Object.entries(e.levels).forEach((function(r){var i=(0,o.A)(r,2),a=i[0],s=i[1],u=Number(a);if(u in e.model.levels||(e.model.levels[u]=new te.P),s.animation){var c=s.animation;c.isStarted()||c.isFinished()||c.start();var l=c.update(t);e.levels[u].offset.copy(l),e.model.levels[u].copy(l),c.isFinished()?delete s.animation:n=!1}else e.model.levels[u].copy(e.levels[u].offset)})),e.rotation_animation){var r=e.rotation_animation;r.isStarted()||r.isFinished()||r.start();var i=r.update(t);e.rotation.copy(i),e.model.rotation.copy(i),r.isFinished()?delete e.rotation_animation:n=!1}else e.model.rotation.copy(e.rotation);return e.needs_update=!n,this.onOffsetChanged.next({id:e.model.id,matrix:this.getAbsoluteOffsetMatrix(e.model.id)}),n}}])}(he.$);function Jp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jp=function(){return!!e})()}(0,c.A)(Qp,"TypeRTTI",new le.O("SceneOffsetManagerComponent",he.$.TypeRTTI));var ed=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=["materialGroupController"],i=(0,oe.A)(i),n=(0,ae.A)(r,Jp()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mMatGroupId",void 0),(0,c.A)(n,"_destroy$$",void 0),(0,c.A)(n,"mMaterialGroupManager",void 0),(0,c.A)(n,"mSharedKeyOverwrite",{}),n.mMatGroupId=e,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this._destroy$$=new M.B;var t=this.getParentObject().findParentOfType(kt.i.TypeRTTI);t.getComponent("materialGroupManager").resolveMaterialGroups().pipe((0,E.s)(1),(0,ls.Q)(this._destroy$$)).subscribe((function(n){e.mMaterialGroupManager=n;var r,i=n.getActiveMaterial(e.mMatGroupId);i in e.mSharedKeyOverwrite&&(r=e.mSharedKeyOverwrite[i]),e.updateMaterial(i,r),e.subscribeToMaterialChanges(t)})),this.registerMessageHandler(m.A_.TypeRTTI,(function(t){e.mSharedKeyOverwrite[t.materialModelId]=t.sharedKey}))}},{key:"OnDetached",value:function(){delete this.mMaterialGroupManager,this._destroy$$.next(),this._destroy$$.complete(),this.unregisterMessageHandler(m.A_.TypeRTTI)}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(Ds.F.TypeRTTI)}},{key:"getMaterialGroupId",value:function(){return this.mMatGroupId}},{key:"subscribeToMaterialChanges",value:function(e){var t=this;this.mMaterialGroupManager.onMaterialChanged.pipe((0,ls.Q)(this._destroy$$)).subscribe((function(n){if(n.id===t.mMatGroupId){var r=n.material_id,i=null==e?void 0:e.getSceneObjectId();r in t.mSharedKeyOverwrite&&(i=t.mSharedKeyOverwrite[r]),t.updateMaterial(r,i)}}))}},{key:"updateMaterial",value:function(e,t){h.N5.isNumeric(e)&&this.getParentObject().setMaterialById(e,t)}}])}(he.$);function td(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(td=function(){return!!e})()}(0,c.A)(ed,"TypeRTTI",new le.O("MaterialGroupController",he.$.TypeRTTI));var nd=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=["offsetGroupController"],i=(0,oe.A)(i),n=(0,ae.A)(r,td()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mOffsetGroupId",void 0),(0,c.A)(n,"_destroy$$",void 0),(0,c.A)(n,"mOffsetManager",void 0),(0,c.A)(n,"mInitialized",!1),n.mOffsetGroupId=e,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this._destroy$$=new M.B,this.initialize(),this.registerMessageHandler(m.vq.TypeRTTI,(function(){e.initialize()}))}},{key:"OnDetached",value:function(){this.unregisterFromAllMessages(),this._destroy$$.next(),this._destroy$$.complete(),this.mOffsetManager&&delete this.mOffsetManager,this.mInitialized=!1}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(Eo.Z.TypeRTTI)}},{key:"initialize",value:function(){var e=this;if(!this.mInitialized){var t=this.getParentObject().findParentOfType(Js._.TypeRTTI);if(t)t.getComponent("offsetManager").load().pipe((0,E.s)(1),(0,ls.Q)(this._destroy$$)).subscribe({next:function(t){e.mOffsetManager=t,e.setInitialOffsetPosition(),e.subscribeToTransformations(),e.subscribeToVisibility()},error:function(e){v.UX.warn("Failed to load offset manager",e)}}),this.mInitialized=!0}}},{key:"setInitialOffsetPosition",value:function(){var e=this.mOffsetManager.getAbsoluteOffsetMatrix(this.mOffsetGroupId);this.setObjectTransformation(e)}},{key:"subscribeToTransformations",value:function(){var e=this;this.mOffsetManager.onOffsetChanged.pipe((0,ls.Q)(this._destroy$$)).subscribe((function(t){e.mOffsetGroupId===t.id&&(e.setObjectTransformation(t.matrix),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)))}))}},{key:"setObjectTransformation",value:function(e){var t=new te.P,n=new ne.P,r=new te.P(1,1,1);e.decompose(t,n,r);var i=this.getParentObject();i.transform.position.copy(t),i.transform.quaternion.copy(n),i.transform.scale.copy(r)}},{key:"subscribeToVisibility",value:function(){var e=this;this.mOffsetManager.onOffsetVisibility.pipe((0,ls.Q)(this._destroy$$)).subscribe((function(t){e.mOffsetGroupId===t.id&&(e.getParentObject().visible=t.visible,R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)))}))}}])}(he.$);(0,c.A)(nd,"TypeRTTI",new le.O("OffsetGroupControllerComponent",he.$.TypeRTTI));var rd=__webpack_require__(85661),id=__webpack_require__(12217),ad=__webpack_require__(5771);function od(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(od=function(){return!!e})()}var sd=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["buildConfigurable"],r=(0,oe.A)(r),e=(0,ae.A)(n,od()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mSyncHashHelper",new yp.Q),(0,c.A)(e,"mSyncCachedHashHelper",new yp.Q),(0,c.A)(e,"_dependenciesReplay$$",void 0),(0,c.A)(e,"_meshUpdate$$",void 0),(0,c.A)(e,"_destroy$$",void 0),(0,c.A)(e,"_loaderIdle$$",void 0),(0,c.A)(e,"mOffsetNodes",{}),(0,c.A)(e,"mBatches",{}),(0,c.A)(e,"mPlaceHolder",void 0),(0,c.A)(e,"mSharedKeyOverwrite",{}),(0,c.A)(e,"mBoundingBox",void 0),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"mSubscriptionBrokers",[]),(0,c.A)(e,"mBatchesLoaded",!1),(0,c.A)(e,"mFirstBuildMeshList",!1),(0,c.A)(e,"mFirstSceneUpdate",!0),(0,c.A)(e,"mLoaderBusy",!1),(0,c.A)(e,"mBatchSyncHash",new yp.Q),(0,c.A)(e,"mBatchSyncHashCached",new yp.Q),e.mBoundingBox=new Os.N,e.mBatchSyncHash.copy(e.mBatchSyncHashCached),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this._meshUpdate$$=new M.B,this._destroy$$=new M.B,this._loaderIdle$$=new L.m(1),this.registerMessageHandler(m.VC.TypeRTTI,this.onSceneUpdate.bind(this)),this.registerMessageHandler(rd.A.TypeRTTI,(function(t){e.mSharedKeyOverwrite[t.materialModelId]=t.sharedKey,Object.keys(e.mBatches).forEach((function(n){e.mBatches[n].setMaterialOverwrite(t.materialModelId,t.sharedKey)}))})),this.observeMeshUpdates();var t=this.getParentObject();this.mSubscriptions.push(t.onMeshListUpdate.subscribe((function(){e.mFirstBuildMeshList=!0,e.dispatchUpdateMeshList()}))),this.mSubscriptionBrokers.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.DrawingTechniqueFailed),(function(){e.dispatchUpdateMeshList()}))),this.mFirstSceneUpdate=!0}},{key:"OnDetached",value:function(){this.unregisterFromAllMessages(),this.mSubscriptionBrokers.splice(0).forEach((function(e){return e.unsubscribe()})),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this._destroy$$.next(),this._destroy$$.complete(),this.mSharedKeyOverwrite={},this.markLoaderIdle(),this._loaderIdle$$.complete()}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(Js._.TypeRTTI)}},{key:"dispatchUpdateMeshList",value:function(){this.mSyncHashHelper.newHash(),this.mBatchSyncHash.newHash(),this._meshUpdate$$.next()}},{key:"markLoaderBusy",value:function(){this.mLoaderBusy=!0,this._loaderIdle$$.next(!this.mLoaderBusy)}},{key:"markLoaderIdle",value:function(){this.mLoaderBusy=!1,this._loaderIdle$$.next(!this.mLoaderBusy)}},{key:"getBatches",value:function(){return Object.entries(this.mBatches).map((function(e){return(0,o.A)(e,2)[1]}))}},{key:"observeMeshUpdates",value:function(){var e=this;this._meshUpdate$$.pipe((0,k.M)((function(){return e.markLoaderBusy()})),(0,wu.p)((function(t){return e.resolveDependencies()})),Cs(100,void 0,{leading:!0,trailing:!0}),(0,wu.p)((function(){return e.mSyncHashHelper.isSame(e.mSyncCachedHashHelper)?(0,Mr.of)(void 0):(0,Mr.of)({}).pipe((0,k.M)((function(){e.mSyncCachedHashHelper.copy(e.mSyncHashHelper),e.addPlaceHolder()})),Wm((function(){return(0,xn.H)(e.reconfigureBuild())})),(0,k.M)((function(){e.removePlaceHolder()})))})),(0,ls.Q)(this._destroy$$)).subscribe({next:function(){var t=e.syncObjects();e.mBatchSyncHash.copy(e.mBatchSyncHashCached),e.mBatchesLoaded=0===Object.keys(e.mBatches).length&&e.mFirstBuildMeshList,e.broadcastBuildEvent(!1,e.mBatchesLoaded),e.getParentObject().onConfigurableNodeUpdated.next(t),e.markLoaderIdle()},error:function(t){v.UX.error(t),e.broadcastBuildEvent(!0),e.markLoaderIdle()}})}},{key:"loadDependencies",value:(a=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getParentObject(),e.next=3,t.resolveSceneOffsetManager();case 3:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"resolveDependencies",value:function(){var e=this;return this._dependenciesReplay$$||(this._dependenciesReplay$$=new L.m(1),this.loadDependencies().then((function(){e._dependenciesReplay$$.next(),e._dependenciesReplay$$.complete()}),(function(t){e._dependenciesReplay$$.error(t)}))),this._dependenciesReplay$$}},{key:"createPlaceHolder",value:function(e){var t=e.getValue("place_holder");if(t)try{return v.UX.print("run place holder function"),t()}catch(e){v.UX.error("failed to run place holder function:",e)}}},{key:"addPlaceHolder",value:function(){if(!this.mPlaceHolder){var e=this.getParentObject(),t=e.findParentOfType(kt.i.TypeRTTI);if(t)if(t.findParentOfType(kt.i.TypeRTTI)&&e._isFirstBuild()){var n=void 0;if(n)return n;n=this.createPlaceHolder(t)}}}},{key:"removePlaceHolder",value:function(){this.mPlaceHolder&&delete this.mPlaceHolder}},{key:"reconfigureBuild",value:(r=(0,n.A)(i().mark((function e(){var t,n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.getParentObject(),v.UX.print("job: reconfigure options"),t._isFirstBuild()&&t._getPreconfiguredOptions()){e.next=5;break}return v.UX.print("ConfigurableNode: configuration loaded."),e.abrupt("return");case 5:if(t._setFirstBuild(!1),n=t.findParentOfType(kt.i.TypeRTTI)){e.next=9;break}throw new Error("Could not find product node.");case 9:return r=t._getPreconfiguredOptions(),e.next=12,(new A).load(n,r);case 12:v.UX.print("ConfigurableNode: configuration loaded.");case 13:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"createBatchNode",value:function(e,t,n,r,i,a,o){var s,u=this;n in this.mSharedKeyOverwrite&&(s=this.mSharedKeyOverwrite[n]);var c=R.K.sceneManager().createObject("meshBatch",null,e,n,i,t,a,s);for(var l in c.castShadow=!0,c.receiveShadow=!0,this.mSharedKeyOverwrite){var f=Number(l);c.setMaterialOverwrite(f,this.mSharedKeyOverwrite[f])}return o&&c.setParent(o),h.N5.isNumeric(r)&&c.findParentOfType(kt.i.TypeRTTI)&&c.addComponent(new ed(r)),this.mSubscriptionBrokers.push(R.K.eventBus().subscribe(id.F.getTopicName(),(function(e){u.updateBoundingBox()}),"".concat(c.getSceneObjectId()))),c}},{key:"syncOffsetNodes",value:function(){var e=this,t=!1,n=this.getParentObject(),r=n.getMeshList();return r&&Array.isArray(r)?(r.forEach((function(r){var i=r.offset_groups_set,a=n;i.forEach((function(n,r){var o=i.filter((function(e,t){return t<=r})).join(":");if(o in e.mOffsetNodes)return e.mOffsetNodes[o].setSyncHash(e.mSyncHashHelper.getHash()),void(a=e.mOffsetNodes[o]);var s=R.K.sceneManager().createObject("node");s.name="OffsetNode:".concat(o),e.mOffsetNodes[o]=s,R.K.sceneManager().addNode(s,a,!1),s.setSyncHash(e.mSyncHashHelper.getHash()),s.addComponent(new nd(n)),a=s,t=!0}))})),t):t}},{key:"clearOutOfSyncObjects",value:function(e){var t=this,n=!1,r=[];return Object.keys(e).forEach((function(i){var a=e[i],o=a.isDerivedOfTypeName("SceneEntity")&&a;(!a.isInSyncWithHash(t.mSyncHashHelper.getHash())||o&&o.renderObjectLoadState()===ad.U.Failed)&&(a.destroy(!1,new m.OZ),R.K.sceneManager().removeNode(a,!1,!1),r.push(i),n=!0)})),r.forEach((function(t){delete e[t]})),n}},{key:"syncMeshes",value:function(){var e=this,t=!1,n=this.getParentObject(),r=n.getMeshList();return r&&Array.isArray(r)?(r.forEach((function(r){var i="".concat(r.batch).concat(r.material_id);if(i in e.mBatches)e.mBatches[i].setSyncHash(e.mSyncHashHelper.getHash());else{var a=r.offset_groups_set,o=a.join(":"),s=0===a.length?n:e.mOffsetNodes[o];e.mBatches[i]=e.createBatchNode(r.batch,r.nodes,r.material_id,r.material_group,r.offset_groups_set,e.mSyncHashHelper.getHash(),s),R.K.sceneManager().addNode(e.mBatches[i],s,!1),t=!0}})),t):t}},{key:"syncObjects",value:function(){var e=!1;return e=this.syncOffsetNodes()||e,e=this.syncMeshes()||e,e=this.clearOutOfSyncObjects(this.mBatches)||e,e=this.clearOutOfSyncObjects(this.mOffsetNodes)||e,this.updateBoundingBox(),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)),e}},{key:"onSceneUpdate",value:function(e){var t=this;if(this.updateFirstBuild(),this.setProcessStatus(e),this.mFirstBuildMeshList&&!this.mBatchesLoaded&&this.mBatchSyncHash.isSame(this.mBatchSyncHashCached)){var n=Object.keys(this.mBatches);this.mBatchesLoaded=this.mFirstBuildMeshList&&(0===n.length||!n.some((function(e){return t.mBatches[e].renderObjectLoadState()!==ad.U.Loaded&&t.mBatches[e].renderObjectLoadState()!==ad.U.Failed}))),this.mBatchesLoaded&&this.broadcastBuildEvent(!1,!0)}}},{key:"updateFirstBuild",value:function(){this.mFirstSceneUpdate&&(this.mFirstSceneUpdate=!1,this._meshUpdate$$.next())}},{key:"setProcessStatus",value:function(e){e.setProcessStatus(t.TypeRTTI.getTypeName(),this.mLoaderBusy?xu.B.InProgress:xu.B.Idle)}},{key:"updateBoundingBox",value:function(){this.mBoundingBox.makeEmpty();var e=this.getParentObject();for(var t in this.mBatches){var n=this.mBatches[t];if(n.visible){var r=n.getBoundingBox(!1).clone();if(!r.isEmpty()){for(var i=new ie.k,a=n.getParent();a&&a.getSceneObjectId()!==e.getSceneObjectId();)i.premultiply(a.transform.matrix),a=a.getParent();i.multiply(n.transform.matrix),r.applyMatrix4(i),this.mBoundingBox.union(r)}}}this.getParentObject()._updateBoundingBox(this.mBoundingBox)}},{key:"broadcastBuildEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=this.getParentObject().findParentOfType(kt.i.TypeRTTI);if(t){var n=e?Q.E.ProductErrorLoading:Q.E.ProductFinishedLoading;R.K.eventBus().dispatch(new K.r(n,{catalogue_id:t.productId,scene_object_id:t.getSceneObjectId(),object_uuid:t.getObjectUUID()}))}}}}]);var r,a}(he.$);(0,c.A)(sd,"TypeRTTI",new le.O("BuildConfigurableComponent",he.$.TypeRTTI));var ud=__webpack_require__(23518);function cd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cd=function(){return!!e})()}var ld=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,cd()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mClippingPlanes",[]),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return ud.K.clipping_plane}},{key:"getPlanes",value:function(){return this.mClippingPlanes}},{key:"push",value:function(){var e;(e=this.mClippingPlanes).push.apply(e,arguments)}},{key:"pop",value:function(){return this.mClippingPlanes.pop()}},{key:"shift",value:function(){return this.mClippingPlanes.shift()}},{key:"unshift",value:function(e){this.mClippingPlanes.unshift(e)}},{key:"length",value:function(){return this.mClippingPlanes.length}},{key:"clear",value:function(){return this.mClippingPlanes.splice(0)}}])}(ud.R);function hd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hd=function(){return!!e})()}var fd=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["clippingController"],r=(0,oe.A)(r),e=(0,ae.A)(n,hd()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mClippingPlanes",{}),(0,c.A)(e,"mWorldClippingState",new ld),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){this.registerMessageHandler(m.VC.TypeRTTI,this.handleSceneUpdate.bind(this))}},{key:"OnDetached",value:function(){this.unregisterFromAllMessages()}},{key:"isAttachable",value:function(e){return e.isDerivedOfTypeName("ProductNode")}},{key:"updateClippingFromComponent",value:function(e){var t;e&&(t=this.mWorldClippingState).push.apply(t,(0,a.A)(e.getClippingPlanes()))}},{key:"updateClippingFromRoot",value:function(e){if(e){var t=e.getComponent("clippingController");this.updateClippingFromComponent(t),this.updateClippingFromRoot(e.getParent())}}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t,n){var r;null===(r=this.mClippingPlanes[e])||void 0===r||r.setFromNormalAndCoplanarPoint(t,n)}},{key:"setClippingPlane",value:function(e,t){var n;null===(n=this.mClippingPlanes[e])||void 0===n||n.copy(t)}},{key:"addClippingPlane",value:function(e){var t=f.V.guid();return this.mClippingPlanes[t]=e.clone(),t}},{key:"removeClippingPlane",value:function(e){delete this.mClippingPlanes[e]}},{key:"getClippingPlane",value:function(e){return this.mClippingPlanes[e]}},{key:"getClippingPlanes",value:function(){return Object.entries(this.mClippingPlanes).map((function(e){var t=(0,o.A)(e,2);t[0];return t[1]}))}},{key:"getWorldClippingState",value:function(){return this.mWorldClippingState}},{key:"handleSceneUpdate",value:function(e){var t;this.mWorldClippingState.clear(),(t=this.mWorldClippingState).push.apply(t,(0,a.A)(this.getClippingPlanes()));var n=this.getParentObject();this.updateClippingFromRoot(n.getParent()),this.mWorldClippingState.length()>0?n.setGlobalState(this.mWorldClippingState):n.removeGlobalState(ud.K.clipping_plane)}}])}(he.$);function md(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(md=function(){return!!e})()}(0,c.A)(fd,"TypeRTTI",new le.O("ClippingControllerComponent",he.$.TypeRTTI));var pd=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=["auto-focus"],n=(0,oe.A)(n),(0,ae.A)(e,md()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){}},{key:"OnDetached",value:function(){}},{key:"isAttachable",value:function(e){return e.isDerivedOfTypeName("CameraEntity")}}])}(he.$);function dd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dd=function(){return!!e})()}(0,c.A)(pd,"TypeRTTI",new le.O("AutoFocusComponent",he.$.TypeRTTI));var vd=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=["metricTransformer"],n=(0,oe.A)(n),(0,ae.A)(e,dd()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){this.registerMessageHandler(m.VC.TypeRTTI,this.handleSceneUpdate.bind(this))}},{key:"OnDetached",value:function(){this.unregisterFromAllMessages()}},{key:"isAttachable",value:function(e){if(!e.isDerivedTypeOf(Hs.i.TypeRTTI))return!1;var t=e;return!!t.getValue("unit")&&h.N5.isNumeric(t.getValue("world_ratio"))}},{key:"handleSceneUpdate",value:function(){var e=this.getParentObject(),t=e.getValue("unit"),n=e.getValue("world_ratio"),r=1;switch(t.toLowerCase()){case"mm":r=1e3;break;case"cm":r=100;break;case"inch":r=.0254}r*=n,e.transform.matrixCache.scale(new te.P(r,r,r))}}])}(he.$);(0,c.A)(vd,"TypeRTTI",new le.O("MetricTransformerComponent",he.$.TypeRTTI));var yd=__webpack_require__(52550);function gd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gd=function(){return!!e})()}var bd=function(e){function t(){var e,n,r,i;if((0,s.A)(this,t),n=this,r=t,i=["droppable-handler"],r=(0,oe.A)(r),e=(0,ae.A)(n,gd()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mParentEntity",void 0),(0,c.A)(e,"mCellPlane",void 0),(0,c.A)(e,"mCellPlaneGeometry",void 0),(0,c.A)(e,"mCellPlaneMaterial",void 0),(0,c.A)(e,"mCellPlaneWidth",void 0),(0,c.A)(e,"mCellPlaneHeight",void 0),(0,c.A)(e,"mPlaneOpacity",0),(0,c.A)(e,"mAnimationHandle",void 0),e.mCellPlaneWidth=1,e.mCellPlaneHeight=1,!t.sDroppableTextureHandle){var a,o=en.J.getManager(en.n.TextureManager),u=(new ru.$).load("".concat(et.w.assetsUrl,"system/placeholders/drop-icon.png"),(function(){a.updateSource(u)}),void 0,(function(e){v.UX.error("Unable to load droppable-cell-plane texture:",e);var n=t.sDroppableTextureHandle;delete t.sDroppableTextureHandle,o.disposeResource(n)}));a=R.K.renderer().getRenderEngine().createTexture2D("droppable-cell-texture",u,!0,void 0,Cn.qC.ClampToEdge,Cn.qC.ClampToEdge,Cn.wm.Linear,Cn.wm.Linear,Cn.wm.Linear,!1),t.sDroppableTextureHandle=o.makeResourceRaw(a)}return e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"OnAttached",value:function(){this.mParentEntity=this.getParentObject()}},{key:"OnDetached",value:function(){this.cancelAnimation(),this.disposeCellPlane(),delete this.mParentEntity}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(Qs.TypeRTTI)}},{key:"createCellPlane",value:(o=(0,n.A)(i().mark((function e(){var n,r,a,o,s,u,c,l=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=l.length>0&&void 0!==l[0]?l[0]:1,r=l.length>1&&void 0!==l[1]?l[1]:1,this.mParentEntity){e.next=4;break}return e.abrupt("return");case 4:if(this.mCellPlane&&this.mCellPlaneWidth===n&&this.mCellPlaneHeight===r){e.next=35;break}if(this.disposeCellPlane(),this.mCellPlaneWidth=n,this.mCellPlaneHeight=r,this.mCellPlaneMaterial=R.K.renderer().getRenderEngine().createMaterialBasic("droppable-cell-plane"),this.mCellPlaneMaterial.setDiffuseColor(new Ft.v(2677654)),this.mCellPlaneMaterial.setSide(Fs.k.Double),this.mCellPlaneMaterial.setTransparent(!0),this.mCellPlaneMaterial.setOpacity(0),!t.sDroppableTextureHandle){e.next=20;break}return a=en.J.getManager(en.n.TextureManager),o=a.findResourceWithHandle(t.sDroppableTextureHandle),e.next=18,o.resolve();case 18:s=e.sent,this.mCellPlaneMaterial.setDiffuseMap(s);case 20:this.mCellPlaneGeometry=Us.Create(n,r,1,1),this.mCellPlane=R.K.sceneManager().createObject("mesh",void 0,this.mCellPlaneGeometry,this.mCellPlaneMaterial),this.mCellPlane.pickable=!1,this.mCellPlane.layers.enable(4),this.mCellPlane.layers.enable(5),this.mCellPlane.name="droppable-cell-plane",this.mCellPlane.castShadow=!1,this.mCellPlane.receiveShadow=!1,u=R.K.sceneManager().getScene(),c=te.P.One(),u.transform.getWorldScale(c),this.mCellPlane.transform.scale.copy(new te.P(1/(Math.abs(c.x)<1e-5?1:c.x),1/(Math.abs(c.y)<1e-5?1:c.y),1/(Math.abs(c.z)<1e-5?1:c.z))),this.mCellPlane.transform.rotation.copy(new re.O(-.5*Math.PI,0,0)),R.K.sceneManager().addNode(this.mCellPlane,void 0,!1),v.UX.print("Create cell plane:",n,r);case 35:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"disposeCellPlane",value:function(){this.mCellPlane&&(delete this.mCellPlaneGeometry,delete this.mCellPlaneMaterial,R.K.sceneManager().removeNode(this.mCellPlane,!1,!0),this.mCellPlane.destroy(),delete this.mCellPlane)}},{key:"getCellPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this.getCellQuaternion(e),i=new te.P(t,0,n).addScalar(1e-5),a=i.clone().applyQuaternion(r),o=i.clone().multiplyScalar(.5).applyQuaternion(r);return(new te.P).copy(e.point).divide(a).floor().multiply(a).add(o)}},{key:"getCellRotation",value:function(e){return(new re.O).setFromQuaternion(this.getCellQuaternion(e))}},{key:"getCellQuaternion",value:function(e){return this.mCellPlane.transform.quaternion.clone().multiply((new ne.P).setFromEuler(new re.O(.5*Math.PI,0,0)))}},{key:"interceptDragMove",value:(a=(0,n.A)(i().mark((function e(t){var n,r,a,o,s,u=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:1,r=u.length>2&&void 0!==u[2]?u[2]:1,e.next=4,this.createCellPlane(n,r);case 4:return a=this.mParentEntity.getCellSize(),o=this.getCellPosition(t,a.width,a.height),this.mCellPlane.transform.quaternion.copy(t.entity.transform.quaternion),s=t.normal,o.add(s.clone().multiplyScalar(.003)),this.fadeIn(o),e.abrupt("return",!0);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"fadeIn",value:function(e){this.mCellPlane&&this.mCellPlane.transform.position.distanceToSquared(e)>.001&&(v.UX.print("Reset cell to position: ",e),this.mPlaneOpacity=.1,this.mCellPlane.transform.position.copy(e),this.cancelAnimation(),this.animateFadeIn())}},{key:"cancelAnimation",value:function(){void 0!==this.mAnimationHandle&&(window.cancelAnimationFrame(this.mAnimationHandle),delete this.mAnimationHandle)}},{key:"animateFadeIn",value:function(){var e=this;this.mPlaneOpacity+=.025,this.mPlaneOpacity=Math.min(1,this.mPlaneOpacity),this.mCellPlaneMaterial.setOpacity(this.mPlaneOpacity),this.mPlaneOpacity>=1?delete this.mAnimationHandle:this.mAnimationHandle=window.requestAnimationFrame((function(){return e.animateFadeIn()}))}},{key:"animateFadeOut",value:function(){var e=this;this.mPlaneOpacity-=.025,this.mPlaneOpacity=Math.max(0,this.mPlaneOpacity),this.mCellPlaneMaterial.setOpacity(this.mPlaneOpacity),this.mPlaneOpacity<=0?delete this.mAnimationHandle:this.mAnimationHandle=window.requestAnimationFrame((function(){return e.animateFadeOut()}))}},{key:"markDragMaterial",value:function(e){return!0}},{key:"resetDragMaterial",value:function(e){v.UX.print("reset drag material object:",e),this.cancelAnimation(),this.animateFadeOut()}},{key:"acceptDrop",value:(r=(0,n.A)(i().mark((function e(t){var n,r,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.mParentEntity.getCellSize(),this.mCellPlane){e.next=4;break}return e.next=4,this.createCellPlane(n.width,n.height);case 4:return r=this.getCellPosition(t,n.width,n.height),a=this.getCellQuaternion(t),v.UX.print("Place on intersection:",r,a,t),e.abrupt("return",yd.d.create(r,a,te.P.One()));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]);var r,a,o}(he.$);(0,c.A)(bd,"sDroppableTextureHandle",void 0);var Ad=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),null,[{key:"Create",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Ft.v(4473924),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Ft.v(8947848),i=t/2,a=e/t,o=e/2,s=[],u=[],c=[],l=0,h=-o,f=0;l<=t;l++,h+=a,f+=4){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var m=l===i?r:n;c.push(m.r,m.g,m.b,1),c.push(m.r,m.g,m.b,1),c.push(m.r,m.g,m.b,1),c.push(m.r,m.g,m.b,1),u.push(f,f+1,f+2,f+3)}var p=R.K.renderer().getRenderEngine().createBuffer();return p.setIndexData(new Ls.T(new Uint32Array(u),1)),p.setVertexData(Ns.P.POSITION,new Ls.T(new Float32Array(s),3)),p.setVertexData(Ns.P.COLOR,new Ls.T(new Float32Array(c),4)),p}}])}();function _d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_d=function(){return!!e})()}var Md=function(e){function t(e){var n,r,i,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Ft.v(4473924),h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Ft.v(8947848);(0,s.A)(this,t),r=this,i=t,a=[e,Ad.Create(o,u,l,h)],i=(0,oe.A)(i),n=(0,ae.A)(r,_d()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"renderTechnique",Ot._1.mesh_line),n.mName="GridEntity",n.mPickable=!0,n.mCastShadow=!1,n.drawMode=Ds.O.LINES;var f=R.K.renderer().getRenderEngine().createMaterialLine("grid-material");return f.setDiffuseColor(Ft.v.White()),n.setMaterial(f),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(ou);function kd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kd=function(){return!!e})()}(0,c.A)(Md,"TypeRTTI",new le.O("GridEntity",ou.TypeRTTI));var wd=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,i=["catalogueMeta"],r=(0,oe.A)(r),e=(0,ae.A)(n,kd()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mCatalogueMeta",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadCatalogueMeta",value:(r=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=t.getParentObject().productId;v.UX.print("resolve catalogue meta for: ",r),Rt._.getInstance().resolveBootstrapData(r).pipe((0,E.s)(1)).subscribe((function(n){var r=n.getCatalogue();t.mCatalogueMeta=r||{},e(t.mCatalogueMeta)}),(function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"getCatalogueMeta",value:function(){return this.mCatalogueMeta}},{key:"OnAttached",value:function(){}},{key:"OnDetached",value:function(){}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(kt.i.TypeRTTI)}}]);var r}(he.$);function Td(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Td=function(){return!!e})()}var xd=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,r=(0,oe.A)(r),(e=(0,ae.A)(n,Td()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i))).registerFactories({product:{factory:kt.i,components:[Za,Fa,sh,up,lp,fp,Op,Cu,wd,fd]},configurable:{factory:Js._,components:[Qp,sd,vd]},vnode:{factory:Eo.Z},node:{factory:Eo.Z},mesh:{factory:Ds.F},meshBatch:{factory:nu},group:{factory:Bs},view:{factory:ss},spotLight:{factory:Jt},pointLight:{factory:$t},hemisphereLight:{factory:Kt},directionalLight:{factory:Gt},ambientLight:{factory:Vt},rectAreaLight:{factory:al},sphere:{factory:sl},plane:{factory:cl},box:{factory:hl},line:{factory:uc},camera_perspective:{factory:Bt,components:[]},camera_perspective_fps:{factory:Bt,components:[Fe]},camera_perspective_orbit:{factory:Bt,components:[Ie]},camera_perspective_turntable:{factory:Bt,components:[je]},camera_auto_focus:{factory:Bt,components:[Ie,pd]},reference_product:{factory:Na.t},water:{factory:ml},reflector:{factory:Np},glare:{factory:vl},flare:{factory:gl},fire:{factory:fc},skycube:{factory:_l},skyequirect:{factory:wl},ao_plane:{factory:dp},global_clipper:{factory:El},uix_button:{factory:Bl},uix_image:{factory:Ll},uix_tag:{factory:Ul},uix_text:{factory:Hl},uix_annotation:{factory:zp},drop_area:{factory:Qs,components:[bd]},grid:{factory:Md}}),e}return(0,ue.A)(t,e),(0,u.A)(t)}(Hp),Sd=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mNewNodes",{}),(0,c.A)(this,"mDeleteNodes",{}),(0,c.A)(this,"mMovedNodes",{})}),[{key:"_createNewNodesIfNotExists",value:function(e){this.mNewNodes[e]=this.mNewNodes[e]||[]}},{key:"_createDeletedNodesIfNotExists",value:function(e){this.mDeleteNodes[e]=this.mDeleteNodes[e]||{}}},{key:"_createMovedNodesIfNotExists",value:function(e){this.mMovedNodes[e]=this.mMovedNodes[e]||{}}},{key:"getNodeNamespace",value:function(e){for(var t="/",n=null==e?void 0:e.findParentOfType(Na.t.TypeRTTI),r=[e];r.length>0;){var i=r.shift();if(!i)break;if(i.isDerivedTypeOf(kt.i.TypeRTTI)){var a=(n=i.findParentOfType(Na.t.TypeRTTI))?n.getObjectUUID():i.productId;t="/".concat(a).concat(t)}var o=i.findParentOfType(kt.i.TypeRTTI);o&&r.push(o)}return t}},{key:"addNewNode",value:function(e){var t=this.getNodeNamespace(e);this._createNewNodesIfNotExists(t),this._createDeletedNodesIfNotExists(t),this.mNewNodes[t].find((function(t){return t.getObjectId()===e.getObjectId()}))||this.mNewNodes[t].push(e),!0===this.mDeleteNodes[t][e.getSceneObjectId()]&&delete this.mDeleteNodes[t][e.getSceneObjectId()]}},{key:"getNewNodes",value:function(e){return this._createNewNodesIfNotExists(e),this.mNewNodes[e]}},{key:"getDeletedNodes",value:function(e){return this._createDeletedNodesIfNotExists(e),Object.keys(this.mDeleteNodes[e]).map((function(e){return parseInt(e,10)}))}},{key:"isNodeDeleted",value:function(e,t){return this._createDeletedNodesIfNotExists(e),!0===this.mDeleteNodes[e][t]}},{key:"isNodeMoved",value:function(e,t){return this._createMovedNodesIfNotExists(e),this.mMovedNodes[e][t]?this.mMovedNodes[e][t]:null}},{key:"setNodeDeleted",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=(arguments.length>3?arguments[3]:void 0)||this.getNodeNamespace(e);if(this._createNewNodesIfNotExists(r),this._createDeletedNodesIfNotExists(r),t<0){var i=this.mNewNodes[r].findIndex((function(e){return-e.id===t}));i>=0&&this.mNewNodes[r].splice(i,1)}else this.mDeleteNodes[r][t]=n}},{key:"setNodeMoved",value:function(e,t,n){var r=this.getNodeNamespace(e);this._createMovedNodesIfNotExists(r),this.mMovedNodes[r][t]=n}},{key:"resetNodeStates",value:function(){this.mNewNodes={},this.mDeleteNodes={},this.mMovedNodes={}}}])}(),Cd=__webpack_require__(97298),Ed=__webpack_require__(21501),Rd=__webpack_require__(82363);function Id(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Id=function(){return!!e})()}var Od,Dd,Pd=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,Id()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"delta",void 0),n.delta=e,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(Gp.Q);function Bd(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Fd(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fd(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Fd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}(0,c.A)(Pd,"TypeRTTI",new le.O("MessageSceneBeforeUpdate",Gp.Q.TypeRTTI)),(Dd=Od||(Od={}))[Dd.Started=0]="Started",Dd[Dd.Finished=1]="Finished",Dd[Dd.Error=2]="Error";var Nd=function(){return(0,u.A)((function e(t,n){(0,s.A)(this,e),(0,c.A)(this,"mSceneFactory",void 0),(0,c.A)(this,"mPersistPool",void 0),(0,c.A)(this,"mScene",void 0),(0,c.A)(this,"mActiveView",void 0),(0,c.A)(this,"mSelectedEntity",void 0),(0,c.A)(this,"mSubscriptions",[]),(0,c.A)(this,"mActiveProductNode",void 0),(0,c.A)(this,"mProductLoadingEvent",void 0),(0,c.A)(this,"mProductLoaded",void 0),(0,c.A)(this,"mOnSceneUpdated",void 0),this.mSceneFactory=t||new xd,this.mPersistPool=n||new Sd}),[{key:"createObject",value:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var a=[t].concat(r||[]);return this.mSceneFactory.createObject(e,a)}},{key:"isScene",value:function(e){return this.mScene.getObjectId()===e.getObjectId()}},{key:"getScene",value:function(){return this.mScene}},{key:"getRootProductNode",value:function(){return this.findNodesOfType(kt.i.TypeRTTI,(function(e){return e.enabled}))[0]}},{key:"getActiveProductNode",value:function(){return this.mActiveProductNode}},{key:"setActiveProductNode",value:function(e){this.mActiveProductNode=e}},{key:"getActiveCamera",value:function(){var e=this.findNodesOfType(We.TypeRTTI,(function(e){return e.isCameraActive()}));if(0===e.length){var t=this.createObject("camera_perspective_orbit");t.name="DefaultCamera",t.transform.position.set(0,1,3),t.target.set(0,0,0),t.fov=45,t.near=.01,t.far=1e3,t.setCameraActive(!0),t.setCameraPartOfScene(!1),e.push(t),this.addNode(t),v.UX.print("SceneManager adding default camera to scene.",t)}return e[0]}},{key:"getDefaultView",value:function(){var e=this.getRootProductNode();if(e)return this.findNodesOfType(ss.TypeRTTI,(function(t){var n=t.findParentOfType(kt.i.TypeRTTI);return!!n&&n.getObjectUUID()===e.getObjectUUID()}),e)[0]}},{key:"setActiveViewId",value:function(e,t){var n=this.findNodesOfType(kt.i.TypeRTTI,(function(t){return t.getSceneObjectId()===e}));if(0!==n.length){var r=this.findNodesOfType(ss.TypeRTTI,(function(e){return e.getViewId()===t}),n[0]);if(0!==r.length)return this.setActiveView(r[0]),r[0]}}},{key:"setActiveView",value:function(e){this.mActiveView=e,v.UX.print("Make viewnode active:",this.mActiveView),this.findNodesOfType(ss.TypeRTTI).forEach((function(e){e.enabled=e.isViewVisible()})),R.K.eventBus().dispatch(new K.r(Q.E.ActiveViewChanged,this.mActiveView)),this.deselect()}},{key:"findNodesOfType",value:function(e,t,n){return this.findNodesOfTypeName(e.getTypeName(),t,n)}},{key:"findNodesOfTypeName",value:function(e,t,n){var r=new Array,i=new Array;if(!this.mScene)return r;for(i.push(n||this.mScene);i.length>0;){var a=i.shift();a.isDerivedOfTypeName(e)&&(null==t||t(a))&&r.push(a),a.isDerivedTypeOf(Eo.Z.TypeRTTI)&&a.getChildren().forEach((function(e){i.push(e)}))}return r}},{key:"fixedUpdate",value:function(e){this.mScene.fixedUpdate(new Rd.P(e))}},{key:"update",value:function(e){this.mScene.beforeUpdate(new Pd(e));var t=new Cd.V(e);this.mScene.update(t),this.mOnSceneUpdated.next(t),this.mScene.afterUpdate(new Wp(e))}},{key:"_draw",value:function(e,t){this.mScene.draw(e,t)}},{key:"_afterDraw",value:function(e,t){this.mScene.afterDraw(e,t)}},{key:"createScene",value:function(){var e=this;if(!this.mScene){this.mScene=this.createObject("node",-1),this.mScene.name="Scene",this.mSubscriptions.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ObjectSelected),(function(t){var n=t.getData().selection;e.select(n,{},!1)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductStartLoading),(function(t){e.mProductLoadingEvent.next({name:"start",event:t})})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductFinishedLoading),(function(t){e.mProductLoadingEvent.next({name:"finished",event:t})})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductErrorLoading),(function(t){e.mProductLoadingEvent.next({name:"error",event:t})})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.NodeRemoved),(function(t){var n;"ProductNode"===(null===(n=t.getData())||void 0===n||null===(n=n.getType())||void 0===n?void 0:n.getTypeName())&&e.mProductLoadingEvent.next({name:"removed",event:new K.r(Q.E.NodeRemoved,{scene_object_id:t.getData().getSceneObjectId()})})}))),this.mOnSceneUpdated=new M.B;var t=new Map;this.mProductLoaded=new M.B,this.mProductLoadingEvent=new M.B,this.mProductLoadingEvent.pipe((0,k.M)((function(n){var r,i,a=n.event.getData().scene_object_id,o=e.findNodesOfType(kt.i.TypeRTTI,(function(e){return e.getSceneObjectId()===a}))[0],s=null===(r=null==o?void 0:o.enabled)||void 0===r||r,u=!0;switch(null!=o&&null!==(i=o.getParent())&&void 0!==i&&i.isDerivedTypeOf(ss.TypeRTTI)&&!(null==o?void 0:o.getParent()).isViewVisible()&&(u=!1),n.name){case"start":s&&u&&t.set(a,Od.Started);break;case"finished":t.has(a)&&t.set(a,Od.Finished);break;case"error":t.has(a)&&t.set(a,Od.Error);break;case"removed":t.has(a)&&t.delete(a)}})),(0,ls.Q)(this.mProductLoaded)).subscribe((function(){Array.from(t.values()).some((function(e){return e===Od.Started}))||(Array.from(t.values()).some((function(e){return e===Od.Error}))&&R.K.eventBus().dispatch(new K.r(Q.E.BuildFailed)),R.K.eventBus().dispatch(new K.r(Q.E.BuildFullyLoaded)),e.mProductLoaded.next())}))}}},{key:"destroyScene",value:function(){this.mScene&&(this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mProductLoadingEvent.unsubscribe(),this.mProductLoaded.next(),this.mProductLoaded.complete(),this.mOnSceneUpdated.complete(),this.mScene.destroy(!0,new Ed.O),this.removeNode(this.mScene,!1,!0),delete this.mScene)}},{key:"addNode",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t||this.getScene();r?r._attachChild(e):(e.setParent(r),e.onAttached(r),R.K.eventBus().dispatch(new K.r(Q.E.SceneObjectAttached,e))),n&&this.getPersistPool().addNewNode(e),R.K.eventBus().dispatch(new K.r(Q.E.SceneGraphAdded,e)),R.K.eventBus().dispatch(new K.r(Q.E.NodeAdded,e))}},{key:"removeNode",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=e.getParent();if(a){if(!a.isDerivedTypeOf(Eo.Z.TypeRTTI))throw new Error("Parent '".concat(a.name,"' is not a SceneNode object"));n&&this.deepRemoveNode(e,t&&r,i);var o=this.getPersistPool().getNodeNamespace(e),s=a._detachChild(e);return s?(t&&this.getPersistPool().setNodeDeleted(s,s.getSceneObjectId(),!0,o),i&&s.destroy(),R.K.eventBus().dispatch(new K.r(Q.E.SceneGraphRemoved,e)),R.K.eventBus().dispatch(new K.r(Q.E.NodeRemoved,s)),s):s}v.UX.warn("'".concat(e.name,"' is not attached to any parent."))}},{key:"deepRemoveNode",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0;e.isDerivedTypeOf(Eo.Z.TypeRTTI)&&e.getChildren().forEach((function(e){t.removeNode(e,n,!0,!0,r)}))}},{key:"moveNode",value:function(e,t){v.UX.print("Move",e,t);var n=e.getParent();if(n){var r=n._detachChild(e);if(r)return t._attachChild(r),r.getSceneObjectId()>=0&&this.getPersistPool().setNodeMoved(r,r.getSceneObjectId(),t.getSceneObjectId()),R.K.eventBus().dispatch(new K.r(Q.E.SceneGraphChanged,e)),R.K.eventBus().dispatch(new K.r(Q.E.NodeChanged,r)),r}else v.UX.warn("product node can not be moved")}},{key:"saveScene",value:function(){var e=this.findNodesOfType(kt.i.TypeRTTI);e.splice(1);var t,n=[],r=Bd(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,a=i.serialize(!1,!0);n.push({product_id:parseInt(i.getValue("product_id"),10),scene:a,deletions:this.getPersistPool().getDeletedNodes(this.getPersistPool().getNodeNamespace(i))})}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"resetSaveStates",value:function(){this.getPersistPool().resetNodeStates()}},{key:"select",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return!(!e&&!this.mSelectedEntity||this.mSelectedEntity&&e&&this.mSelectedEntity.getSceneObjectId()===e.getSceneObjectId())&&(this.mSelectedEntity=e,v.UX.print("SceneManager: selected entity:",this.mSelectedEntity,t,n),n&&R.K.eventBus().dispatch(new K.r(Q.E.ObjectSelected,{selection:this.mSelectedEntity,options:t})),!0)}},{key:"deselect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.select(void 0,e,t)}},{key:"getActiveView",value:function(){return this.mActiveView}},{key:"getSelectedEntity",value:function(){return this.mSelectedEntity}},{key:"getActiveCameraId",value:function(){return this.getActiveCamera().getSceneObjectId()}},{key:"getSceneFactory",value:function(){return this.mSceneFactory}},{key:"getPersistPool",value:function(){return this.mPersistPool}},{key:"onSceneUpdated",get:function(){return this.mOnSceneUpdated}},{key:"onSceneIdle",get:function(){return this.mOnSceneUpdated.pipe((0,cn.T)((function(e){return!e.isAnyProcessInProgress()})))}}])}(),Ld=function(){return(0,u.A)((function e(t,n){(0,s.A)(this,e),(0,c.A)(this,"mRenderer",void 0),(0,c.A)(this,"mSceneEntity",void 0),(0,c.A)(this,"mSyncHash",""),(0,c.A)(this,"mReady",!1),(0,c.A)(this,"mAttached",!1),(0,c.A)(this,"mDisposed",!1),this.mRenderer=n,this.mSceneEntity=t}),[{key:"ready",get:function(){return this.mReady}},{key:"attached",get:function(){return this.mAttached}},{key:"disposed",get:function(){return this.mDisposed}},{key:"initialize",value:function(){var e=this;this.mReady=!1,this.mDisposed=!1,this.mSceneEntity.setRenderObjectLoadState(ad.U.Loading),this.loadResource().then((function(){e.mDisposed||(e.createRenderObject(),e.mReady=!0,e.afterCreateRenderObject(),e.mSceneEntity.setRenderObjectLoadState(ad.U.Loaded))})).catch((function(t){v.UX.warn("Failed to load resources:",t),e.mDisposed=!0,e.mSceneEntity.setRenderObjectLoadState(ad.U.Failed),R.K.eventBus().dispatch(new K.r(Q.E.DrawingTechniqueFailed,{entity:e.mSceneEntity}))}))}},{key:"attach",value:function(){this.mAttached=!0}},{key:"detach",value:function(){this.mAttached=!1}},{key:"setSyncHash",value:function(e){this.mSyncHash=e}},{key:"getSyncHash",value:function(){return this.mSyncHash}},{key:"update",value:function(e){}},{key:"dispose",value:function(){var e;this.mDisposed||(null===(e=this.mSceneEntity)||void 0===e||e.setRenderObjectLoadState(ad.U.Idle),this.destroyRenderObject(),this.mDisposed=!0)}},{key:"afterCreateRenderObject",value:function(){}},{key:"equals",value:function(e){return!!e&&this.mSceneEntity.id===e.id}},{key:"equalsId",value:function(e){return this.mSceneEntity.id===e}},{key:"getSceneEntity",value:function(){return this.mSceneEntity}}])}();function jd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jd=function(){return!!e})()}function Ud(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Vd=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,jd()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mRenderObject",void 0),(0,c.A)(e,"mMatrix",BABYLON.Matrix.Identity()),(0,c.A)(e,"mShowNormals",!1),(0,c.A)(e,"mNormalHelper",void 0),(0,c.A)(e,"mMatrixNeedsUpdate",!0),(0,c.A)(e,"mBoundingBox",new Os.N),(0,c.A)(e,"mOriginalAttachState",void 0),(0,c.A)(e,"mSubscriptions",[]),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"attach",value:function(){Ud(t,"attach",this,3)([]),this.makeVisibleAfterAttach(),this.mSubscriptions.push(this.mSceneEntity.transform.onChange.subscribe(this.onMatrixUpdate.bind(this)))}},{key:"detach",value:function(){Ud(t,"detach",this,3)([]),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"getRenderObject",value:function(){return this.mRenderObject}},{key:"getRenderer",value:function(){return this.mRenderer}},{key:"update",value:function(e){Ud(t,"update",this,3)([e]),this.updateTranslation(),this.mSceneEntity.needsBoundingBoxUpdate()&&this.updateBoundingBox(),this.mSceneEntity.needsRenderUpdate()&&(this.onUpdateDirty(),this.mSceneEntity.setNeedsRenderUpdate(!1))}},{key:"onUpdateDirty",value:function(){this.mRenderObject&&this.mRenderObject.setEnabled(this.mSceneEntity.visible)}},{key:"updateTranslation",value:function(){if(!this.mMatrixNeedsUpdate&&!this.mSceneEntity.transform.matrixNeedsUpdate&&!this.mSceneEntity.transform.matrixWorldNeedsUpdate)return!1;var e=this.mSceneEntity.transform.matrixWorld.elements;return this.mMatrix.setRowFromFloats(0,e[0],e[1],e[2],e[3]),this.mMatrix.setRowFromFloats(1,e[4],e[5],e[6],e[7]),this.mMatrix.setRowFromFloats(2,e[8],e[9],e[10],e[11]),this.mMatrix.setRowFromFloats(3,e[12],e[13],e[14],e[15]),this.mRenderer.isRightHandedSystemActive()||this.mMatrix.toggleModelMatrixHandInPlace(),this.mRenderObject instanceof BABYLON.TransformNode&&(this.mRenderObject.freezeWorldMatrix(this.mMatrix),this.mRenderObject instanceof BABYLON.AbstractMesh&&this.mRenderObject._updateBoundingInfo()),this.mNormalHelper&&this.mNormalHelper.freezeWorldMatrix(this.mMatrix),!0}},{key:"updateBoundingBox",value:function(){this.mSceneEntity._updateBoundingBox(this.mBoundingBox)}},{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isEnabled()}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.setEnabled(e)}},{key:"makeInvisibleBeforeAttach",value:function(){this.mOriginalAttachState=this.getVisibilityAttachState(),this.setVisibilityAttachState(!1)}},{key:"makeVisibleAfterAttach",value:function(){void 0!==this.mOriginalAttachState&&this.setVisibilityAttachState(this.mOriginalAttachState)}},{key:"afterCreateRenderObject",value:function(){Ud(t,"afterCreateRenderObject",this,3)([]),this.mRenderObject&&(this.mRenderObject.metadata||(this.mRenderObject.metadata={}),this.mRenderObject.metadata.scene_entity_id=this.mSceneEntity.id,this.mShowNormals&&this.mRenderObject instanceof BABYLON.Mesh&&(this.mNormalHelper||(this.mNormalHelper=this.createNormalHelper(this.mRenderObject,.25,BABYLON.Color3.Red()))),this.makeInvisibleBeforeAttach())}},{key:"destroyRenderObject",value:function(){this.mRenderObject&&this.mRenderObject.dispose(),this.mNormalHelper&&(this.mNormalHelper.dispose(),delete this.mNormalHelper)}},{key:"createNormalHelper",value:function(e,t,n){var r=e.getVerticesData(BABYLON.VertexBuffer.NormalKind),i=e.getVerticesData(BABYLON.VertexBuffer.PositionKind);n=n||BABYLON.Color3.White();for(var a=[],o=0;o<r.length;o+=3){var s=BABYLON.Vector3.FromArray(i,o),u=s.add(BABYLON.Vector3.FromArray(r,o).scaleInPlace(t));a.push([s.add(e.position),u.add(e.position)])}var c=BABYLON.MeshBuilder.CreateLineSystem("normalLines",{lines:a},this.getRenderer().getScene());return c.color=n,c}},{key:"onMatrixUpdate",value:function(){this.mMatrixNeedsUpdate=!0}}])}(Ld),zd=function(){return(0,u.A)((function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,s.A)(this,e),(0,c.A)(this,"mManager",void 0),(0,c.A)(this,"mHandle",void 0),(0,c.A)(this,"mPromise",void 0),(0,c.A)(this,"mRejectFunc",void 0),(0,c.A)(this,"mResolveFunc",void 0),(0,c.A)(this,"mUseResourceCount",void 0),(0,c.A)(this,"mInProgress",!1),this.mHandle=t,this.mManager=en.J.getManager(n),this.mUseResourceCount=r}),[{key:"getHandle",value:function(){return this.mHandle}},{key:"load",value:(e=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mPromise){e.next=2;break}return e.abrupt("return",this.mPromise);case 2:return this.mInProgress=!0,this.mPromise=new Promise((function(e,r){n.mResolveFunc=e,n.mRejectFunc=r,n.mManager.resolveResource(n.mHandle,(function(e){n.mInProgress&&(e?(n.mInProgress=!1,n.mResolveFunc(e)):n.mRejectFunc(new Error("Resource disposed before resolving!")))}),t,n.mUseResourceCount).catch((function(e){var t;n.mInProgress=!1,null===(t=n.mRejectFunc)||void 0===t||t.call(n,e)}))})),e.abrupt("return",this.mPromise);case 5:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})},{key:"dispose",value:function(){this.cancel(),this.disposeResource(),this.disposePromise()}},{key:"cancel",value:function(){var e;this.mInProgress&&(this.mInProgress=!1,null===(e=this.mRejectFunc)||void 0===e||e.call(this,"cancelled"))}},{key:"disposeResource",value:function(){if(this.mUseResourceCount){var e=this.mManager.findResourceWithHandle(this.mHandle);e&&!e.isLockedForDisposal()&&this.mManager.disposeResource(this.mHandle)}}},{key:"disposePromise",value:function(){this.mPromise&&(delete this.mRejectFunc,delete this.mResolveFunc,delete this.mPromise)}}]);var e}(),Hd=__webpack_require__(39485),Gd=__webpack_require__(98168),qd=__webpack_require__(95822);function Wd(e){switch(e){case BABYLON.Constants.TEXTURETYPE_BYTE:return Cn.Gs.Byte;case BABYLON.Constants.TEXTURETYPE_SHORT:return Cn.Gs.Short;case BABYLON.Constants.TEXTURETYPE_UNSIGNED_SHORT:return Cn.Gs.UnsignedShort;case BABYLON.Constants.TEXTURETYPE_INT:return Cn.Gs.Int;case BABYLON.Constants.TEXTURETYPE_UNSIGNED_INTEGER:return Cn.Gs.UnsignedInt;case BABYLON.Constants.TEXTURETYPE_FLOAT:return Cn.Gs.Float;case BABYLON.Constants.TEXTURETYPE_HALF_FLOAT:return Cn.Gs.HalfFloat;case BABYLON.Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return Cn.Gs.UnsignedShort4444;case BABYLON.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return Cn.Gs.UnsignedShort5551;case BABYLON.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return Cn.Gs.UnsignedShort565;case BABYLON.Constants.TEXTURETYPE_UNSIGNED_INT_24_8:return Cn.Gs.UnsignedInt248;case BABYLON.Constants.TEXTURETYPE_UNSIGNED_BYTE:case BABYLON.Constants.TEXTURETYPE_UNSIGNED_INT:default:return Cn.Gs.UnsignedByte}}function Kd(e){switch(e){case Cn.nC.Alpha:return BABYLON.Constants.TEXTUREFORMAT_ALPHA;case Cn.nC.Red:return BABYLON.Constants.TEXTUREFORMAT_RED;case Cn.nC.RedInt:return BABYLON.Constants.TEXTUREFORMAT_RED_INTEGER;case Cn.nC.RG:return BABYLON.Constants.TEXTUREFORMAT_RG;case Cn.nC.RGInt:return BABYLON.Constants.TEXTUREFORMAT_RG_INTEGER;case Cn.nC.RGB:return BABYLON.Constants.TEXTUREFORMAT_RGB;case Cn.nC.RGBInt:return BABYLON.Constants.TEXTUREFORMAT_RGB_INTEGER;case Cn.nC.RGBAInt:return BABYLON.Constants.TEXTUREFORMAT_RGBA_INTEGER;case Cn.nC.Luminance:return BABYLON.Constants.TEXTUREFORMAT_LUMINANCE;case Cn.nC.LuminanceAlpha:return BABYLON.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA;case Cn.nC.Depth:return BABYLON.Constants.TEXTUREFORMAT_DEPTH32_FLOAT;case Cn.nC.DepthStencil:return BABYLON.Constants.TEXTUREFORMAT_DEPTH24_STENCIL8;case Cn.nC.RGBA:default:return BABYLON.Constants.TEXTUREFORMAT_RGBA}}function Xd(e){switch(e){case BABYLON.Constants.TEXTUREFORMAT_ALPHA:return Cn.nC.Alpha;case BABYLON.Constants.TEXTUREFORMAT_R:case BABYLON.Constants.TEXTUREFORMAT_RED:return Cn.nC.Red;case BABYLON.Constants.TEXTUREFORMAT_R_INTEGER:case BABYLON.Constants.TEXTUREFORMAT_RED_INTEGER:return Cn.nC.RedInt;case BABYLON.Constants.TEXTUREFORMAT_RG:return Cn.nC.RG;case BABYLON.Constants.TEXTUREFORMAT_RG_INTEGER:return Cn.nC.RGInt;case BABYLON.Constants.TEXTUREFORMAT_RGB:return Cn.nC.RGB;case BABYLON.Constants.TEXTUREFORMAT_RGB_INTEGER:return Cn.nC.RGBInt;case BABYLON.Constants.TEXTUREFORMAT_RGBA_INTEGER:return Cn.nC.RGBAInt;case BABYLON.Constants.TEXTUREFORMAT_LUMINANCE:return Cn.nC.Luminance;case BABYLON.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:return Cn.nC.LuminanceAlpha;case BABYLON.Constants.TEXTUREFORMAT_DEPTH32_FLOAT:return Cn.nC.Depth;case BABYLON.Constants.TEXTUREFORMAT_DEPTH24_STENCIL8:return Cn.nC.DepthStencil;case BABYLON.Constants.TEXTUREFORMAT_RGBA:default:return Cn.nC.RGBA}}function Yd(e,t){switch(e){case Cn.C$.Cube:return BABYLON.Constants.TEXTURE_CUBIC_MODE;case Cn.C$.Equirectangular:return BABYLON.Constants.TEXTURE_EQUIRECTANGULAR_MODE;case Cn.C$.Spherical:return BABYLON.Constants.TEXTURE_SPHERICAL_MODE;case Cn.C$.UV:default:return BABYLON.Constants.TEXTURE_EXPLICIT_MODE}}function $d(e){switch(e){case BABYLON.Constants.TEXTURE_CUBIC_MODE:return Cn.C$.Cube;case BABYLON.Constants.TEXTURE_EQUIRECTANGULAR_MODE:return Cn.C$.Equirectangular;case BABYLON.Constants.TEXTURE_SPHERICAL_MODE:return Cn.C$.Spherical;case BABYLON.Constants.TEXTURE_EXPLICIT_MODE:default:return Cn.C$.UV}}function Zd(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return e===Cn.wm.Nearest?t===Cn.wm.Nearest?r&&n===Cn.wm.Nearest?BABYLON.Texture.NEAREST_NEAREST_MIPNEAREST:r&&n===Cn.wm.Linear?BABYLON.Texture.NEAREST_NEAREST_MIPLINEAR:BABYLON.Texture.NEAREST_NEAREST:r&&n===Cn.wm.Nearest?BABYLON.Texture.NEAREST_LINEAR_MIPNEAREST:r&&n===Cn.wm.Linear?BABYLON.Texture.NEAREST_LINEAR_MIPLINEAR:BABYLON.Texture.NEAREST_LINEAR:t===Cn.wm.Nearest?r&&n===Cn.wm.Nearest?BABYLON.Texture.LINEAR_NEAREST_MIPNEAREST:r&&n===Cn.wm.Linear?BABYLON.Texture.LINEAR_NEAREST_MIPLINEAR:BABYLON.Texture.LINEAR_NEAREST:r&&n===Cn.wm.Nearest?BABYLON.Texture.LINEAR_LINEAR_MIPNEAREST:r&&n===Cn.wm.Linear?BABYLON.Texture.LINEAR_LINEAR_MIPLINEAR:BABYLON.Texture.LINEAR_LINEAR}function Qd(e){switch(e){case Cn.qC.Repeat:return BABYLON.Texture.WRAP_ADDRESSMODE;case Cn.qC.MirrorRepeat:return BABYLON.Texture.MIRROR_ADDRESSMODE;case Cn.qC.ClampToEdge:default:return BABYLON.Texture.CLAMP_ADDRESSMODE}}function Jd(e){switch(e){case BABYLON.Texture.WRAP_ADDRESSMODE:return Cn.qC.Repeat;case BABYLON.Texture.MIRROR_ADDRESSMODE:return Cn.qC.MirrorRepeat;case BABYLON.Texture.CLAMP_ADDRESSMODE:default:return Cn.qC.ClampToEdge}}function ev(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ev=function(){return!!e})()}var tv=function(e){function t(e){var n,r,i,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"texture2d",u=arguments.length>2?arguments[2]:void 0,l=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Cn.C$.UV,f=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Cn.qC.ClampToEdge,m=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Cn.qC.ClampToEdge,p=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Cn.wm.Linear,d=arguments.length>8&&void 0!==arguments[8]?arguments[8]:Cn.wm.Linear,v=arguments.length>9&&void 0!==arguments[9]?arguments[9]:Cn.wm.Linear,y=arguments.length>10&&void 0!==arguments[10]&&arguments[10],g=arguments.length>11&&void 0!==arguments[11]?arguments[11]:Cn.nC.RGBA,b=arguments.length>12&&void 0!==arguments[12]?arguments[12]:Cn.Gs.UnsignedByte,A=arguments.length>13&&void 0!==arguments[13]?arguments[13]:1,_=arguments.length>14&&void 0!==arguments[14]?arguments[14]:Cn.vv.Linear;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,ev()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mInternalTexture",void 0),(0,c.A)(n,"mOffset",ee.I.Zero()),(0,c.A)(n,"mRepeat",ee.I.One()),(0,c.A)(n,"mCenter",ee.I.Zero()),(0,c.A)(n,"mRotation",0),(0,c.A)(n,"mRenderMode",Cn.fG.Reflect),(0,c.A)(n,"mMagFilter",Cn.wm.Linear),(0,c.A)(n,"mMinFilter",Cn.wm.Linear),(0,c.A)(n,"mMipmapFilter",Cn.wm.Linear),(0,c.A)(n,"mTextureEncoding",Cn.vv.Linear),(0,c.A)(n,"mGenerateMipmap",!1),(0,c.A)(n,"mDirty",!1),(0,c.A)(n,"mMatrix",new qd.d),n.mInternalTexture=new BABYLON.Texture(null,e,!y,l,Zd(p,d,v,y),null,null,u,!1,Kd(g),void 0,void 0),n.mInternalTexture.name=o,n.mMagFilter=p,n.mMinFilter=d,n.mMipmapFilter=v,n.mGenerateMipmap=y,n.mInternalTexture.hasAlpha=g===Cn.nC.Alpha||g===Cn.nC.RGBA||g===Cn.nC.LuminanceAlpha,n.mInternalTexture.gammaSpace=!0,n.setTextureMapping(h),n.setWrapU(f),n.setWrapV(m),n.setTextureDataType(b),n.setAnistropicFilteringLevel(A),n.setTextureEncoding(_),n.setCenter(ee.I.Zero()),n.setRepeat(ee.I.One()),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getOffset",value:function(){return this.mOffset}},{key:"setOffset",value:function(e){this.mOffset.copy(e),this.updateMatrix()}},{key:"getRepeat",value:function(){return this.mRepeat}},{key:"setRepeat",value:function(e){this.mRepeat.copy(e),this.updateMatrix()}},{key:"getCenter",value:function(){return this.mCenter}},{key:"setCenter",value:function(e){this.mCenter.copy(e),this.updateMatrix()}},{key:"getRotation",value:function(){return this.mRotation}},{key:"setRotation",value:function(e){this.mRotation=e,this.updateMatrix()}},{key:"getFlipY",value:function(){return this.mInternalTexture.invertY}},{key:"setFlipY",value:function(e){}},{key:"updateSource",value:function(e){this.mInternalTexture.updateURL(null,e)}},{key:"updateMatrix",value:function(){var e=[];this.mMatrix.setUvTransform(this.mOffset.x,this.mOffset.y,this.mRepeat.x,this.mRepeat.y,this.mRotation,this.mCenter.x,this.mCenter.y).toArray(e);var t=BABYLON.Matrix.Identity();t.setRowFromFloats(0,e[0],e[1],e[2],0),t.setRowFromFloats(1,e[3],e[4],e[5],0),t.setRowFromFloats(2,e[6],e[7],e[8],0),t.setRowFromFloats(3,0,0,0,1),this.mInternalTexture.getTextureMatrix().copyFrom(t)}},{key:"getName",value:function(){return this.mInternalTexture.name}},{key:"setName",value:function(e){this.mInternalTexture.name=e}},{key:"getGenerateMipmap",value:function(){return this.mGenerateMipmap}},{key:"getAnistropicFilteringLevel",value:function(){return this.mInternalTexture.anisotropicFilteringLevel}},{key:"setAnistropicFilteringLevel",value:function(e){this.mInternalTexture.anisotropicFilteringLevel=e}},{key:"getTextureDataType",value:function(){return Wd(this.mInternalTexture.textureType)}},{key:"setTextureDataType",value:function(e){}},{key:"getTextureFormat",value:function(){return Xd(this.mInternalTexture.textureFormat)}},{key:"setTextureFormat",value:function(e){this.mInternalTexture.hasAlpha=e===Cn.nC.Alpha||e===Cn.nC.RGBA||e===Cn.nC.LuminanceAlpha}},{key:"getTextureEncoding",value:function(){return this.mTextureEncoding}},{key:"setTextureEncoding",value:function(e){this.mInternalTexture.isRGBD=e===Cn.vv.RGBD}},{key:"getTextureMapping",value:function(){return $d(this.mInternalTexture.coordinatesMode)}},{key:"setTextureMapping",value:function(e){this.mInternalTexture.coordinatesMode=Yd(e,this.mRenderMode)}},{key:"getTextureRenderMode",value:function(){return this.mRenderMode}},{key:"setTextureRenderMode",value:function(e){this.mRenderMode=e,this.setTextureMapping(this.getTextureMapping())}},{key:"getMagFilter",value:function(){return this.mMagFilter}},{key:"setMagFilter",value:function(e){this.mMagFilter=e,this.updateTextureFilter()}},{key:"getMinFilter",value:function(){return this.mMinFilter}},{key:"setMinFilter",value:function(e){this.mMinFilter=e,this.updateTextureFilter()}},{key:"getMipmapFilter",value:function(){return this.mMipmapFilter}},{key:"setMipmapFilter",value:function(e){this.mMipmapFilter=e,this.updateTextureFilter()}},{key:"getWrapU",value:function(){return Jd(this.mInternalTexture.wrapU)}},{key:"setWrapU",value:function(e){this.mInternalTexture.wrapU=Qd(e)}},{key:"getWrapV",value:function(){return Jd(this.mInternalTexture.wrapV)}},{key:"setWrapV",value:function(e){this.mInternalTexture.wrapV=Qd(e)}},{key:"getLevel",value:function(){return this.mInternalTexture.level}},{key:"setLevel",value:function(e){this.mInternalTexture.level=e}},{key:"getUVChannel",value:function(){return this.mInternalTexture.coordinatesIndex}},{key:"setUVChannel",value:function(e){this.mInternalTexture.coordinatesIndex=e}},{key:"isTexture2D",value:function(){return!0}},{key:"isTexture3D",value:function(){return!1}},{key:"isTextureCube",value:function(){return!1}},{key:"isTextureGrayscale",value:function(){var e=this.getTextureFormat();return e===Cn.nC.Red||e===Cn.nC.RedInt||e===Cn.nC.Depth||e===Cn.nC.DepthStencil}},{key:"hasTextureAlpha",value:function(){return this.mInternalTexture.hasAlpha}},{key:"useRGBasAlpha",value:function(e){this.mInternalTexture.getAlphaFromRGB=e}},{key:"getMatrix",value:function(){return this.mMatrix}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e}},{key:"dispose",value:function(){this.mInternalTexture.dispose()}},{key:"updateTextureFilter",value:function(){this.mInternalTexture.updateSamplingMode(Zd(this.mMagFilter,this.mMinFilter,this.mMipmapFilter))}},{key:"getInternalTexture",value:function(){return this.mInternalTexture}}])}(Gd.M);function nv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nv=function(){return!!e})()}var rv=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,nv()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t)}(Cn.gP);function iv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(iv=function(){return!!e})()}var av=function(e){function t(e,n,r,i,a,o,u,l,h,f,m,p,d,v,y){var g,b,A,_;return(0,s.A)(this,t),b=this,A=t,A=(0,oe.A)(A),g=(0,ae.A)(b,iv()?Reflect.construct(A,_||[],(0,oe.A)(b).constructor):A.apply(b,_)),(0,c.A)(g,"mInternalTexture",void 0),(0,c.A)(g,"mOffset",ee.I.Zero()),(0,c.A)(g,"mRepeat",ee.I.One()),(0,c.A)(g,"mCenter",ee.I.Zero()),(0,c.A)(g,"mRotation",0),(0,c.A)(g,"mRenderMode",Cn.fG.Reflect),(0,c.A)(g,"mMagFilter",Cn.wm.Linear),(0,c.A)(g,"mMinFilter",Cn.wm.Linear),(0,c.A)(g,"mMipmapFilter",Cn.wm.Linear),(0,c.A)(g,"mGenerateMipmap",!1),(0,c.A)(g,"mTextureEncoding",Cn.vv.Linear),(0,c.A)(g,"mScale",1),(0,c.A)(g,"mDirty",!1),(0,c.A)(g,"mMatrix",new qd.d),g.mInternalTexture=new BABYLON.CubeTexture(null,e,void 0,!m,void 0,null,null,Kd(p),!1,void 0,!1,void 0,void 0,void 0),g.mInternalTexture.name=n,g.mMagFilter=l,g.mMinFilter=h,g.mMipmapFilter=f,g.mGenerateMipmap=m,g.setTextureMapping(a),g.setWrapU(o),g.setWrapV(u),g.setTextureDataType(d),g.setAnistropicFilteringLevel(v),g.setTextureEncoding(y),g}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"updateMatrix",value:function(){var e=[];this.mMatrix.setUvTransform(this.mOffset.x,this.mOffset.y,this.mRepeat.x,this.mRepeat.y,this.mRotation,this.mCenter.x,this.mCenter.y).toArray(e);var t=BABYLON.Matrix.Identity();t.setRowFromFloats(0,e[0],e[1],e[2],0),t.setRowFromFloats(1,e[3],e[4],e[5],0),t.setRowFromFloats(2,e[6],e[7],e[8],0),t.setRowFromFloats(3,0,0,0,1),this.mInternalTexture.getTextureMatrix().copyFrom(t)}},{key:"getName",value:function(){return this.mInternalTexture.name}},{key:"setName",value:function(e){this.mInternalTexture.name=e}},{key:"getRotation",value:function(){return this.mInternalTexture.rotationY}},{key:"setRotation",value:function(e){this.mInternalTexture.rotationY=e}},{key:"getGenerateMipmap",value:function(){return this.mGenerateMipmap}},{key:"getAnistropicFilteringLevel",value:function(){return this.mInternalTexture.anisotropicFilteringLevel}},{key:"setAnistropicFilteringLevel",value:function(e){this.mInternalTexture.anisotropicFilteringLevel=e}},{key:"getTextureDataType",value:function(){return Wd(this.mInternalTexture.textureType)}},{key:"setTextureDataType",value:function(e){}},{key:"getTextureFormat",value:function(){return Xd(this.mInternalTexture.textureFormat)}},{key:"setTextureFormat",value:function(e){this.mInternalTexture.hasAlpha=e===Cn.nC.Alpha||e===Cn.nC.RGBA||e===Cn.nC.LuminanceAlpha}},{key:"getTextureEncoding",value:function(){return this.mTextureEncoding}},{key:"setTextureEncoding",value:function(e){this.mInternalTexture.isRGBD=e===Cn.vv.RGBD,this.mInternalTexture.gammaSpace=e===Cn.vv.Gamma}},{key:"getTextureMapping",value:function(){return $d(this.mInternalTexture.coordinatesMode)}},{key:"setTextureMapping",value:function(e){this.mInternalTexture.coordinatesMode=Yd(e,this.mRenderMode)}},{key:"getTextureRenderMode",value:function(){return this.mRenderMode}},{key:"setTextureRenderMode",value:function(e){this.mRenderMode=e,this.setTextureMapping(this.getTextureMapping())}},{key:"getMagFilter",value:function(){return this.mMagFilter}},{key:"setMagFilter",value:function(e){this.mMagFilter=e,this.updateTextureFilter()}},{key:"getMinFilter",value:function(){return this.mMinFilter}},{key:"setMinFilter",value:function(e){this.mMinFilter=e,this.updateTextureFilter()}},{key:"getMipmapFilter",value:function(){return this.mMipmapFilter}},{key:"setMipmapFilter",value:function(e){this.mMipmapFilter=e,this.updateTextureFilter()}},{key:"getWrapU",value:function(){return Jd(this.mInternalTexture.wrapU)}},{key:"setWrapU",value:function(e){this.mInternalTexture.wrapU=Qd(e)}},{key:"getWrapV",value:function(){return Jd(this.mInternalTexture.wrapV)}},{key:"setWrapV",value:function(e){this.mInternalTexture.wrapV=Qd(e)}},{key:"getLevel",value:function(){return this.mInternalTexture.level}},{key:"setLevel",value:function(e){this.mInternalTexture.level=e}},{key:"getUVChannel",value:function(){return this.mInternalTexture.coordinatesIndex}},{key:"setUVChannel",value:function(e){this.mInternalTexture.coordinatesIndex=e}},{key:"isTexture2D",value:function(){return!1}},{key:"isTexture3D",value:function(){return!1}},{key:"isTextureCube",value:function(){return!0}},{key:"isTextureGrayscale",value:function(){var e=this.getTextureFormat();return e===Cn.nC.Red||e===Cn.nC.RedInt||e===Cn.nC.Depth||e===Cn.nC.DepthStencil}},{key:"hasTextureAlpha",value:function(){return this.mInternalTexture.hasAlpha}},{key:"useRGBasAlpha",value:function(e){this.mInternalTexture.getAlphaFromRGB=e}},{key:"getMatrix",value:function(){return this.mMatrix}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e}},{key:"dispose",value:function(){this.mInternalTexture.dispose()}},{key:"updateTextureFilter",value:function(){this.mInternalTexture.updateSamplingMode(Zd(this.mMagFilter,this.mMinFilter,this.mMipmapFilter))}},{key:"getInternalTexture",value:function(){return this.mInternalTexture}}])}(rv);function ov(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ov=function(){return!!e})()}var sv=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,oe.A)(n),(0,ae.A)(e,ov()?Reflect.construct(n,r||[],(0,oe.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ue.A)(t,e),(0,u.A)(t)}(Gd.M);function uv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(uv=function(){return!!e})()}var cv=function(e){function t(e){var n,r,i,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"texturecanvas",u=arguments.length>2?arguments[2]:void 0,l=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Cn.C$.UV,f=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Cn.qC.ClampToEdge,m=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Cn.qC.ClampToEdge,p=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Cn.wm.Linear,d=arguments.length>8&&void 0!==arguments[8]?arguments[8]:Cn.wm.Linear,v=arguments.length>9&&void 0!==arguments[9]?arguments[9]:Cn.wm.Linear,y=arguments.length>10&&void 0!==arguments[10]&&arguments[10],g=arguments.length>11&&void 0!==arguments[11]?arguments[11]:Cn.nC.RGBA,b=arguments.length>12&&void 0!==arguments[12]?arguments[12]:Cn.Gs.UnsignedByte,A=arguments.length>13&&void 0!==arguments[13]?arguments[13]:1,_=arguments.length>14&&void 0!==arguments[14]?arguments[14]:Cn.vv.Linear;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,uv()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mInternalTexture",void 0),(0,c.A)(n,"mOffset",ee.I.Zero()),(0,c.A)(n,"mRepeat",ee.I.One()),(0,c.A)(n,"mCenter",ee.I.Zero()),(0,c.A)(n,"mRotation",0),(0,c.A)(n,"mRenderMode",Cn.fG.Reflect),(0,c.A)(n,"mMagFilter",Cn.wm.Linear),(0,c.A)(n,"mMinFilter",Cn.wm.Linear),(0,c.A)(n,"mMipmapFilter",Cn.wm.Linear),(0,c.A)(n,"mGenerateMipmap",!1),(0,c.A)(n,"mTextureEncoding",Cn.vv.Linear),(0,c.A)(n,"mDirty",!1),(0,c.A)(n,"mCanvas",void 0),(0,c.A)(n,"mMatrix",new qd.d),n.mInternalTexture=new BABYLON.DynamicTexture(o,u,e,y,Zd(p,d,v,y),Kd(g),l),n.mCanvas=u,n.mMagFilter=p,n.mMinFilter=d,n.mMipmapFilter=v,n.mGenerateMipmap=y,n.setTextureMapping(h),n.setWrapU(f),n.setWrapV(m),n.setTextureDataType(b),n.setAnistropicFilteringLevel(A),n.setTextureEncoding(_),n.mInternalTexture.hasAlpha=!0,n.setCenter(ee.I.Zero()),n.setRepeat(ee.I.One()),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getOffset",value:function(){return this.mOffset}},{key:"setOffset",value:function(e){this.mOffset.copy(e),this.updateMatrix()}},{key:"getRepeat",value:function(){return this.mRepeat}},{key:"setRepeat",value:function(e){this.mRepeat.copy(e),this.updateMatrix()}},{key:"getCenter",value:function(){return this.mCenter}},{key:"setCenter",value:function(e){this.mCenter.copy(e),this.updateMatrix()}},{key:"getRotation",value:function(){return this.mRotation}},{key:"setRotation",value:function(e){this.mRotation=e,this.updateMatrix()}},{key:"getFlipY",value:function(){return this.mInternalTexture.invertY}},{key:"setFlipY",value:function(e){}},{key:"updateSource",value:function(e){this.mInternalTexture.updateURL(null,e)}},{key:"getContext",value:function(){return this.mInternalTexture.getContext()}},{key:"getCanvas",value:function(){return this.mCanvas}},{key:"dispose",value:function(){this.mInternalTexture.dispose(),this.mCanvas&&this.mCanvas.remove()}},{key:"updateMatrix",value:function(){var e=[];(new qd.d).setUvTransform(this.mOffset.x,this.mOffset.y,this.mRepeat.x,this.mRepeat.y,this.mRotation,this.mCenter.x,this.mCenter.y).toArray(e);var t=BABYLON.Matrix.Identity();t.setRowFromFloats(0,e[0],e[1],e[2],0),t.setRowFromFloats(1,e[3],e[4],e[5],0),t.setRowFromFloats(2,e[6],e[7],e[8],0),t.setRowFromFloats(3,0,0,0,1),this.mInternalTexture.getTextureMatrix().copyFrom(t)}},{key:"getName",value:function(){return this.mInternalTexture.name}},{key:"setName",value:function(e){this.mInternalTexture.name=e}},{key:"getGenerateMipmap",value:function(){return this.mGenerateMipmap}},{key:"getAnistropicFilteringLevel",value:function(){return this.mInternalTexture.anisotropicFilteringLevel}},{key:"setAnistropicFilteringLevel",value:function(e){this.mInternalTexture.anisotropicFilteringLevel=e}},{key:"getTextureDataType",value:function(){return Wd(this.mInternalTexture.textureType)}},{key:"setTextureDataType",value:function(e){}},{key:"getTextureFormat",value:function(){return Xd(this.mInternalTexture.textureFormat)}},{key:"setTextureFormat",value:function(e){this.mInternalTexture.hasAlpha=e===Cn.nC.Alpha||e===Cn.nC.RGBA||e===Cn.nC.LuminanceAlpha}},{key:"getTextureEncoding",value:function(){return this.mTextureEncoding}},{key:"setTextureEncoding",value:function(e){this.mInternalTexture.isRGBD=e===Cn.vv.RGBD,this.mInternalTexture.gammaSpace=e===Cn.vv.Gamma}},{key:"getTextureMapping",value:function(){return $d(this.mInternalTexture.coordinatesMode)}},{key:"setTextureMapping",value:function(e){this.mInternalTexture.coordinatesMode=Yd(e,this.mRenderMode)}},{key:"getTextureRenderMode",value:function(){return this.mRenderMode}},{key:"setTextureRenderMode",value:function(e){this.mRenderMode=e,this.setTextureMapping(this.getTextureMapping())}},{key:"getMagFilter",value:function(){return this.mMagFilter}},{key:"setMagFilter",value:function(e){this.mMagFilter=e,this.updateTextureFilter()}},{key:"getMinFilter",value:function(){return this.mMinFilter}},{key:"setMinFilter",value:function(e){this.mMinFilter=e,this.updateTextureFilter()}},{key:"getMipmapFilter",value:function(){return this.mMipmapFilter}},{key:"setMipmapFilter",value:function(e){this.mMipmapFilter=e,this.updateTextureFilter()}},{key:"getWrapU",value:function(){return Jd(this.mInternalTexture.wrapU)}},{key:"setWrapU",value:function(e){this.mInternalTexture.wrapU=Qd(e)}},{key:"getWrapV",value:function(){return Jd(this.mInternalTexture.wrapV)}},{key:"setWrapV",value:function(e){this.mInternalTexture.wrapV=Qd(e)}},{key:"getLevel",value:function(){return this.mInternalTexture.level}},{key:"setLevel",value:function(e){this.mInternalTexture.level=e}},{key:"getUVChannel",value:function(){return this.mInternalTexture.coordinatesIndex}},{key:"setUVChannel",value:function(e){this.mInternalTexture.coordinatesIndex=e}},{key:"isTexture2D",value:function(){return!0}},{key:"isTexture3D",value:function(){return!1}},{key:"isTextureCube",value:function(){return!1}},{key:"isTextureGrayscale",value:function(){var e=this.getTextureFormat();return e===Cn.nC.Red||e===Cn.nC.RedInt||e===Cn.nC.Depth||e===Cn.nC.DepthStencil}},{key:"hasTextureAlpha",value:function(){return this.mInternalTexture.hasAlpha}},{key:"useRGBasAlpha",value:function(e){this.mInternalTexture.getAlphaFromRGB=e}},{key:"getMatrix",value:function(){return this.mMatrix}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalTexture.update(this.mInternalTexture.invertY)}},{key:"updateTextureFilter",value:function(){this.mInternalTexture.updateSamplingMode(Zd(this.mMagFilter,this.mMinFilter,this.mMipmapFilter,this.mGenerateMipmap))}},{key:"getInternalTexture",value:function(){return this.mInternalTexture}}])}(sv);function lv(e,t){return e?t?Fs.k.Front:Fs.k.Back:Fs.k.Double}function hv(e){switch(e){case Fs.k.Front:return{cullingEnabled:!0,cullBackFace:!0};case Fs.k.Back:return{cullingEnabled:!0,cullBackFace:!1};case Fs.k.Double:default:return{cullingEnabled:!1,cullBackFace:!0}}}function fv(e){switch(e){case BABYLON.Constants.ALPHA_DISABLE:return Hd.r_.Disable;case BABYLON.Constants.ALPHA_ADD:return Hd.r_.Add;case BABYLON.Constants.ALPHA_SUBTRACT:return Hd.r_.Subtract;case BABYLON.Constants.ALPHA_MULTIPLY:return Hd.r_.Multiply;case BABYLON.Constants.ALPHA_MAXIMIZED:return Hd.r_.Maximized;case BABYLON.Constants.ALPHA_ONEONE:return Hd.r_.OneOne;case BABYLON.Constants.ALPHA_PREMULTIPLIED:case BABYLON.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF:return Hd.r_.PreMultiplied;case BABYLON.Constants.ALPHA_INTERPOLATE:return Hd.r_.Interpolate;case BABYLON.Constants.ALPHA_SCREENMODE:return Hd.r_.ScreenMode;case BABYLON.Constants.ALPHA_COMBINE:default:return Hd.r_.Combine}}function mv(e){switch(e){case Hd.r_.Disable:return BABYLON.Constants.ALPHA_DISABLE;case Hd.r_.Add:return BABYLON.Constants.ALPHA_ADD;case Hd.r_.Subtract:return BABYLON.Constants.ALPHA_SUBTRACT;case Hd.r_.Multiply:return BABYLON.Constants.ALPHA_MULTIPLY;case Hd.r_.Maximized:return BABYLON.Constants.ALPHA_MAXIMIZED;case Hd.r_.OneOne:return BABYLON.Constants.ALPHA_ONEONE;case Hd.r_.Interpolate:return BABYLON.Constants.ALPHA_INTERPOLATE;case Hd.r_.ScreenMode:return BABYLON.Constants.ALPHA_SCREENMODE;case Hd.r_.PreMultiplied:return BABYLON.Constants.ALPHA_PREMULTIPLIED;case Hd.r_.Combine:default:return BABYLON.Constants.ALPHA_COMBINE}}function pv(e){switch(e){case BABYLON.Material.MATERIAL_ALPHATEST:return Hd.Xn.AlphaTest;case BABYLON.Material.MATERIAL_ALPHABLEND:return Hd.Xn.AlphaBlend;case BABYLON.Material.MATERIAL_ALPHATESTANDBLEND:return Hd.Xn.AlphaBlendAndTest;case BABYLON.Material.MATERIAL_OPAQUE:default:return Hd.Xn.Opaque}}function dv(e){switch(e){case Hd.Xn.AlphaTest:return BABYLON.Material.MATERIAL_ALPHATEST;case Hd.Xn.AlphaBlend:return BABYLON.Material.MATERIAL_ALPHABLEND;case Hd.Xn.AlphaBlendAndTest:return BABYLON.Material.MATERIAL_ALPHATESTANDBLEND;case Hd.Xn.Opaque:default:return BABYLON.Material.MATERIAL_OPAQUE}}function vv(e){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e?e instanceof tv||e instanceof cv?arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t?BABYLON.Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE:BABYLON.Constants.TEXTURE_EQUIRECTANGULAR_MODE:BABYLON.Constants.TEXTURE_EXPLICIT_MODE:e instanceof av?t?BABYLON.Constants.TEXTURE_INVCUBIC_MODE:BABYLON.Constants.TEXTURE_CUBIC_MODE:void 0:BABYLON.Constants.TEXTURE_EXPLICIT_MODE}function yv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yv=function(){return!!e})()}var gv=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,yv()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mInternalMaterial",void 0),(0,c.A)(r,"mDiffuseColor",Ft.v.White()),(0,c.A)(r,"mAmbientColor",Ft.v.Black()),(0,c.A)(r,"mEmissiveColor",Ft.v.Black()),(0,c.A)(r,"mReflectionColor",Ft.v.White()),(0,c.A)(r,"mSpecularColor",Ft.v.White()),(0,c.A)(r,"mMetallicReflectanceColor",Ft.v.White()),(0,c.A)(r,"mDiffuseMap",void 0),(0,c.A)(r,"mAlphaMap",void 0),(0,c.A)(r,"mNormalMap",void 0),(0,c.A)(r,"mAoMap",void 0),(0,c.A)(r,"mEnvMap",void 0),(0,c.A)(r,"mEmissiveMap",void 0),(0,c.A)(r,"mEnvBrdfMap",void 0),(0,c.A)(r,"mLightMap",void 0),(0,c.A)(r,"mReflectivityMap",void 0),(0,c.A)(r,"mReflectionMap",void 0),(0,c.A)(r,"mReflectanceTexture",void 0),(0,c.A)(r,"mGlossRoughMap",void 0),(0,c.A)(r,"mMetalnessMap",void 0),(0,c.A)(r,"mMetallicReflectanceMap",void 0),(0,c.A)(r,"mBrdfConfiguration",void 0),(0,c.A)(r,"mDetailMapConfiguration",void 0),(0,c.A)(r,"mClearCoatConfiguration",void 0),(0,c.A)(r,"mSheenConfiguration",void 0),(0,c.A)(r,"mAnisotropicConfiguration",void 0),(0,c.A)(r,"mSubSurfaceConfiguration",void 0),(0,c.A)(r,"mIridescenceConfiguration",void 0),(0,c.A)(r,"mNormalScale",ee.I.One()),(0,c.A)(r,"mEnvMapScale",ee.I.One()),(0,c.A)(r,"mLightMapIntensity",1),(0,c.A)(r,"mUseSpecularGlossinessFlow",!1),(0,c.A)(r,"mUseTransmission",!1),(0,c.A)(r,"mMetalness",0),(0,c.A)(r,"mRoughness",0),(0,c.A)(r,"mDirty",!1),(0,c.A)(r,"mAlphaTestEnabled",!1),(0,c.A)(r,"mTransparent",!1),(0,c.A)(r,"mFlatShading",!1),(0,c.A)(r,"mUseRealtimeTextureFiltering",!1),(0,c.A)(r,"mRealtimeTextureFilteringQuality",Rn.j.Low),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Fs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r.mBrdfConfiguration={useEnergyConservation:!0,useSpecularGlossinessInputEnergyConservation:!0},r.mDetailMapConfiguration={isEnabled:!1,map:null,diffuseBlendLevel:1,roughnessBlendLevel:1,bumpLevel:1,normalBlendMethod:BABYLON.Material.MATERIAL_NORMALBLENDMETHOD_WHITEOUT},r.mClearCoatConfiguration={isEnabled:!1,intensity:1,roughness:0,indexOfRefraction:1.5,map:null,useRoughnessFromMainMap:!0,roughnessMap:null,remapF0OnInterfaceChange:!0,bumpMap:null,isTintEnabled:!1,tintColor:Ft.v.White(),tintColorAtDistance:1,tintThickness:1,tintMap:null},r.mSheenConfiguration={isEnabled:!1,linkSheenWithDiffuse:!1,intensity:1,color:Ft.v.White(),map:null,useRoughnessFromMainMap:!0,roughness:null,roughnessMap:null,diffuseScaling:!1},r.mAnisotropicConfiguration={isEnabled:!1,intensity:1,direction:new ee.I(1,0),map:null},r.mSubSurfaceConfiguration={isRefractionEnabled:!1,isTranslucencyEnabled:!1,isScatteringEnabled:!1,scatteringDiffusionProfile:null,refractionIntensity:1,translucencyIntensity:1,useDiffuseToTintRefraction:!1,useDiffuseToTintTranslucency:!1,thicknessMap:null,indexOfRefraction:1.5,linkRefractionWithTransparency:!1,volumeIndexOfRefraction:-1,minimumThickness:0,maximumThickness:1,useThicknessAsDepth:!1,tintColor:Ft.v.White(),tintColorAtDistance:1,diffusionDistance:Ft.v.White(),useMaskFromThicknessMap:!1,translucencyIntensityMap:null},r.mIridescenceConfiguration={isEnabled:!1,intensity:1,minimumThickness:100,maximumThickness:400,indexOfRefraction:1.3,map:null,thicknessMap:null},r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getClassName",value:function(){var e;return(null===(e=this.mInternalMaterial)||void 0===e?void 0:e.getClassName())||""}},{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null}},{key:"isUsingAlphaFromDiffuseMap",value:function(){return this.mInternalMaterial.useAlphaFromAlbedoTexture}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&this.setNormalScale(this.mNormalScale)}},{key:"getNormalScale",value:function(){return this.mNormalScale}},{key:"setNormalScale",value:function(e){this.mNormalScale.copy(e),this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mNormalScale.x)}},{key:"getAmbientColor",value:function(){return this.mAmbientColor}},{key:"setAmbientColor",value:function(e){this.mAmbientColor.copy(e),this.mInternalMaterial.ambientColor.set(this.mAmbientColor.r,this.mAmbientColor.g,this.mAmbientColor.b)}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getAoMapImpactOnAnalyticalLights",value:function(){return this.mInternalMaterial.ambientTextureImpactOnAnalyticalLights}},{key:"setAoMapImpactOnAnalyticalLights",value:function(e){this.mInternalMaterial.ambientTextureImpactOnAnalyticalLights=e}},{key:"getDirectLightIntensity",value:function(){return this.mInternalMaterial.directIntensity}},{key:"setDirectLightIntensity",value:function(e){this.mInternalMaterial.directIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveTexture=e?e.getInternalTexture():null}},{key:"getEnvironmentIntensity",value:function(){return this.mInternalMaterial.environmentIntensity}},{key:"setEnvironmentIntensity",value:function(e){this.mInternalMaterial.environmentIntensity=e}},{key:"getEnvironmentBrdfMap",value:function(){return this.mEnvBrdfMap}},{key:"setEnvironmentBrdfMap",value:function(e){this.mEnvBrdfMap=e,this.mInternalMaterial.environmentBRDFTexture=e?e.getInternalTexture():null}},{key:"getEnvironmentBrdfMapScale",value:function(){return this.mEnvMapScale}},{key:"setEnvironmentBdrfMapScale",value:function(e){this.mEnvMapScale.copy(e),this.mInternalMaterial.environmentBRDFTexture.level=this.mEnvMapScale.x}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightmapTexture=e?e.getInternalTexture():null,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getLightMapIntensity",value:function(){return this.mLightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mLightMapIntensity=e,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getParallaxScaleBias",value:function(){return this.mInternalMaterial.parallaxScaleBias}},{key:"setParallaxScaleBias",value:function(e){this.mInternalMaterial.parallaxScaleBias=e}},{key:"getReflectionColor",value:function(){return this.mReflectionColor}},{key:"setReflectionColor",value:function(e){this.mReflectionColor.copy(e),this.mInternalMaterial.reflectionColor.set(this.mReflectionColor.r,this.mReflectionColor.g,this.mReflectionColor.b)}},{key:"getReflectionMap",value:function(){return this.mReflectionMap}},{key:"setReflectionMap",value:function(e){this.mReflectionMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null}},{key:"getSpecularColor",value:function(){return this.mSpecularColor}},{key:"setSpecularColor",value:function(e){this.mSpecularColor.copy(e),this.mInternalMaterial.reflectivityColor.set(this.mSpecularColor.r,this.mSpecularColor.g,this.mSpecularColor.b)}},{key:"getSpecularMap",value:function(){return this.mReflectivityMap}},{key:"setSpecularMap",value:function(e){this.mReflectivityMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null}},{key:"getSpecularIntensity",value:function(){return this.mInternalMaterial.specularIntensity}},{key:"setSpecularIntensity",value:function(e){this.mInternalMaterial.specularIntensity=e}},{key:"getTwoSidedLighting",value:function(){return this.mInternalMaterial.twoSidedLighting}},{key:"setTwoSidedLighting",value:function(e){this.mInternalMaterial.twoSidedLighting=e}},{key:"getUnlit",value:function(){return this.mInternalMaterial.unlit}},{key:"setUnlit",value:function(e){this.mInternalMaterial.unlit=e}},{key:"getReflectanceMap",value:function(){return this.mReflectanceTexture}},{key:"setReflectanceMap",value:function(e){this.mReflectanceTexture=e,this.mInternalMaterial.reflectanceTexture=e?e.getInternalTexture():null}},{key:"getMicroSurface",value:function(){return this.mInternalMaterial.microSurface}},{key:"setMicroSurface",value:function(e){this.mInternalMaterial.microSurface=e}},{key:"getMicroSurfaceMap",value:function(){return this.mGlossRoughMap}},{key:"setMicroSurfaceMap",value:function(e){this.mGlossRoughMap=e,this.mInternalMaterial.microSurfaceTexture=e?e.getInternalTexture():null}},{key:"getRoughness",value:function(){return this.mInternalMaterial.roughness}},{key:"setRoughness",value:function(e){this.mRoughness=e,this.mUseSpecularGlossinessFlow||(this.mInternalMaterial.roughness=e)}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metallic}},{key:"setMetalness",value:function(e){this.mMetalness=e,this.mUseSpecularGlossinessFlow||(this.mInternalMaterial.metallic=e)}},{key:"getMetalnessF0Factor",value:function(){return this.mInternalMaterial.metallicF0Factor}},{key:"setMetalnessF0Factor",value:function(e){this.mInternalMaterial.metallicF0Factor=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mUseSpecularGlossinessFlow||(this.mMetalnessMap=e,this.mInternalMaterial.metallicTexture=e?e.getInternalTexture():null)}},{key:"getMetallicReflectanceColor",value:function(){return this.mMetallicReflectanceColor}},{key:"setMetallicReflectanceColor",value:function(e){this.mMetallicReflectanceColor.copy(e),this.mInternalMaterial.metallicReflectanceColor.set(this.mMetallicReflectanceColor.r,this.mMetallicReflectanceColor.g,this.mMetallicReflectanceColor.b)}},{key:"getMetallicReflectanceMap",value:function(){return this.mMetallicReflectanceMap}},{key:"setMetallicReflectanceMap",value:function(e){this.mMetallicReflectanceMap=e,this.mInternalMaterial.metallicReflectanceTexture=e?e.getInternalTexture():null}},{key:"isSpecularGlossinessWorkflowEnabled",value:function(){return this.mUseSpecularGlossinessFlow}},{key:"useSpecularGlossinessWorkflow",value:function(e){this.mUseSpecularGlossinessFlow=e,this.mUseSpecularGlossinessFlow?(this.mInternalMaterial.metallic=null,this.mInternalMaterial.roughness=null,this.mInternalMaterial.metallicTexture=null):(this.mInternalMaterial.metallic=this.mMetalness,this.mInternalMaterial.roughness=this.mRoughness,this.mInternalMaterial.metallicTexture=this.mMetalnessMap?this.mMetalnessMap.getInternalTexture():null)}},{key:"isUsingRealtimeTextureFiltering",value:function(){return this.mInternalMaterial.realTimeFiltering}},{key:"useRealtimeTextureFiltering",value:function(e){this.mInternalMaterial.realTimeFiltering=e}},{key:"getRealtimeTextureFilteringQuality",value:function(){return this.mRealtimeTextureFilteringQuality}},{key:"setRealtimeTextureFilteringQuality",value:function(e){switch(this.mRealtimeTextureFilteringQuality=e,this.mRealtimeTextureFilteringQuality){case Rn.j.Low:this.mInternalMaterial.realTimeFilteringQuality=BABYLON.Constants.TEXTURE_FILTERING_QUALITY_LOW;break;case Rn.j.Medium:this.mInternalMaterial.realTimeFilteringQuality=BABYLON.Constants.TEXTURE_FILTERING_QUALITY_MEDIUM;break;case Rn.j.High:this.mInternalMaterial.realTimeFilteringQuality=BABYLON.Constants.TEXTURE_FILTERING_QUALITY_HIGH}}},{key:"getBrdfConfiguration",value:function(){return this.mBrdfConfiguration}},{key:"setBrdfConfiguration",value:function(e){e&&(void 0!==e.useEnergyConservation&&(this.mBrdfConfiguration.useEnergyConservation=e.useEnergyConservation,this.mInternalMaterial.brdf.useEnergyConservation=e.useEnergyConservation),void 0!==e.useSpecularGlossinessInputEnergyConservation&&(this.mBrdfConfiguration.useSpecularGlossinessInputEnergyConservation=e.useSpecularGlossinessInputEnergyConservation,this.mInternalMaterial.brdf.useSpecularGlossinessInputEnergyConservation=e.useSpecularGlossinessInputEnergyConservation))}},{key:"getDetailMapConfiguration",value:function(){return this.mDetailMapConfiguration}},{key:"setDetailMapConfiguration",value:function(e){e&&(void 0!==e.isEnabled&&(this.mDetailMapConfiguration.isEnabled=e.isEnabled,this.mInternalMaterial.detailMap.isEnabled=e.isEnabled),void 0!==e.map&&(this.mDetailMapConfiguration.map=e.map,this.mInternalMaterial.detailMap.texture=e.map?e.map.getInternalTexture():null),void 0!==e.diffuseBlendLevel&&(this.mDetailMapConfiguration.diffuseBlendLevel=e.diffuseBlendLevel,this.mInternalMaterial.detailMap.diffuseBlendLevel=e.diffuseBlendLevel),void 0!==e.roughnessBlendLevel&&(this.mDetailMapConfiguration.roughnessBlendLevel=e.roughnessBlendLevel,this.mInternalMaterial.detailMap.roughnessBlendLevel=e.roughnessBlendLevel),void 0!==e.bumpLevel&&(this.mDetailMapConfiguration.bumpLevel=e.bumpLevel,this.mInternalMaterial.detailMap.bumpLevel=e.bumpLevel),void 0!==e.normalBlendMethod&&(this.mDetailMapConfiguration.normalBlendMethod=e.normalBlendMethod,this.mInternalMaterial.detailMap.normalBlendMethod=e.normalBlendMethod))}},{key:"getClearCoatConfiguration",value:function(){return this.mClearCoatConfiguration}},{key:"setClearCoatConfiguration",value:function(e){e&&(void 0!==e.isEnabled&&(this.mClearCoatConfiguration.isEnabled=e.isEnabled,this.mInternalMaterial.clearCoat.isEnabled=e.isEnabled),void 0!==e.intensity&&(this.mClearCoatConfiguration.intensity=e.intensity,this.mInternalMaterial.clearCoat.intensity=e.intensity),void 0!==e.roughness&&(this.mClearCoatConfiguration.roughness=e.roughness,this.mInternalMaterial.clearCoat.roughness=e.roughness),void 0!==e.indexOfRefraction&&(this.mClearCoatConfiguration.indexOfRefraction=e.indexOfRefraction,this.mInternalMaterial.clearCoat.indexOfRefraction=e.indexOfRefraction),void 0!==e.map&&(this.mClearCoatConfiguration.map=e.map,this.mInternalMaterial.clearCoat.texture=e.map?e.map.getInternalTexture():null),void 0!==e.useRoughnessFromMainMap&&(this.mClearCoatConfiguration.useRoughnessFromMainMap=e.useRoughnessFromMainMap,this.mInternalMaterial.clearCoat.useRoughnessFromMainTexture=e.useRoughnessFromMainMap),void 0!==e.roughnessMap&&(this.mClearCoatConfiguration.roughnessMap=e.roughnessMap,this.mInternalMaterial.clearCoat.textureRoughness=e.roughnessMap?e.roughnessMap.getInternalTexture():null),void 0!==e.remapF0OnInterfaceChange&&(this.mClearCoatConfiguration.remapF0OnInterfaceChange=e.remapF0OnInterfaceChange,this.mInternalMaterial.clearCoat.remapF0OnInterfaceChange=e.remapF0OnInterfaceChange),void 0!==e.bumpMap&&(this.mClearCoatConfiguration.bumpMap=e.bumpMap,this.mInternalMaterial.clearCoat.bumpTexture=e.bumpMap?e.bumpMap.getInternalTexture():null),void 0!==e.isTintEnabled&&(this.mClearCoatConfiguration.isTintEnabled=e.isTintEnabled,this.mInternalMaterial.clearCoat.isTintEnabled=e.isTintEnabled),void 0!==e.tintColor&&(this.mClearCoatConfiguration.tintColor.copy(e.tintColor),this.mInternalMaterial.clearCoat.tintColor.set(e.tintColor.r,e.tintColor.g,e.tintColor.b)),void 0!==e.tintColorAtDistance&&(this.mClearCoatConfiguration.tintColorAtDistance=e.tintColorAtDistance,this.mInternalMaterial.clearCoat.tintColorAtDistance=e.tintColorAtDistance),void 0!==e.tintThickness&&(this.mClearCoatConfiguration.tintThickness=e.tintThickness,this.mInternalMaterial.clearCoat.tintThickness=e.tintThickness),void 0!==e.tintMap&&(this.mClearCoatConfiguration.tintMap=e.tintMap,this.mInternalMaterial.clearCoat.tintTexture=e.tintMap?e.tintMap.getInternalTexture():null))}},{key:"getSheenConfiguration",value:function(){return this.mSheenConfiguration}},{key:"setSheenConfiguration",value:function(e){e&&(void 0!==e.isEnabled&&(this.mSheenConfiguration.isEnabled=e.isEnabled,this.mInternalMaterial.sheen.isEnabled=e.isEnabled),void 0!==e.linkSheenWithDiffuse&&(this.mSheenConfiguration.linkSheenWithDiffuse=e.linkSheenWithDiffuse,this.mInternalMaterial.sheen.linkSheenWithAlbedo=e.linkSheenWithDiffuse),void 0!==e.intensity&&(this.mSheenConfiguration.intensity=e.intensity,this.mInternalMaterial.sheen.intensity=e.intensity),void 0!==e.color&&(this.mSheenConfiguration.color.copy(e.color),this.mInternalMaterial.sheen.color.set(e.color.r,e.color.g,e.color.b)),void 0!==e.map&&(this.mSheenConfiguration.map=e.map,this.mInternalMaterial.sheen.texture=e.map?e.map.getInternalTexture():null),void 0!==e.useRoughnessFromMainMap&&(this.mSheenConfiguration.useRoughnessFromMainMap=e.useRoughnessFromMainMap,this.mInternalMaterial.sheen.useRoughnessFromMainTexture=e.useRoughnessFromMainMap),void 0!==e.roughness&&(this.mSheenConfiguration.roughness=e.roughness,this.mInternalMaterial.sheen.roughness=e.roughness),void 0!==e.roughnessMap&&(this.mSheenConfiguration.roughnessMap=e.roughnessMap,this.mInternalMaterial.sheen.textureRoughness=e.roughnessMap?e.roughnessMap.getInternalTexture():null),void 0!==e.diffuseScaling&&(this.mSheenConfiguration.diffuseScaling=e.diffuseScaling,this.mInternalMaterial.sheen.albedoScaling=e.diffuseScaling))}},{key:"getAnisotropicConfiguration",value:function(){return this.mAnisotropicConfiguration}},{key:"setAnisotropicConfiguration",value:function(e){e&&(void 0!==e.isEnabled&&(this.mAnisotropicConfiguration.isEnabled=e.isEnabled,this.mInternalMaterial.anisotropy.isEnabled=e.isEnabled),void 0!==e.intensity&&(this.mAnisotropicConfiguration.intensity=e.intensity,this.mInternalMaterial.anisotropy.intensity=e.intensity),void 0!==e.direction&&(this.mAnisotropicConfiguration.direction.copy(e.direction),this.mInternalMaterial.anisotropy.direction.set(e.direction.x,e.direction.y)),void 0!==e.map&&(this.mAnisotropicConfiguration.map=e.map,this.mInternalMaterial.anisotropy.texture=e.map?e.map.getInternalTexture():null))}},{key:"getSubSurfaceConfiguration",value:function(){return this.mSubSurfaceConfiguration}},{key:"setSubSurfaceConfiguration",value:function(e){e&&(void 0!==e.isRefractionEnabled&&(this.mSubSurfaceConfiguration.isRefractionEnabled=e.isRefractionEnabled,this.mInternalMaterial.subSurface.isRefractionEnabled=e.isRefractionEnabled,this.setFlags({useTransmission:this.mSubSurfaceConfiguration.isRefractionEnabled})),void 0!==e.isScatteringEnabled&&(this.mSubSurfaceConfiguration.isScatteringEnabled=e.isScatteringEnabled,this.mInternalMaterial.subSurface.isScatteringEnabled=e.isScatteringEnabled),void 0!==e.isTranslucencyEnabled&&(this.mSubSurfaceConfiguration.isTranslucencyEnabled=e.isTranslucencyEnabled,this.mInternalMaterial.subSurface.isTranslucencyEnabled=e.isTranslucencyEnabled),void 0!==e.refractionIntensity&&(this.mSubSurfaceConfiguration.refractionIntensity=e.refractionIntensity,this.mInternalMaterial.subSurface.refractionIntensity=e.refractionIntensity),void 0!==e.translucencyIntensity&&(this.mSubSurfaceConfiguration.translucencyIntensity=e.translucencyIntensity,this.mInternalMaterial.subSurface.translucencyIntensity=e.translucencyIntensity),void 0!==e.useDiffuseToTintRefraction&&(this.mSubSurfaceConfiguration.useDiffuseToTintRefraction=e.useDiffuseToTintRefraction,this.mInternalMaterial.subSurface.useAlbedoToTintRefraction=e.useDiffuseToTintRefraction),void 0!==e.useDiffuseToTintTranslucency&&(this.mSubSurfaceConfiguration.useDiffuseToTintTranslucency=e.useDiffuseToTintTranslucency,this.mInternalMaterial.subSurface.useAlbedoToTintTranslucency=e.useDiffuseToTintTranslucency),void 0!==e.thicknessMap&&(this.mSubSurfaceConfiguration.thicknessMap=e.thicknessMap,this.mInternalMaterial.subSurface.thicknessTexture=e.thicknessMap?e.thicknessMap.getInternalTexture():null),void 0!==e.indexOfRefraction&&(this.mSubSurfaceConfiguration.indexOfRefraction=e.indexOfRefraction,this.mInternalMaterial.subSurface.indexOfRefraction=e.indexOfRefraction),void 0!==e.volumeIndexOfRefraction&&(this.mSubSurfaceConfiguration.volumeIndexOfRefraction=e.volumeIndexOfRefraction,this.mInternalMaterial.subSurface.volumeIndexOfRefraction=e.volumeIndexOfRefraction),void 0!==e.linkRefractionWithTransparency&&(this.mSubSurfaceConfiguration.linkRefractionWithTransparency=e.linkRefractionWithTransparency,this.mInternalMaterial.subSurface.linkRefractionWithTransparency=e.linkRefractionWithTransparency),void 0!==e.minimumThickness&&(this.mSubSurfaceConfiguration.minimumThickness=e.minimumThickness,this.mInternalMaterial.subSurface.minimumThickness=e.minimumThickness),void 0!==e.maximumThickness&&(this.mSubSurfaceConfiguration.maximumThickness=e.maximumThickness,this.mInternalMaterial.subSurface.maximumThickness=e.maximumThickness),void 0!==e.useThicknessAsDepth&&(this.mSubSurfaceConfiguration.useThicknessAsDepth=e.useThicknessAsDepth,this.mInternalMaterial.subSurface.useThicknessAsDepth=e.useThicknessAsDepth),void 0!==e.tintColor&&(this.mSubSurfaceConfiguration.tintColor.copy(e.tintColor),this.mInternalMaterial.subSurface.tintColor.set(e.tintColor.r,e.tintColor.g,e.tintColor.b)),void 0!==e.tintColorAtDistance&&(this.mSubSurfaceConfiguration.tintColorAtDistance=e.tintColorAtDistance,this.mInternalMaterial.subSurface.tintColorAtDistance=e.tintColorAtDistance),void 0!==e.diffusionDistance&&(this.mSubSurfaceConfiguration.diffusionDistance.copy(e.diffusionDistance),this.mInternalMaterial.subSurface.diffusionDistance.set(e.diffusionDistance.r,e.diffusionDistance.g,e.diffusionDistance.b)),void 0!==e.useMaskFromThicknessMap&&(this.mSubSurfaceConfiguration.useMaskFromThicknessMap=e.useMaskFromThicknessMap,this.mInternalMaterial.subSurface.useMaskFromThicknessTexture=e.useMaskFromThicknessMap),void 0!==e.translucencyIntensityMap&&(this.mSubSurfaceConfiguration.translucencyIntensityMap=e.translucencyIntensityMap,this.mInternalMaterial.subSurface.translucencyIntensityTexture=e.translucencyIntensityMap?e.translucencyIntensityMap.getInternalTexture():null))}},{key:"getIridescenceConfiguration",value:function(){return this.mIridescenceConfiguration}},{key:"setIridescenceConfiguration",value:function(e){e&&(void 0!==e.isEnabled&&(this.mIridescenceConfiguration.isEnabled=e.isEnabled,this.mInternalMaterial.iridescence.isEnabled=e.isEnabled),void 0!==e.intensity&&(this.mIridescenceConfiguration.intensity=e.intensity,this.mInternalMaterial.iridescence.intensity=e.intensity),void 0!==e.minimumThickness&&(this.mIridescenceConfiguration.minimumThickness=e.minimumThickness,this.mInternalMaterial.iridescence.minimumThickness=e.minimumThickness),void 0!==e.maximumThickness&&(this.mIridescenceConfiguration.maximumThickness=e.maximumThickness,this.mInternalMaterial.iridescence.maximumThickness=e.maximumThickness),void 0!==e.indexOfRefraction&&(this.mIridescenceConfiguration.indexOfRefraction=e.indexOfRefraction,this.mInternalMaterial.iridescence.indexOfRefraction=e.indexOfRefraction),void 0!==e.map&&(this.mIridescenceConfiguration.map=e.map,this.mInternalMaterial.iridescence.texture=e.map?e.map.getInternalTexture():null),void 0!==e.thicknessMap&&(this.mIridescenceConfiguration.thicknessMap=e.thicknessMap,this.mInternalMaterial.iridescence.thicknessTexture=e.thicknessMap?e.thicknessMap.getInternalTexture():null))}},{key:"getFlags",value:function(){return{useAlphaFresnel:this.mInternalMaterial.useAlphaFresnel,useAlphaFromDiffuseMap:this.mInternalMaterial.useAlphaFromAlbedoTexture,useAmbientInGrayScale:this.mInternalMaterial.useAmbientInGrayScale,useAmbientOcclusionFromMetallicMapRed:this.mInternalMaterial.useAmbientOcclusionFromMetallicTextureRed,useAutoMicroSurfaceFromReflectivityMap:this.mInternalMaterial.useAutoMicroSurfaceFromReflectivityMap,useLightmapAsShadowmap:this.mInternalMaterial.useLightmapAsShadowmap,useLinearAlphaFresnel:this.mInternalMaterial.useLinearAlphaFresnel,useMetalnessFromMetallicMapBlue:this.mInternalMaterial.useMetallnessFromMetallicTextureBlue,useMicroSurfaceFromReflectivityMapAlpha:this.mInternalMaterial.useMicroSurfaceFromReflectivityMapAlpha,useParallax:this.mInternalMaterial.useParallax,useParallaxOcclusion:this.mInternalMaterial.useParallaxOcclusion,useHorizonOcclusion:this.mInternalMaterial.useHorizonOcclusion,useRadianceOcclusion:this.mInternalMaterial.useRadianceOcclusion,useRadianceOverAlpha:this.mInternalMaterial.useRadianceOverAlpha,useRoughnessFromMetallicMapAlpha:this.mInternalMaterial.useRoughnessFromMetallicTextureAlpha,useRoughnessFromMetallicMapGreen:this.mInternalMaterial.useRoughnessFromMetallicTextureGreen,useSpecularAntiAliasing:this.mInternalMaterial.enableSpecularAntiAliasing,useSpecularOverAlpha:this.mInternalMaterial.useSpecularOverAlpha,invertNormalMapX:this.mInternalMaterial.invertNormalMapX,invertNormalMapY:this.mInternalMaterial.invertNormalMapY,useOnlyMetallicFromMetallicReflectanceMap:this.mInternalMaterial.useOnlyMetallicFromMetallicReflectanceTexture,usePhysicalLightFalloff:this.mInternalMaterial.usePhysicalLightFalloff,useTransmission:this.mUseTransmission}}},{key:"setFlags",value:function(e){e&&(void 0!==e.useAlphaFresnel&&(this.mInternalMaterial.useAlphaFresnel=e.useAlphaFresnel),void 0!==e.useAlphaFromDiffuseMap&&(this.mInternalMaterial.useAlphaFromAlbedoTexture=e.useAlphaFromDiffuseMap),void 0!==e.useAmbientInGrayScale&&(this.mInternalMaterial.useAmbientInGrayScale=e.useAmbientInGrayScale),void 0!==e.useAmbientOcclusionFromMetallicMapRed&&(this.mInternalMaterial.useAmbientOcclusionFromMetallicTextureRed=e.useAmbientOcclusionFromMetallicMapRed),void 0!==e.useAutoMicroSurfaceFromReflectivityMap&&(this.mInternalMaterial.useAutoMicroSurfaceFromReflectivityMap=e.useAutoMicroSurfaceFromReflectivityMap),void 0!==e.useLightmapAsShadowmap&&(this.mInternalMaterial.useLightmapAsShadowmap=e.useLightmapAsShadowmap),void 0!==e.useLinearAlphaFresnel&&(this.mInternalMaterial.useLinearAlphaFresnel=e.useLinearAlphaFresnel),void 0!==e.useMetalnessFromMetallicMapBlue&&(this.mInternalMaterial.useMetallnessFromMetallicTextureBlue=e.useMetalnessFromMetallicMapBlue),void 0!==e.useMicroSurfaceFromReflectivityMapAlpha&&(this.mInternalMaterial.useMicroSurfaceFromReflectivityMapAlpha=e.useMicroSurfaceFromReflectivityMapAlpha),void 0!==e.useParallax&&(this.mInternalMaterial.useParallax=e.useParallax),void 0!==e.useParallaxOcclusion&&(this.mInternalMaterial.useParallaxOcclusion=e.useParallaxOcclusion),void 0!==e.useHorizonOcclusion&&(this.mInternalMaterial.useHorizonOcclusion=e.useHorizonOcclusion),void 0!==e.useRadianceOcclusion&&(this.mInternalMaterial.useRadianceOcclusion=e.useRadianceOcclusion),void 0!==e.useRadianceOverAlpha&&(this.mInternalMaterial.useRadianceOverAlpha=e.useRadianceOverAlpha),void 0!==e.useRoughnessFromMetallicMapAlpha&&(this.mInternalMaterial.useRoughnessFromMetallicTextureAlpha=e.useRoughnessFromMetallicMapAlpha),void 0!==e.useRoughnessFromMetallicMapGreen&&(this.mInternalMaterial.useRoughnessFromMetallicTextureGreen=e.useRoughnessFromMetallicMapGreen),void 0!==e.useSpecularAntiAliasing&&(this.mInternalMaterial.enableSpecularAntiAliasing=e.useSpecularAntiAliasing),void 0!==e.useSpecularOverAlpha&&(this.mInternalMaterial.useSpecularOverAlpha=e.useSpecularOverAlpha),void 0!==e.invertNormalMapX&&(this.mInternalMaterial.invertNormalMapX=e.invertNormalMapX),void 0!==e.invertNormalMapY&&(this.mInternalMaterial.invertNormalMapY=e.invertNormalMapY),void 0!==e.useOnlyMetallicFromMetallicReflectanceMap&&(this.mInternalMaterial.useOnlyMetallicFromMetallicReflectanceTexture=e.useOnlyMetallicFromMetallicReflectanceMap),void 0!==e.usePhysicalLightFalloff&&(this.mInternalMaterial.usePhysicalLightFalloff=e.usePhysicalLightFalloff),void 0!==e.useTransmission&&(this.mUseTransmission=e.useTransmission,this.mUseTransmission||(this.mInternalMaterial.refractionTexture=null)))}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Hd.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return fv(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=mv(e)}},{key:"getTransparencyMode",value:function(){return pv(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=dv(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Hd.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return lv(this.mInternalMaterial.backFaceCulling,this.mInternalMaterial.cullBackFaces)}},{key:"setSide",value:function(e){var t=hv(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.cullBackFaces=t.cullBackFace,this.mInternalMaterial.twoSidedLighting=e===Fs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mDiffuseColor.copy(e.mDiffuseColor),this.mAmbientColor.copy(e.mAmbientColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mReflectionColor.copy(e.mReflectionColor),this.mSpecularColor.copy(e.mSpecularColor),this.mMetallicReflectanceColor.copy(e.mMetallicReflectanceColor),this.mNormalScale.copy(e.mNormalScale),this.mEnvMapScale.copy(e.mEnvMapScale),this.mLightMapIntensity=e.mLightMapIntensity,this.mUseSpecularGlossinessFlow=e.mUseSpecularGlossinessFlow,this.mUseTransmission=e.mUseTransmission,this.mMetalness=e.mMetalness,this.mRoughness=e.mRoughness,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mNormalMap=e.mNormalMap,this.mAoMap=e.mAoMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mEnvBrdfMap=e.mEnvBrdfMap,this.mLightMap=e.mLightMap,this.mReflectivityMap=e.mReflectivityMap,this.mReflectionMap=e.mReflectionMap,this.mGlossRoughMap=e.mGlossRoughMap,this.mMetalnessMap=e.mMetalnessMap,this.mMetallicReflectanceMap=e.mMetallicReflectanceMap,this.mBrdfConfiguration=e.mBrdfConfiguration,this.mDetailMapConfiguration=e.mDetailMapConfiguration,this.mClearCoatConfiguration=e.mClearCoatConfiguration,this.mSheenConfiguration=e.mSheenConfiguration,this.mAnisotropicConfiguration=e.mAnisotropicConfiguration,this.mSubSurfaceConfiguration=e.mSubSurfaceConfiguration,this.mIridescenceConfiguration=e.mIridescenceConfiguration,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().id,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().stencil.copyTo(this.mInternalMaterial.stencil),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().detailMap.copyTo(this.mInternalMaterial.detailMap),e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),e.getInternalMaterial().iridescence.copyTo(this.mInternalMaterial.iridescence),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Rn.o);function bv(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return BABYLON.Constants.MATERIAL_WireFrameFillMode;switch(e){case Ds.O.POINTS:return BABYLON.Constants.MATERIAL_PointFillMode;case Ds.O.LINES:return BABYLON.Constants.MATERIAL_LineListDrawMode;case Ds.O.LINE_LOOP:return BABYLON.Constants.MATERIAL_LineLoopDrawMode;case Ds.O.LINE_STRIP:return BABYLON.Constants.MATERIAL_LineStripDrawMode;default:case Ds.O.TRIANGLES:return BABYLON.Constants.MATERIAL_TriangleFillMode;case Ds.O.TRIANGLE_STRIP:return BABYLON.Constants.MATERIAL_TriangleStripDrawMode;case Ds.O.TRIANGLE_FAN:return BABYLON.Constants.MATERIAL_TriangleFanDrawMode}}function Av(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Av=function(){return!!e})()}function _v(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Mv=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Av()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mCastShadow",!1),(0,c.A)(r,"mReceiveShadow",!1),(0,c.A)(r,"mOldGeometryResolver",void 0),(0,c.A)(r,"mGeometryResolver",void 0),(0,c.A)(r,"mOldMaterialResolver",void 0),(0,c.A)(r,"mMaterialResolver",void 0),(0,c.A)(r,"mGeometryHandle",void 0),(0,c.A)(r,"mMaterialHandle",void 0),(0,c.A)(r,"mGeometry",void 0),(0,c.A)(r,"mMaterial",void 0),(0,c.A)(r,"mOnBeforeRenderObserver",void 0),(0,c.A)(r,"mOnAfterRenderObserver",void 0),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(l=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.next=3,this.loadResources();case 3:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"geometryHasChanged",value:function(){return!this.mGeometryResolver||!this.mGeometryResolver.getHandle().validateHandle(this.mGeometryHandle)}},{key:"materialHasChanged",value:function(){return!this.mMaterialResolver||!this.mMaterialResolver.getHandle().validateHandle(this.mMaterialHandle)}},{key:"loadGeometry",value:(o=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mGeometryResolver||!this.mGeometryResolver.getHandle().validateHandle(this.mGeometryHandle)){e.next=2;break}return e.abrupt("return",this.mGeometryResolver.load());case 2:if(this.mGeometryResolver&&(this.mOldGeometryResolver=this.mGeometryResolver,delete this.mGeometryResolver),this.mGeometryHandle){e.next=5;break}throw new Error("Invalid geometry handle");case 5:return this.mGeometryResolver=new zd(this.mGeometryHandle,en.n.GeometryManager,!0),e.next=8,this.mGeometryResolver.load();case 8:return t=e.sent,this.mOldGeometryResolver&&(this.mOldGeometryResolver.dispose(),delete this.mOldGeometryResolver),e.abrupt("return",t);case 11:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"loadMaterial",value:(a=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mMaterialResolver||!this.mMaterialResolver.getHandle().validateHandle(this.mMaterialHandle)){e.next=4;break}return e.next=3,this.mMaterialResolver.load();case 3:return e.abrupt("return",e.sent);case 4:if(this.mMaterialResolver&&(this.mOldMaterialResolver=this.mMaterialResolver,delete this.mMaterialResolver),this.mMaterialHandle){e.next=7;break}throw new Error("Invalid material handle");case 7:return this.mMaterialResolver=new zd(this.mMaterialHandle,en.n.MaterialManager,!0),e.next=10,this.mMaterialResolver.load();case 10:return t=e.sent,this.mOldMaterialResolver&&(this.mOldMaterialResolver.dispose(),delete this.mOldMaterialResolver),e.abrupt("return",t);case 13:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateGeometryAsync",value:function(){var e=this;this.geometryHasChanged()&&this.loadGeometry().then((function(t){e.mGeometry=t,e.mRenderObject&&(e.mGeometry.getInternalGeometry().applyToMesh(e.mRenderObject),e.mRenderer.markShadowMapUpdate(),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)))}),(function(e){v.UX.warn("Failed to load geometry:",e)}))}},{key:"updateMaterialAsync",value:function(){var e=this;this.materialHasChanged()?(this.mMaterial&&this.mMaterial instanceof gv&&this.hasMaterialTransmission(this.mMaterial)&&this.getRenderer().disposeTransmission(this.mMaterial.getUniqueId(),this.mSceneEntity.getSceneObjectId()),this.loadMaterial().then((function(t){e.mMaterial=t,e.updateTransmission(),e.mRenderObject&&(e.mRenderObject.material=e.mMaterial?e.mMaterial.getInternalMaterial():null,e.mRenderObject.material&&(e.mRenderObject.material.fillMode=bv(e.mSceneEntity.drawMode)),e.mRenderer.markShadowMapUpdate(),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)))}),(function(e){v.UX.warn("Failed to load material:",e)}))):this.updateTransmission()}},{key:"loadResources",value:(r=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.loadGeometry(),this.loadMaterial()]);case 2:t=e.sent,this.mGeometry=t[0],this.mMaterial=t[1],this.updateTransmission(),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame));case 7:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;if(this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow,this.mGeometryHandle=e.getGeometry(),this.mMaterialHandle=e.getMaterial(),this.mRenderObject){this.mRenderObject.renderingGroupId=e.renderOrder;var t=this.mMaterial.getMetaData()||{};void 0!==t.renderOrder&&(this.mRenderObject.alphaIndex=Number(t.renderOrder)),this.mRenderObject.metadata||(this.mRenderObject.metadata={}),void 0!==t.renderLayer&&(this.mRenderObject.metadata.renderLayer=t.renderLayer,this.getRenderer().transmissionUpdateMaterial(this.mRenderObject))}}},{key:"onUpdateDirty",value:function(){_v(t,"onUpdateDirty",this,3)([]),this.mRenderObject.isVisible=this.mSceneEntity.getVisibility(),this.updateProperties(),this.updateGeometryAsync(),this.updateMaterialAsync(),this.updateShadow(),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))}},{key:"updateTranslation",value:function(){_v(t,"updateTranslation",this,3)([])&&(this.mReceiveShadow||this.mCastShadow)&&this.mRenderer.markShadowMapUpdate()}},{key:"updateShadow",value:function(){this.mRenderObject.receiveShadows=this.mReceiveShadow,this.mRenderObject.metadata||(this.mRenderObject.metadata={}),this.mRenderObject.metadata.cast_shadow=this.mCastShadow}},{key:"updateTransmission",value:function(){this.mMaterial&&this.mMaterial instanceof gv&&this.hasMaterialTransmission(this.mMaterial)?this.getRenderer().initiateTransmission(this.mMaterial.getUniqueId(),this.mSceneEntity.getSceneObjectId()):this.getRenderer().disposeTransmission(this.mMaterial.getUniqueId(),this.mSceneEntity.getSceneObjectId())}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject.getBoundingInfo(),n=[],r=[];e.boundingBox.minimum.toArray(n),e.boundingBox.maximum.toArray(r);var i=(new te.P).fromArray(n),a=(new te.P).fromArray(r);this.mBoundingBox.copy(new Os.N(i,a)),_v(t,"updateBoundingBox",this,3)([])}},{key:"createRenderObject",value:function(){var e=this;if(!this.mMaterial||!this.mGeometry)throw new Error("Mesh: Invalid resources.");var t=new BABYLON.Mesh(this.mSceneEntity.name,this.getRenderer().getScene());t.isVisible=this.mSceneEntity.getVisibility(),t.renderingGroupId=this.mSceneEntity.renderOrder,this.mRenderer.isRightHandedSystemActive()||this.mGeometry.getInternalGeometry().toLeftHanded(),this.mGeometry.getInternalGeometry().applyToMesh(t),t.material=this.mMaterial.getInternalMaterial(),t.material.backFaceCulling=this.mMaterial.getSide()!==Fs.k.Double,t.useVertexColors=this.mGeometry.hasColors(),t.hasVertexAlpha=this.mGeometry.hasAlpha(),t.material&&(t.material.fillMode=bv(this.mSceneEntity.drawMode,this.mMaterial.getWireframe()));var n,r=this.mMaterial.getMetaData()||{};(void 0!==r.renderOrder&&(t.alphaIndex=Number(r.renderOrder)),t.metadata||(t.metadata={}),t.metadata.renderLayer!==r.renderLayer)&&(t.metadata.renderLayer=null!==(n=r.renderLayer)&&void 0!==n?n:-1,this.getRenderer().transmissionUpdateMaterial(t));t.receiveShadows=this.mReceiveShadow,this.mOnBeforeRenderObserver=t.onBeforeRenderObservable.add((function(){e.getRenderer().onBeforeMeshRender(t,e.mSceneEntity)})),this.mOnAfterRenderObserver=t.onAfterRenderObservable.add((function(){e.getRenderer().onAfterMeshRender(t,e.mSceneEntity)})),this.mRenderObject=t}},{key:"destroyRenderObject",value:function(){var e=this.mRenderObject;if(this.mGeometry&&this.mGeometry.getInternalGeometry().releaseForMesh(e,!1),delete this.mGeometry,delete this.mMaterial,e&&(e.onBeforeRenderObservable.remove(this.mOnBeforeRenderObserver),e.onAfterRenderObservable.remove(this.mOnAfterRenderObserver)),this.mMaterialResolver)try{this.mMaterialResolver.dispose(),delete this.mMaterialResolver}catch(e){v.UX.warn("Failed to dispose resource",e)}if(this.mOldMaterialResolver)try{this.mOldMaterialResolver.dispose(),delete this.mOldMaterialResolver}catch(e){v.UX.warn("Failed to dispose resource",e)}if(this.mGeometryResolver)try{this.mGeometryResolver.dispose(),delete this.mGeometryResolver}catch(e){v.UX.warn("Failed to dispose resource",e)}if(this.mOldGeometryResolver)try{this.mOldGeometryResolver.dispose(),delete this.mOldGeometryResolver}catch(e){v.UX.warn("Failed to dispose resource",e)}_v(t,"destroyRenderObject",this,3)([])}},{key:"hasMaterialTransmission",value:function(e){return e.getFlags().useTransmission}}]);var r,a,o,l}(Vd);function kv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kv=function(){return!!e})()}function wv(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Tv=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,kv()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mCastShadow",!1),(0,c.A)(r,"mReceiveShadow",!1),(0,c.A)(r,"mGeometryResolver",void 0),(0,c.A)(r,"mMaterialResolver",void 0),(0,c.A)(r,"mGeometryHandle",void 0),(0,c.A)(r,"mMaterialHandle",void 0),(0,c.A)(r,"mGeometry",void 0),(0,c.A)(r,"mMaterial",void 0),(0,c.A)(r,"mOnBeforeRenderObserver",void 0),(0,c.A)(r,"mOnAfterRenderObserver",void 0),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(l=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.next=3,this.loadResources();case 3:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"geometryHasChanged",value:function(){return!this.mGeometryResolver||!this.mGeometryResolver.getHandle().validateHandle(this.mGeometryHandle)}},{key:"materialHasChanged",value:function(){return!this.mMaterialResolver||!this.mMaterialResolver.getHandle().validateHandle(this.mMaterialHandle)}},{key:"loadGeometry",value:(o=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mGeometryResolver||!this.mGeometryResolver.getHandle().validateHandle(this.mGeometryHandle)){e.next=2;break}return e.abrupt("return",this.mGeometryResolver.load());case 2:if(this.mGeometryResolver&&(this.mGeometryResolver.dispose(),delete this.mGeometryResolver),this.mGeometryHandle){e.next=5;break}throw new Error("Invalid geometry handle");case 5:return this.mGeometryResolver=new zd(this.mGeometryHandle,en.n.GeometryManager),e.abrupt("return",this.mGeometryResolver.load());case 7:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"loadMaterial",value:(a=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mMaterialResolver||!this.mMaterialResolver.getHandle().validateHandle(this.mMaterialHandle)){e.next=2;break}return e.abrupt("return",this.mMaterialResolver.load());case 2:if(this.mMaterialResolver&&(this.mMaterialResolver.dispose(),delete this.mMaterialResolver),this.mMaterialHandle){e.next=5;break}throw new Error("Invalid material handle");case 5:return this.mMaterialResolver=new zd(this.mMaterialHandle,en.n.MaterialManager),e.abrupt("return",this.mMaterialResolver.load());case 7:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateGeometryAsync",value:function(){var e=this;this.geometryHasChanged()&&this.loadGeometry().then((function(t){e.mGeometry=t,e.mRenderObject&&e.mGeometry.getInternalGeometry().applyToMesh(e.mRenderObject)}),(function(e){v.UX.warn("Failed to load geometry:",e)}))}},{key:"updateMaterialAsync",value:function(){var e=this;this.materialHasChanged()&&this.loadMaterial().then((function(t){(e.mMaterial=t,e.mRenderObject)&&(e.mRenderObject.material.backFaceCulling=e.mMaterial.getSide()!==Fs.k.Double,e.mRenderObject.material&&(e.mRenderObject.material.fillMode=bv(e.mSceneEntity.drawMode)))}),(function(e){v.UX.warn("Failed to load material:",e)}))}},{key:"loadResources",value:(r=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.loadGeometry(),this.loadMaterial()]);case 2:t=e.sent,this.mGeometry=t[0],this.mMaterial=t[1];case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow,this.mGeometryHandle=e.getGeometry(),this.mMaterialHandle=e.getMaterial(),this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder)}},{key:"onUpdateDirty",value:function(){wv(t,"onUpdateDirty",this,3)([]),this.mRenderObject.isVisible=this.mSceneEntity.getVisibility(),this.updateProperties(),this.updateGeometryAsync(),this.updateMaterialAsync(),this.updateShadow()}},{key:"updateShadow",value:function(){this.mRenderObject.receiveShadows=this.mReceiveShadow,this.mRenderObject.metadata||(this.mRenderObject.metadata={}),this.mRenderObject.metadata.cast_shadow=this.mCastShadow}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject.getBoundingInfo(),n=[],r=[];e.boundingBox.minimum.toArray(n),e.boundingBox.maximum.toArray(r);var i=(new te.P).fromArray(n),a=(new te.P).fromArray(r);this.mBoundingBox.copy(new Os.N(i,a)),wv(t,"updateBoundingBox",this,3)([])}},{key:"createRenderObject",value:function(){var e,t=this;if(!this.mMaterial||!this.mGeometry)throw new Error("Mesh: Invalid resources.");var n=this.mGeometry.hasColors(),r=this.mGeometry.hasAlpha(),i=new BABYLON.LinesMesh(this.mSceneEntity.name,this.getRenderer().getScene(),void 0,void 0,void 0,n,r,this.mMaterial?this.mMaterial.getInternalMaterial():null);i.isVisible=this.mSceneEntity.getVisibility(),i.renderingGroupId=this.mSceneEntity.renderOrder,this.mRenderer.isRightHandedSystemActive()||this.mGeometry.getInternalGeometry().toLeftHanded(),this.mGeometry.getInternalGeometry().applyToMesh(i),i.material.backFaceCulling=(null===(e=this.mMaterial)||void 0===e?void 0:e.getSide())!==Fs.k.Double,i.useVertexColors=n,i.hasVertexAlpha=r,i.material&&(i.material.fillMode=bv(this.mSceneEntity.drawMode,!1)),i.receiveShadows=this.mReceiveShadow,this.mOnBeforeRenderObserver=i.onBeforeRenderObservable.add((function(){t.getRenderer().onBeforeMeshRender(i,t.mSceneEntity)})),this.mOnAfterRenderObserver=i.onAfterRenderObservable.add((function(){t.getRenderer().onAfterMeshRender(i,t.mSceneEntity)})),this.mRenderObject=i}},{key:"destroyRenderObject",value:function(){var e=this.mRenderObject;this.mGeometry&&this.mGeometry.getInternalGeometry().releaseForMesh(e,!1),delete this.mGeometry,delete this.mMaterial,e.onBeforeRenderObservable.remove(this.mOnBeforeRenderObserver),e.onAfterRenderObservable.remove(this.mOnAfterRenderObserver),this.mMaterialResolver&&this.mMaterialResolver.dispose(),this.mGeometryResolver&&this.mGeometryResolver.dispose(),wv(t,"destroyRenderObject",this,3)([])}}]);var r,a,o,l}(Vd);function xv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xv=function(){return!!e})()}var Sv=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,xv()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mCellWidth",1),(0,c.A)(r,"mCellHeight",1),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"updateProperties",value:function(){var e,n,r,i,a;(e=t,n="updateProperties",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]);var o=this.mSceneEntity;this.mCellWidth=o.getValue("cell_width"),this.mCellHeight=o.getValue("cell_height")}}])}(Mv);function Cv(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ev(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ev(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ev(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Rv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rv=function(){return!!e})()}function Iv(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Ov=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Rv()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mPower",.5),(0,c.A)(e,"mClipDistance",.05),(0,c.A)(e,"mSamplingRadius",8),(0,c.A)(e,"mPlane",void 0),(0,c.A)(e,"mDepthCamera",void 0),(0,c.A)(e,"mRT1",void 0),(0,c.A)(e,"mRT2",void 0),(0,c.A)(e,"mDepthShaderMaterial",void 0),(0,c.A)(e,"mAoPlaneEffect",void 0),(0,c.A)(e,"mBlurEffect",void 0),(0,c.A)(e,"mEffectRenderer",void 0),(0,c.A)(e,"mPlaneMaterial",void 0),(0,c.A)(e,"AOPlaneRTSize",256),(0,c.A)(e,"mRebuildAO",!0),(0,c.A)(e,"mDepthVertexShader","\n        attribute vec3 position;\n        attribute vec2 uv;\n\n        uniform mat4 worldView;\n        uniform mat4 worldViewProjection;\n        uniform mat4 projection;\n        uniform float zCorrection;\n\n        varying float vDepth;\n        varying vec2 vUv;\n        varying vec3 vModelPosition;\n\n        void main() {\n            vec4 worldPosition = worldView * vec4( position, 1.0 );\n            vModelPosition = worldPosition.xyz;\n            vDepth = worldPosition.z * zCorrection;\n            vUv = uv;\n            gl_Position = projection * worldPosition;\n        }\n    "),(0,c.A)(e,"mAoBlurVertex","\n        precision highp float;\n        attribute vec2 position;\n\n        varying vec2 vUv;\n        varying vec3 vModelPosition;\n        const vec2 madd = vec2(0.5, 0.5);\n\n        void main(void) {\n            vUv = (position * madd + madd);\n            vModelPosition = vec3(position, 0.0);\n            gl_Position = vec4(position, 0.0, 1.0);\n        }\n    "),(0,c.A)(e,"mDepthFragmentShader","\n        uniform float far;\n\n        varying float vDepth;\n\n        const float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\n        const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\n        const float ShiftRight8 = 1. / 256.;\n\n        vec4 packDepthToRGBA(const in float v) {\n            vec4 r = vec4( fract( v * PackFactors ), v );\n            r.yzw -= r.xyz * ShiftRight8; // tidy overflow\n            return r * PackUpscale;\n        }\n\n        void main() {\n            gl_FragColor = packDepthToRGBA(vDepth / far); // save depth in part-components space.\n        }\n    "),(0,c.A)(e,"mBlurFragmentShader","\n        uniform vec2 iResolution;\n        uniform vec2 direction;\n        uniform sampler2D tDiffuse;\n\n        varying vec2 vUv;\n\n        vec4 blur13(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {\n            vec4 color = vec4(0.0);\n            vec2 off1 = vec2(1.411764705882353) * direction;\n            vec2 off2 = vec2(3.2941176470588234) * direction;\n            vec2 off3 = vec2(5.176470588235294) * direction;\n            color += texture2D(image, uv) * 0.1964825501511404;\n            color += texture2D(image, uv + (off1 / resolution)) * 0.2969069646728344;\n            color += texture2D(image, uv - (off1 / resolution)) * 0.2969069646728344;\n            color += texture2D(image, uv + (off2 / resolution)) * 0.09447039785044732;\n            color += texture2D(image, uv - (off2 / resolution)) * 0.09447039785044732;\n            color += texture2D(image, uv + (off3 / resolution)) * 0.010381362401148057;\n            color += texture2D(image, uv - (off3 / resolution)) * 0.010381362401148057;\n            return color;\n        }\n\n        void main() {\n            gl_FragColor = blur13(tDiffuse, vUv, iResolution.xy, direction);\n        }\n    "),(0,c.A)(e,"mAoFragmentShader","\n        uniform sampler2D Sample0;\t// View space position data\n        uniform vec2 TexelSize;\n        uniform float SamplingRadius;\n        uniform float Power;\n        uniform float CameraFar;\n        uniform float CameraNear;\n        uniform vec2 RightTop;\n\n        varying vec3 vModelPosition;\n        varying vec2 vUv;\n\n        const float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)]\n        const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\n        const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\n\n        float unpackRGBAToDepth( const in vec4 v ) {\n            return dot( v, UnpackFactors );\n        }\n\n        vec3 reconstructPosition(vec2 uv) {\n            vec2 ndc = uv*2.0 - vec2(1.0, 1.0);\n            vec4 sampleDepth = texture2D(Sample0, uv);\n            float modelDepth = unpackRGBAToDepth(sampleDepth);\n            vec2 pnear = ndc * RightTop;\n            float pz = -modelDepth*CameraFar;\n            return vec3(-pz*pnear.x / CameraNear, -pz*pnear.y / CameraNear, pz);\n        }\n\n        float SamplePixels(vec3 srcPosition, vec2 uv) {\n            vec3 dstPosition = reconstructPosition(uv);\n\n            vec3 positionVec = dstPosition - srcPosition;\n            float dist = length(positionVec);\n            float intensity = dist*dist*dist*dist;\n            intensity = exp(intensity*-Power);\n\n            return min(-dstPosition.z, intensity);\n        }\n\n        void main() {\n            float kernelRadius = SamplingRadius;\n\n            // Sample neighbouring pixels\n            vec2 kernel[4];\n            kernel[0] = vec2(0.0, 1.0);\t // top\n            kernel[1] = vec2(1.0, 0.0);\t // right\n            kernel[2] = vec2(0.0, -1.0); // bottom\n            kernel[3] = vec2(-1.0, 0.0); // left\n\n            const float Sin45 = 0.707107;\t// 45 degrees = sin(PI / 4)\n\n            float occlusion = 0.0;\n            for (int i = 0; i < 4; ++i)\n            {\n                vec2 k1 = kernel[i];\n                vec2 k2 = vec2(k1.x * Sin45 - k1.y * Sin45, k1.x * Sin45 + k1.y * Sin45);\n                k1 *= TexelSize;\n                k2 *= TexelSize;\n                occlusion += SamplePixels(vModelPosition, vUv + k1 * kernelRadius);\n                occlusion += SamplePixels(vModelPosition, vUv + k2 * kernelRadius * 0.75);\n                occlusion += SamplePixels(vModelPosition, vUv + k1 * kernelRadius * 0.5);\n                occlusion += SamplePixels(vModelPosition, vUv + k2 * kernelRadius * 0.25);\n            }\n\n            // Average and clamp ambient occlusion\n            occlusion /= 16.0;\n            occlusion = clamp(occlusion, 0.0, 1.0);\n\n            gl_FragColor = vec4(0.0, 0.0, 0.0, exp(occlusion)-1.0);\n        }\n    "),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"isDirty",get:function(){return this.mRebuildAO},set:function(e){this.mRebuildAO=e}},{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties(),this.isDirty=!0;case 2:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mClipDistance=e.clipDistance,this.mSamplingRadius=e.samplingRadius,this.mPower=e.power,this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder)}},{key:"calculatePower",value:function(){return 1/Math.exp(9*(1-(1-this.mPower)))}},{key:"updatePlaneGeometry",value:function(e,t,n){this.mPlane.scaling.x=t*(this.mRenderer.isRightHandedSystemActive()?1:-1),this.mPlane.scaling.y=n*(this.mRenderer.isRightHandedSystemActive()?-1:1),this.mPlane.position=e,this.mPlane.rotation.x=.5*Math.PI*(this.mRenderer.isRightHandedSystemActive()?-1:1);var r=this.mSceneEntity;r.width=t,r.height=n}},{key:"fitCameraToObject",value:function(){var e=this.getRenderer().getSceneBoundingBox();e.isEmpty()&&e.set(new te.P(0,0,0),new te.P(0,0,0));var n=this.getRenderer().getEngine(),r=new te.P;e.getCenter(r);var i=new te.P;e.getSize(i);var a=i.x>i.z?i.x:i.z;if(!(a<=0)){var o=a/2/Math.tan(45*Math.PI/360);this.mDepthCamera.position.set(r.x,r.y-(o+i.y),r.z),this.mDepthCamera.maxZ=Math.abs(this.mDepthCamera.position.y-e.min.y)*(1+this.mClipDistance),this.mDepthCamera.fov=(0,_.pu)(45);var s=n.getRenderWidth()/n.getRenderHeight();this.mDepthCamera.viewport.height=s,this.mDepthCamera.setTarget(new BABYLON.Vector3(r.x,r.y,r.z)),this.mDepthCamera.rotation.y=Math.PI,this.mDepthCamera.computeWorldMatrix();var u=2*Math.tan(Math.PI/180*45/2)*this.mDepthCamera.maxZ,c=new BABYLON.Vector3(r.x,e.min.y-t.POSITION_EPSILON,r.z),l=u*((BABYLON.Vector3.Distance(this.mDepthCamera.position,c)-this.mDepthCamera.minZ)/(this.mDepthCamera.maxZ-this.mDepthCamera.minZ));this.updatePlaneGeometry(c,l,l)}}},{key:"renderPlaneDepth",value:function(){this.mDepthShaderMaterial.setFloat("far",this.mDepthCamera.maxZ),this.mDepthShaderMaterial.setFloat("zCorrection",this.mRenderer.isRightHandedSystemActive()?-1:1);var e,t=this.mRT1.renderList,n=Cv(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.metadata._savedMaterial=r.material,r.material=this.mDepthShaderMaterial}}catch(e){n.e(e)}finally{n.f()}this.mRT1.render(!1,!1);var i,a=Cv(t);try{for(a.s();!(i=a.n()).done;){var o=i.value;o.material=o.metadata._savedMaterial}}catch(e){a.e(e)}finally{a.f()}}},{key:"renderAO",value:function(){this.mEffectRenderer.render(this.mAoPlaneEffect,this.mRT2)}},{key:"renderBlur",value:function(){var e=this;this.mBlurEffect.onApplyObservable.clear(),this.mBlurEffect.onApplyObservable.add((function(){e.mBlurEffect.effect.setFloat2("iResolution",e.AOPlaneRTSize,e.AOPlaneRTSize),e.mBlurEffect.effect.setFloat2("direction",1,0),e.mBlurEffect.effect.setTexture("tDiffuse",e.mRT2)})),this.mEffectRenderer.render(this.mBlurEffect,this.mRT1),this.mBlurEffect.onApplyObservable.clear(),this.mBlurEffect.onApplyObservable.add((function(){e.mBlurEffect.effect.setFloat2("iResolution",e.AOPlaneRTSize,e.AOPlaneRTSize),e.mBlurEffect.effect.setFloat2("direction",0,1),e.mBlurEffect.effect.setTexture("tDiffuse",e.mRT1)})),this.mEffectRenderer.render(this.mBlurEffect,this.mRT2)}},{key:"createRenderTarget",value:function(e){var t=new BABYLON.RenderTargetTexture(e,this.AOPlaneRTSize,this.getRenderer().getScene(),!0,!0,BABYLON.Constants.TEXTURETYPE_UNSIGNED_BYTE,!1,BABYLON.Texture.LINEAR_LINEAR_MIPLINEAR,!0,!1,!1,BABYLON.Constants.TEXTUREFORMAT_RGBA);return t.hasAlpha=!0,t}},{key:"createDepthShader",value:function(){this.mDepthShaderMaterial=new BABYLON.ShaderMaterial("ao-plane-depth-material",this.getRenderer().getScene(),{vertexSource:this.mDepthVertexShader,fragmentSource:this.mDepthFragmentShader},{attributes:["position","normal","uv"],uniforms:["world","worldView","worldViewProjection","view","projection","far","zCorrection"],defines:[],needAlphaBlending:!0,needAlphaTesting:!0}),this.mDepthShaderMaterial.backFaceCulling=!1}},{key:"createAOEffect",value:function(){var e=this;this.mAoPlaneEffect=new BABYLON.EffectWrapper({name:"ao-plane-effect-wrapper",engine:this.getRenderer().getEngine(),vertexShader:this.mAoBlurVertex,fragmentShader:this.mAoFragmentShader,attributeNames:["position"],samplerNames:["Sample0"],uniformNames:["TexelSize","SamplingRadius","Power","CameraFar","CameraNear","RightTop"]}),this.mAoPlaneEffect.onApplyObservable.add((function(){var t=e.mDepthCamera.maxZ,n=e.mDepthCamera.minZ,r=e.mDepthCamera.fov,i=e.getRenderer().getEngine().getAspectRatio(e.mDepthCamera),a=Math.tan(r/2)*n,o=a*i,s=new BABYLON.Vector2(o,a);e.mAoPlaneEffect.effect.setFloat2("TexelSize",1/e.AOPlaneRTSize,1/e.AOPlaneRTSize),e.mAoPlaneEffect.effect.setFloat("SamplingRadius",e.mSamplingRadius),e.mAoPlaneEffect.effect.setFloat("Power",e.calculatePower()),e.mAoPlaneEffect.effect.setFloat("CameraFar",t),e.mAoPlaneEffect.effect.setFloat("CameraNear",n),e.mAoPlaneEffect.effect.setFloat2("RightTop",s.x,s.y),e.mAoPlaneEffect.effect.setTexture("Sample0",e.mRT1)}))}},{key:"createBlurEffect",value:function(){this.mBlurEffect=new BABYLON.EffectWrapper({name:"ao-plane-blur-effect-wrapper",engine:this.getRenderer().getEngine(),vertexShader:this.mAoBlurVertex,fragmentShader:this.mBlurFragmentShader,attributeNames:["position","normal","uv"],samplerNames:["tDiffuse"],uniformNames:["worldViewProjection","iResolution","direction"]})}},{key:"createRenderObject",value:function(){var e=this,t=this.getRenderer().getEngine(),n=this.getRenderer().getScene();this.mDepthCamera=new BABYLON.FreeCamera("ao_plane_camera",new BABYLON.Vector3(0,0,-10),n,!1),this.mDepthCamera.ignoreParentScaling=!0,this.mDepthCamera.minZ=.01,this.mDepthCamera.maxZ=1e4,this.mDepthCamera.fov=(0,_.pu)(45),this.mRT1=this.createRenderTarget("ao-plane-RT1"),this.mRT2=this.createRenderTarget("ao-plane-RT2"),this.mRT1.activeCamera=this.mDepthCamera,this.mRT1.clearColor=new BABYLON.Color4(0,0,0,0),this.mRT2.clearColor=new BABYLON.Color4(0,0,0,0),this.mRT1.ignoreCameraViewport=!0,this.mRT2.ignoreCameraViewport=!0,this.mEffectRenderer=new BABYLON.EffectRenderer(t,{positions:this.mRenderer.isRightHandedSystemActive()?[1,-1,-1,-1,-1,1,1,1]:[1,1,-1,1,-1,-1,1,-1]}),this.createDepthShader(),this.createAOEffect(),this.createBlurEffect(),this.mPlaneMaterial=new BABYLON.StandardMaterial("ao-plane-material",n),this.mPlaneMaterial.transparencyMode=BABYLON.StandardMaterial.MATERIAL_ALPHABLEND,this.mPlaneMaterial.sideOrientation=BABYLON.Constants.MATERIAL_CounterClockWiseSideOrientation,this.mPlaneMaterial.backFaceCulling=!0,this.mPlaneMaterial.diffuseTexture=this.mRT2,this.mPlaneMaterial.useAlphaFromDiffuseTexture=!0,this.mPlaneMaterial.specularColor=BABYLON.Color3.Black(),this.mPlane=BABYLON.MeshBuilder.CreatePlane("ao-plane-mesh",{size:1},n),this.mPlane.renderingGroupId=this.mSceneEntity.renderOrder,this.mPlane.material=this.mPlaneMaterial,this.mPlane.isPickable=!1,this.mRenderObject=this.mPlane,this.getRenderer().getScene().executeWhenReady((function(){e.isDirty=!0}))}},{key:"updateTranslation",value:function(){return!1}},{key:"checksumRenderList",value:function(e){var t,n=e.map((function(e){return e.worldMatrixFromCache.m})).join(""),r=0;if(0===n.length)return r;for(t=0;t<n.length;t++)r=(r<<5)-r+n.charCodeAt(t),r|=0;return r}},{key:"updateRenderList",value:function(){var e,t=this,n=this.getRenderer().getScene().meshes.filter((function(e){var n,r=null===(n=t.getRenderer().getEntityFromObject(e))||void 0===n?void 0:n.layers;return e.id!==t.mPlane.id&&r&&!r.isEnabled(1)&&!r.isEnabled(2)&&!r.isEnabled(7)})),r=this.checksumRenderList(n);(null===(e=this.mRT1.metadata)||void 0===e?void 0:e.checksum)!==r&&(this.mRT1.metadata=this.mRT1.metadata||{},this.mRT1.metadata.checksum=r,this.mRT1.renderList=n,this.isDirty=!0)}},{key:"onUpdateDirty",value:function(){Iv(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.isDirty=!0}},{key:"update",value:function(e){Iv(t,"update",this,3)([e]),this.updateRenderList(),this.isDirty&&(this.fitCameraToObject(),this.renderPlaneDepth(),this.renderAO(),this.renderBlur(),this.isDirty=!1)}},{key:"disposeProperty",value:function(e){e&&e.dispose()}},{key:"dispose",value:function(){this.disposeProperty(this.mRT1),this.disposeProperty(this.mRT2),this.disposeProperty(this.mPlaneMaterial),this.disposeProperty(this.mDepthShaderMaterial),this.disposeProperty(this.mPlane),this.disposeProperty(this.mEffectRenderer),this.disposeProperty(this.mDepthCamera),this.disposeProperty(this.mAoPlaneEffect),this.disposeProperty(this.mBlurEffect),Iv(t,"dispose",this,3)([])}}]);var r}(Vd);function Dv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dv=function(){return!!e})()}(0,c.A)(Ov,"POSITION_EPSILON",.001);var Pv=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Dv()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mFireMesh",void 0),(0,c.A)(e,"mFireMaterial",void 0),(0,c.A)(e,"mPosition",new BABYLON.Vector3),(0,c.A)(e,"mScale",new BABYLON.Vector3),(0,c.A)(e,"mRotation",new BABYLON.Quaternion),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(a=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.loadTextures();case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),v.UX.warn("Failed to load fire textures:",e.t0);case 8:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(){return a.apply(this,arguments)})},{key:"loadTextures",value:(r=(0,n.A)(i().mark((function e(){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){if(++t.sTextures.revision>1)return e();var r=n.getRenderer().getScene();t.sTextures.textures=[new BABYLON.Texture("".concat(et.w.assetsUrl,"system/textures/fire-diffuse.png"),r),new BABYLON.Texture("".concat(et.w.assetsUrl,"system/textures/fire-distortion.png"),r),new BABYLON.Texture("".concat(et.w.assetsUrl,"system/textures/fire-candleopacity.png"),r)],BABYLON.Texture.WhenAllReady(t.sTextures.textures,(function(){e()}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"disposeTextures",value:function(){--t.sTextures.revision>0||(t.sTextures.revision=0,t.sTextures.textures.splice(0).forEach((function(e){e.dispose()})))}},{key:"updateTranslation",value:function(){if(!this.mMatrixNeedsUpdate&&!this.mSceneEntity.transform.matrixNeedsUpdate&&!this.mSceneEntity.transform.matrixWorldNeedsUpdate)return!1;var e=this.mSceneEntity.transform.matrixWorld.elements;return this.mMatrix.setRowFromFloats(0,e[0],e[1],e[2],e[3]),this.mMatrix.setRowFromFloats(1,e[4],e[5],e[6],e[7]),this.mMatrix.setRowFromFloats(2,e[8],e[9],e[10],e[11]),this.mMatrix.setRowFromFloats(3,e[12],e[13],e[14],e[15]),this.mRenderer.isRightHandedSystemActive()||this.mMatrix.toggleModelMatrixHandInPlace(),this.mMatrix.decompose(this.mScale,this.mRotation,this.mPosition),this.mRenderObject.position.copyFrom(this.mPosition),this.mRenderObject.scaling.copyFrom(this.mScale),this.mRenderObject._updateBoundingInfo(),!0}},{key:"createRenderObject",value:function(){this.mFireMaterial=new BABYLON.FireMaterial("fire-material",this.getRenderer().getScene()),this.mFireMaterial.diffuseTexture=t.sTextures.textures[0],this.mFireMaterial.distortionTexture=t.sTextures.textures[1],this.mFireMaterial.opacityTexture=t.sTextures.textures[2],this.mRenderer.isRightHandedSystemActive()&&(this.mFireMaterial.sideOrientation=BABYLON.Constants.MATERIAL_CounterClockWiseSideOrientation),this.mFireMaterial.speed=5,this.mFireMesh=BABYLON.MeshBuilder.CreatePlane("fire-mesh",{size:3},this.getRenderer().getScene()),this.mFireMesh.renderingGroupId=this.mSceneEntity.renderOrder,this.mFireMesh.billboardMode=BABYLON.Mesh.BILLBOARDMODE_Y,this.mFireMesh.material=this.mFireMaterial,this.mRenderObject=this.mFireMesh}},{key:"dispose",value:function(){var e,n,r,i,a;this.mFireMaterial&&(this.mFireMaterial.diffuseTexture=null,this.mFireMaterial.distortionTexture=null,this.mFireMaterial.opacityTexture=null,this.mFireMaterial.dispose(),this.disposeTextures()),(e=t,n="dispose",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}}]);var r,a}(Vd);function Bv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bv=function(){return!!e})()}function Fv(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Pv,"sTextures",{revision:0,textures:[]});var Nv=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Bv()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mColor",BABYLON.Color3.White()),(0,c.A)(e,"mOpacity",1),(0,c.A)(e,"mReflector",void 0),(0,c.A)(e,"mReflectorMaterial",void 0),(0,c.A)(e,"mMirrorTexture",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mColor.set(e.color.r,e.color.g,e.color.b),this.mOpacity=e.opacity,this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder,this.mReflector.renderingGroupId=e.renderOrder)}},{key:"onUpdateDirty",value:function(){Fv(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mReflectorMaterial.diffuseColor.set(this.mColor.r,this.mColor.g,this.mColor.b),this.mMirrorTexture.clearColor.set(this.mColor.r,this.mColor.g,this.mColor.b,0),this.mReflectorMaterial.alpha=this.mOpacity}},{key:"update",value:function(e){Fv(t,"update",this,3)([e]),this.updateRenderlist()}},{key:"updateTranslation",value:function(){var e=this.mMatrixNeedsUpdate||this.mSceneEntity.transform.matrixNeedsUpdate||this.mSceneEntity.transform.matrixWorldNeedsUpdate;return Fv(t,"updateTranslation",this,3)([]),!!e&&(this.mMirrorTexture.mirrorPlane=this.generateMirrorPlane(),!0)}},{key:"generateMirrorPlane",value:function(){if(this.mRenderObject){var e=this.mRenderObject.getWorldMatrix(),t=BABYLON.Vector3.Zero();t=BABYLON.Vector3.TransformCoordinates(t,e);var n=new BABYLON.Vector3(0,0,1);return n=BABYLON.Vector3.TransformNormal(n,e),BABYLON.Plane.FromPositionAndNormal(t,n)}}},{key:"updateRenderlist",value:function(){var e=this;this.mRenderObject&&this.getRenderer().getScene().meshes&&this.mMirrorTexture&&(this.mMirrorTexture.renderList=this.getRenderer().getScene().meshes.filter((function(t){var n,r=null===(n=e.getRenderer().getEntityFromObject(t))||void 0===n?void 0:n.layers;return!(t.id===e.mReflector.id||r&&(r.isEnabled(1)||r.isEnabled(2)||r.isEnabled(7)))})))}},{key:"createRenderObject",value:function(){var e=new BABYLON.Mesh("reflector-group",this.getRenderer().getScene());e.renderingGroupId=this.mSceneEntity.renderOrder,this.mMirrorTexture=new BABYLON.MirrorTexture("reflector-mirror-texture",1024,this.getRenderer().getScene(),!0,void 0,BABYLON.Texture.TRILINEAR_SAMPLINGMODE),this.mMirrorTexture.mirrorPlane=this.generateMirrorPlane(),this.mMirrorTexture.level=1,this.mMirrorTexture.hasAlpha=!0,this.mMirrorTexture.blurKernel=0,this.mMirrorTexture.adaptiveBlurKernel=0,this.mMirrorTexture.clearColor=new BABYLON.Color4(this.mColor.r,this.mColor.g,this.mColor.b,0),this.mReflectorMaterial=new BABYLON.StandardMaterial("reflector-material",this.getRenderer().getScene()),this.mReflectorMaterial.diffuseColor=new BABYLON.Color3(this.mColor.r,this.mColor.g,this.mColor.b),this.mReflectorMaterial.reflectionTexture=this.mMirrorTexture,this.mReflectorMaterial.useAlphaFromDiffuseTexture=!0,this.mReflectorMaterial.alpha=this.mOpacity,this.mReflectorMaterial.transparencyMode=BABYLON.StandardMaterial.MATERIAL_ALPHABLEND,this.mRenderer.isRightHandedSystemActive()&&(this.mReflectorMaterial.sideOrientation=BABYLON.Constants.MATERIAL_CounterClockWiseSideOrientation),this.mReflector=BABYLON.MeshBuilder.CreatePlane("reflector-mesh",{width:20,height:20},this.getRenderer().getScene()),this.mReflector.renderingGroupId=this.mSceneEntity.renderOrder,this.mReflector.material=this.mReflectorMaterial,this.mReflector.parent=e,this.mReflector.metadata={scene_entity_id:this.mSceneEntity.id},this.updateRenderlist(),this.mRenderObject=e}}]);var r}(Vd);function Lv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lv=function(){return!!e})()}function jv(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Uv=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Lv()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mEquirectMaterial",void 0),(0,c.A)(e,"mTextureId",void 0),(0,c.A)(e,"mHandle",void 0),(0,c.A)(e,"mActiveLoader",void 0),(0,c.A)(e,"mActiveTexture",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(a=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.abrupt("return",this.updateTexture());case 2:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mTextureId=e.getTextureId(),this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder)}},{key:"onUpdateDirty",value:function(){jv(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.updateTexture().then((function(){}),(function(){}))}},{key:"updateHandle",value:function(){if(this.mHandle&&this.mHandle.id===this.mTextureId)return!1;var e=en.J.getManager(en.n.TextureManager);return this.mHandle&&(e.disposeResource(this.mHandle.handle),delete this.mHandle),!!this.mTextureId&&(this.mHandle={id:this.mTextureId,handle:e.makeResource(this.mTextureId)},!0)}},{key:"updateTexture",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.updateHandle()){e.next=2;break}return e.abrupt("return");case 2:if(!this.mActiveLoader||!this.mActiveLoader.getHandle().validateHandle(this.mHandle.handle)){e.next=4;break}return e.abrupt("return");case 4:return this.mActiveLoader&&(this.mActiveLoader.dispose(),delete this.mActiveLoader),this.mActiveLoader=new zd(this.mHandle.handle,en.n.TextureManager),e.next=8,this.mActiveLoader.load();case 8:this.mActiveTexture=e.sent,this.mActiveTexture.getInternalTexture().coordinatesMode=BABYLON.Texture.EQUIRECTANGULAR_MODE,this.applyTextures();case 11:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"applyTextures",value:function(){this.mEquirectMaterial&&(this.mEquirectMaterial.reflectionTexture=this.mActiveTexture.getInternalTexture())}},{key:"createRenderObject",value:function(){var e=this.getRenderer().getScene(),t=BABYLON.MeshBuilder.CreateBox("hdrSkyBox",{size:1e3},e);t.renderingGroupId=this.mSceneEntity.renderOrder,this.mEquirectMaterial=new BABYLON.PBRMaterial("skyBox",e),this.mEquirectMaterial.backFaceCulling=!1,this.mEquirectMaterial.microSurface=1,this.mEquirectMaterial.disableLighting=!0,this.applyTextures(),t.material=this.mEquirectMaterial,t.infiniteDistance=!0,this.mRenderObject=t}},{key:"dispose",value:function(){jv(t,"dispose",this,3)([]);var e=en.J.getManager(en.n.TextureManager);this.mHandle&&e.disposeResource(this.mHandle.handle),this.mActiveLoader&&this.mActiveLoader.dispose()}}]);var r,a}(Vd);function Vv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vv=function(){return!!e})()}function zv(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Hv=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Vv()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mReceiveShadow",!1),(0,c.A)(e,"mMaterials",[]),(0,c.A)(e,"mFakeLight",void 0),(0,c.A)(e,"mWaterMesh",void 0),(0,c.A)(e,"mWaterMaterial",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(a=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.prev=1,e.next=4,this.loadTextures();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),v.UX.warn("Failed to load water textures:",e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mReceiveShadow=e.receiveShadow,this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder)}},{key:"loadTextures",value:(r=(0,n.A)(i().mark((function e(){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){if(++t.sTextures.revision>1)return e();var r=n.getRenderer().getScene();t.sTextures.textures=[new BABYLON.Texture("".concat(et.w.assetsUrl,"system/textures/waternormals.jpg"),r)],BABYLON.Texture.WhenAllReady(t.sTextures.textures,(function(){e()}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"disposeTextures",value:function(){--t.sTextures.revision>0||(t.sTextures.revision=0,t.sTextures.textures.splice(0).forEach((function(e){e.dispose()})))}},{key:"onUpdateDirty",value:function(){zv(t,"onUpdateDirty",this,3)([]),this.updateRenderList()}},{key:"updateRenderList",value:function(){var e=this;if(this.mWaterMaterial){var t=this.getRenderer().getScene().meshes.filter((function(t){var n,r=null===(n=e.getRenderer().getEntityFromObject(t))||void 0===n?void 0:n.layers;return!r||!r.isEnabled(1)&&!r.isEnabled(2)&&!r.isEnabled(7)}));this.mWaterMaterial.reflectionTexture.renderList=t,this.mWaterMaterial.refractionTexture.renderList=t}}},{key:"createRenderObject",value:function(){var e=this.getRenderer().getScene(),n=new BABYLON.Mesh("water-group",e);n.renderingGroupId=this.mSceneEntity.renderOrder,n.isVisible=!0,n.metadata={scene_entity_id:this.mSceneEntity.id},this.mWaterMaterial=new BABYLON.WaterMaterial("water-material",e,new BABYLON.Vector2(1024,1024)),this.mWaterMaterial.backFaceCulling=!0,this.mWaterMaterial.bumpTexture=t.sTextures.textures[0],this.mWaterMaterial.windForce=-5,this.mWaterMaterial.waveHeight=.01,this.mWaterMaterial.bumpHeight=.5,this.mWaterMaterial.waveLength=.25,this.mWaterMaterial.colorBlendFactor=.05,this.mWaterMaterial.colorBlendFactor2=.05,this.mWaterMaterial.waterColor=new BABYLON.Color3(.1,.1,.6),this.mWaterMaterial.waterColor2=new BABYLON.Color3(.5,.5,.9),this.mWaterMaterial.windDirection=new BABYLON.Vector2(1,1),this.mWaterMaterial.specularColor=new BABYLON.Color3(0,0,0),this.mWaterMaterial.specularPower=64,this.mWaterMaterial.maxSimultaneousLights=12,this.mWaterMaterial.bumpAffectsReflection=!0,this.mWaterMaterial.fresnelSeparate=!1,this.mMaterials.push(this.mWaterMaterial),this.mWaterMaterial.reflectionTexture.clearColor=new BABYLON.Color4(.831,.945,.976),this.mWaterMaterial.refractionTexture.clearColor=new BABYLON.Color4(.831,.945,.976),this.mWaterMesh=BABYLON.MeshBuilder.CreateGround("water-mesh",{width:20,height:20,subdivisions:32,updatable:!1},e),this.mWaterMesh.renderingGroupId=this.mSceneEntity.renderOrder,this.mWaterMesh.isVisible=!0,this.mWaterMesh.material=this.mWaterMaterial,this.mWaterMesh.receiveShadows=this.mReceiveShadow,this.mWaterMesh.metadata={scene_entity_id:this.mSceneEntity.id},this.mWaterMesh.parent=n,this.mWaterMesh.render(this.mWaterMesh.subMeshes[0],!0,void 0),this.mFakeLight=new BABYLON.HemisphericLight("fake-water-light",new BABYLON.Vector3(0,-1,0),e),this.mFakeLight.diffuse.set(0,0,0),this.mFakeLight.groundColor.set(0,0,0),this.mFakeLight.specular.set(0,0,0),this.mFakeLight.intensity=0,this.mFakeLight.parent=n,this.mRenderObject=n,this.updateRenderList()}},{key:"disposeMaterials",value:function(){this.mMaterials.splice(0).forEach((function(e){e.dispose()})),delete this.mWaterMaterial}},{key:"dispose",value:function(){zv(t,"dispose",this,3)([]),this.disposeMaterials(),this.disposeTextures(),this.mFakeLight.dispose(),delete this.mWaterMesh}}]);var r,a}(Vd);function Gv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gv=function(){return!!e})()}function qv(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Hv,"sTextures",{revision:0,textures:[]});var Wv=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Gv()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mReceiveShadow",!1),(0,c.A)(e,"mCastShadow",!1),(0,c.A)(e,"mPointA",te.P.Left()),(0,c.A)(e,"mPointB",te.P.Right()),(0,c.A)(e,"mSpriteOffset",te.P.One()),(0,c.A)(e,"mMarkerA",void 0),(0,c.A)(e,"mMarkerB",void 0),(0,c.A)(e,"mMarkerMaterial",void 0),(0,c.A)(e,"mLineOptions",void 0),(0,c.A)(e,"mLineMaterial",void 0),(0,c.A)(e,"mLineMesh",void 0),(0,c.A)(e,"mLineColor",Ft.v.Black()),(0,c.A)(e,"mLabel",{title:"",color:Ft.v.Black(),fontSize:16,spriteScale:1}),(0,c.A)(e,"mTextPlane",void 0),(0,c.A)(e,"mTextGui",void 0),(0,c.A)(e,"mTextTexture",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow,this.mPointA.copy(e.pointA),this.mPointB.copy(e.pointB),this.mRenderer.isRightHandedSystemActive()||(this.mPointA.toggleCoordSystem(),this.mPointB.toggleCoordSystem()),this.mSpriteOffset.copy(e.spriteOffset),this.mLineColor.copy(e.lineColor),this.mLabel.title=e.labelText,this.mLabel.color.copy(e.labelColor),this.mLabel.fontSize=e.labelFontSize,this.mLabel.spriteScale=e.labelSpriteScale}},{key:"onUpdateDirty",value:function(){qv(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mMarkerA.receiveShadows=!1,this.mLineMesh.receiveShadows=!1,this.mMarkerA.metadata.cast_shadow=this.mCastShadow,this.mMarkerB.metadata.cast_shadow=this.mCastShadow,this.mLineMesh.metadata.cast_shadow=this.mCastShadow,this.mTextGui.text=this.mLabel.title,this.mTextGui.color=this.mLabel.color.getHexString();var e=this.getTextPosition();this.mTextPlane.position=new BABYLON.Vector3(e.x,e.y,e.z),this.updateLine(),this.computeTextTextureDimensions()}},{key:"getTextPosition",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.mPointA.clone().add(this.mPointB.clone().sub(this.mPointA).normalize().multiplyScalar(.5*this.mPointB.distanceTo(this.mPointA))).add(e?this.mSpriteOffset:new te.P)}},{key:"makeTextNode",value:function(e){this.mTextPlane=BABYLON.MeshBuilder.CreatePlane("primitive-line-text-plane",{size:1},this.getRenderer().getScene()),this.mTextPlane.renderingGroupId=this.mSceneEntity.renderOrder;var t=this.getTextPosition();this.mTextPlane.position=new BABYLON.Vector3(t.x,t.y,t.z),this.mTextPlane.parent=e,this.mTextTexture=BABYLON.GUI.AdvancedDynamicTexture.CreateForMesh(this.mTextPlane),this.mTextGui=new BABYLON.GUI.TextBlock("primitive-line-text-block"),this.mTextGui.text=this.mLabel.title,this.mTextGui.color=this.mLabel.color.getHexString(),this.mTextGui.fontSize=this.mLabel.fontSize,this.mTextGui.resizeToFit=!1,this.mTextGui.textHorizontalAlignment=BABYLON.GUI.TextBlock.HORIZONTAL_ALIGNMENT_CENTER,this.mTextGui.textVerticalAlignment=BABYLON.GUI.TextBlock.VERTICAL_ALIGNMENT_CENTER,this.mTextTexture.addControl(this.mTextGui),this.computeTextTextureDimensions()}},{key:"updateLine",value:function(){this.mMarkerA&&this.mMarkerB&&this.mLineMesh&&(this.mMarkerA.position.set(this.mPointA.x,this.mPointA.y,this.mPointA.z),this.mMarkerB.position.set(this.mPointB.x,this.mPointB.y,this.mPointB.z),this.mLineOptions.points=[new BABYLON.Vector3(this.mPointA.x,this.mPointA.y,this.mPointA.z),new BABYLON.Vector3(this.mPointB.x,this.mPointB.y,this.mPointB.z)],this.mLineOptions.colors=[new BABYLON.Color4(this.mLineColor.r,this.mLineColor.g,this.mLineColor.b,1),new BABYLON.Color4(this.mLineColor.r,this.mLineColor.g,this.mLineColor.b,1)],this.mLineOptions.instance=this.mLineMesh,BABYLON.LinesBuilder.CreateLines("$__xpv_line",this.mLineOptions,this.getRenderer().getScene()))}},{key:"computeTextTextureDimensions",value:function(){var e=this.mLabel.fontSize||16,t=[this.mLabel.title],n=0,r=.15,i=0;n*=e,r*=e,i*=e;var o,s=t.length,u=e+r,c=n+i/2,l=(s?((o=document.createElement("canvas").getContext("2d")).font="Arial, Helvetica, sans-serif",Math.max.apply(Math,(0,a.A)(t.map((function(e){return o.measureText(e).width}))))):0)+2*c,h=(s?e+u*(s-1):0)+2*c,f=l/h;this.mTextTexture.idealWidth=l*this.mLabel.spriteScale,this.mTextTexture.idealHeight=h,this.mTextPlane.scaling.set(f*this.mLabel.spriteScale*.3333,f*this.mLabel.spriteScale*.3333,f*this.mLabel.spriteScale*.3333)}},{key:"createLineMesh",value:function(e){this.mLineOptions={points:[new BABYLON.Vector3(this.mPointA.x,this.mPointA.y,this.mPointA.z),new BABYLON.Vector3(this.mPointB.x,this.mPointB.y,this.mPointB.z)],colors:[new BABYLON.Color4(this.mLineColor.r,this.mLineColor.g,this.mLineColor.b,1),new BABYLON.Color4(this.mLineColor.r,this.mLineColor.g,this.mLineColor.b,1)],updatable:!0},this.mLineMaterial=new BABYLON.StandardMaterial("lineMaterial",this.getRenderer().getScene()),this.mLineMaterial.diffuseColor.set(this.mLineColor.r,this.mLineColor.g,this.mLineColor.b),this.mLineMaterial.maxSimultaneousLights=12,this.mLineMaterial.backFaceCulling=!1,this.mLineMesh=BABYLON.MeshBuilder.CreateLines("$__xpv_line",this.mLineOptions,this.getRenderer().getScene()),this.mLineMesh.renderingGroupId=this.mSceneEntity.renderOrder,this.mLineMesh.metadata={},this.mLineMesh.material=this.mLineMaterial,this.mLineMesh.parent=e}},{key:"createMarkers",value:function(e){this.mMarkerMaterial=new BABYLON.StandardMaterial("markerMaterial",this.getRenderer().getScene()),this.mMarkerMaterial.maxSimultaneousLights=12,this.mMarkerMaterial.diffuseColor.set(this.mLineColor.r,this.mLineColor.g,this.mLineColor.b),this.mMarkerA=BABYLON.MeshBuilder.CreateSphere("$__xpv_line_marker_a",{segments:32,diameter:.006,updatable:!1,sideOrientation:BABYLON.Mesh.FRONTSIDE},this.getRenderer().getScene()),this.mMarkerA.renderingGroupId=this.mSceneEntity.renderOrder,this.mMarkerA.metadata={},this.mMarkerA.material=this.mMarkerMaterial,this.mMarkerA.position.set(this.mPointA.x,this.mPointA.y,this.mPointA.z),this.mMarkerA.parent=e,this.mMarkerB=this.mMarkerA.createInstance("$__xpv_line_marker_b"),this.mMarkerB.renderingGroupId=this.mSceneEntity.renderOrder,this.mMarkerB.metadata={},this.mMarkerB.position.set(this.mPointB.x,this.mPointB.y,this.mPointB.z),this.mMarkerB.parent=e}},{key:"createRenderObject",value:function(){var e=new BABYLON.TransformNode("line_group",this.getRenderer().getScene());this.createMarkers(e),this.createLineMesh(e),this.makeTextNode(e),this.mRenderObject=e}},{key:"update",value:function(e){qv(t,"update",this,3)([e]);var n=this.mRenderer.getActiveCamera();this.mTextPlane.rotationQuaternion=n.absoluteRotation}},{key:"dispose",value:function(){this.mMarkerA.dispose(),this.mMarkerB.dispose(),this.mLineMesh.dispose(),this.mLineMaterial.dispose(),this.mMarkerMaterial.dispose(),this.mTextPlane.dispose(),this.mTextGui.dispose(),this.mTextTexture.dispose(),qv(t,"dispose",this,3)([])}},{key:"updateBoundingBox",value:function(){var e=this.mMarkerA.getBoundingInfo().boundingBox,n=this.mMarkerB.getBoundingInfo().boundingBox,r=new Os.N;r.union(new Os.N(new te.P(e.minimum.x,e.minimum.y,e.minimum.z),new te.P(e.maximum.x,e.maximum.y,e.maximum.z))),r.union(new Os.N(new te.P(n.minimum.x,n.minimum.y,n.minimum.z),new te.P(n.maximum.x,n.maximum.y,n.maximum.z))),this.mBoundingBox.copy(r),qv(t,"updateBoundingBox",this,3)([])}}]);var r}(Vd);function Kv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kv=function(){return!!e})()}function Xv(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Yv=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Kv()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mCastShadow",!1),(0,c.A)(e,"mReceiveShadow",!1),(0,c.A)(e,"mOnBeforeRenderObserver",void 0),(0,c.A)(e,"mOnAfterRenderObserver",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.getValue("cast_shadow"),this.mReceiveShadow=e.getValue("receive_shadow"),this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder)}},{key:"onUpdateDirty",value:function(){Xv(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mRenderObject.receiveShadows=this.mReceiveShadow,this.mRenderObject.metadata||(this.mRenderObject.metadata={}),this.mRenderObject.metadata.cast_shadow=this.mCastShadow}},{key:"createRenderObject",value:function(){var e=this,t=this.getRenderer().getScene(),n=BABYLON.MeshBuilder.CreateBox("box",{size:1,updatable:!1,sideOrientation:BABYLON.Mesh.FRONTSIDE},t);n.renderingGroupId=this.mSceneEntity.renderOrder,this.mRenderer.isRightHandedSystemActive()&&n.toLeftHanded();var r=new BABYLON.SimpleMaterial("primitive-box-mat",t);r.diffuseColor=BABYLON.Color3.FromHexString("#F3F3F3"),r.maxSimultaneousLights=12,n.material=r,this.mOnBeforeRenderObserver=n.onBeforeRenderObservable.add((function(){e.getRenderer().onBeforeMeshRender(n,e.mSceneEntity)})),this.mOnAfterRenderObserver=n.onAfterRenderObservable.add((function(){e.getRenderer().onAfterMeshRender(n,e.mSceneEntity)})),this.mRenderObject=n}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject.getBoundingInfo(),n=[],r=[];e.boundingBox.minimum.toArray(n),e.boundingBox.maximum.toArray(r);var i=(new te.P).fromArray(n),a=(new te.P).fromArray(r);this.mBoundingBox.copy(new Os.N(i,a)),Xv(t,"updateBoundingBox",this,3)([])}},{key:"destroyRenderObject",value:function(){var e=this.mRenderObject;e&&(e.onBeforeRenderObservable.remove(this.mOnBeforeRenderObserver),e.onAfterRenderObservable.remove(this.mOnAfterRenderObserver)),Xv(t,"destroyRenderObject",this,3)([])}}]);var r}(Vd);function $v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($v=function(){return!!e})()}function Zv(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Qv=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,$v()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mCastShadow",!1),(0,c.A)(e,"mReceiveShadow",!1),(0,c.A)(e,"mOnBeforeRenderObserver",void 0),(0,c.A)(e,"mOnAfterRenderObserver",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow,this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder)}},{key:"onUpdateDirty",value:function(){Zv(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mRenderObject.receiveShadows=!1,this.mRenderObject.metadata||(this.mRenderObject.metadata={}),this.mRenderObject.metadata.cast_shadow=this.mCastShadow}},{key:"createRenderObject",value:function(){var e=this,t=this.getRenderer().getScene(),n=BABYLON.MeshBuilder.CreatePlane("plane",{size:2,updatable:!1,sideOrientation:BABYLON.Mesh.FRONTSIDE},t);n.renderingGroupId=this.mSceneEntity.renderOrder,this.mRenderer.isRightHandedSystemActive()&&n.toLeftHanded();var r=new BABYLON.SimpleMaterial("primitive-plane-mat",t);r.diffuseColor=BABYLON.Color3.FromHexString("#F3F3F3"),r.maxSimultaneousLights=12,n.material=r,this.mOnBeforeRenderObserver=n.onBeforeRenderObservable.add((function(){e.getRenderer().onBeforeMeshRender(n,e.mSceneEntity)})),this.mOnAfterRenderObserver=n.onAfterRenderObservable.add((function(){e.getRenderer().onAfterMeshRender(n,e.mSceneEntity)})),this.mRenderObject=n}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject.getBoundingInfo(),n=[],r=[];e.boundingBox.minimum.toArray(n),e.boundingBox.maximum.toArray(r);var i=(new te.P).fromArray(n),a=(new te.P).fromArray(r);this.mBoundingBox.copy(new Os.N(i,a)),Zv(t,"updateBoundingBox",this,3)([])}},{key:"destroyRenderObject",value:function(){var e=this.mRenderObject;e&&(e.onBeforeRenderObservable.remove(this.mOnBeforeRenderObserver),e.onAfterRenderObservable.remove(this.mOnAfterRenderObserver)),Zv(t,"destroyRenderObject",this,3)([])}}]);var r}(Vd);function Jv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jv=function(){return!!e})()}function ey(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var ty=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Jv()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mCastShadow",!1),(0,c.A)(e,"mReceiveShadow",!1),(0,c.A)(e,"mOnBeforeRenderObserver",void 0),(0,c.A)(e,"mOnAfterRenderObserver",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow,this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder)}},{key:"onUpdateDirty",value:function(){ey(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mRenderObject.receiveShadows=!1,this.mRenderObject.metadata||(this.mRenderObject.metadata={}),this.mRenderObject.metadata.cast_shadow=this.mCastShadow}},{key:"createRenderObject",value:function(){var e=this,t=this.getRenderer().getScene(),n=BABYLON.MeshBuilder.CreateSphere("sphere",{segments:64,diameter:1,updatable:!1,sideOrientation:BABYLON.Mesh.FRONTSIDE},t);n.renderingGroupId=this.mSceneEntity.renderOrder,this.mRenderer.isRightHandedSystemActive()&&n.toLeftHanded();var r=new BABYLON.SimpleMaterial("primitive-sphere-mat",t);r.diffuseColor=BABYLON.Color3.FromHexString("#F3F3F3"),r.maxSimultaneousLights=12,n.material=r,this.mOnBeforeRenderObserver=n.onBeforeRenderObservable.add((function(){e.getRenderer().onBeforeMeshRender(n,e.mSceneEntity)})),this.mOnAfterRenderObserver=n.onAfterRenderObservable.add((function(){e.getRenderer().onAfterMeshRender(n,e.mSceneEntity)})),this.mRenderObject=n}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject.getBoundingInfo(),n=[],r=[];e.boundingBox.minimum.toArray(n),e.boundingBox.maximum.toArray(r);var i=(new te.P).fromArray(n),a=(new te.P).fromArray(r);this.mBoundingBox.copy(new Os.N(i,a)),ey(t,"updateBoundingBox",this,3)([])}},{key:"destroyRenderObject",value:function(){var e=this.mRenderObject;e&&(e.onBeforeRenderObservable.remove(this.mOnBeforeRenderObserver),e.onAfterRenderObservable.remove(this.mOnAfterRenderObserver)),ey(t,"destroyRenderObject",this,3)([])}}]);var r}(Vd);function ny(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ny=function(){return!!e})()}var ry=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,ny()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mColor",Ft.v.White()),(0,c.A)(e,"mIntensity",1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mColor.copy(e.color),this.mIntensity=e.intensity}},{key:"applyProperties",value:function(){this.mRenderObject&&(this.mRenderObject.diffuse.set(this.mColor.r,this.mColor.g,this.mColor.b),this.mRenderObject.groundColor.set(this.mColor.r,this.mColor.g,this.mColor.b),this.mRenderObject.intensity=this.mIntensity,this.mRenderObject.falloffType=BABYLON.Light.FALLOFF_DEFAULT,this.mRenderObject.intensityMode=BABYLON.Light.INTENSITYMODE_AUTOMATIC,this.mRenderObject.lightmapMode=BABYLON.Light.LIGHTMAP_DEFAULT)}},{key:"onUpdateDirty",value:function(){var e,n,r,i,a;(e=t,n="onUpdateDirty",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties(),this.applyProperties()}},{key:"createRenderObject",value:function(){var e=new BABYLON.HemisphericLight("AmbientLight",new BABYLON.Vector3(0,1,0),this.getRenderer().getScene());this.mRenderObject=e,this.applyProperties()}}]);var r}(Vd);function iy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(iy=function(){return!!e})()}function ay(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var oy=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,iy()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mCastShadow",!1),(0,c.A)(e,"mShadowGenerator",void 0),(0,c.A)(e,"mShadowBias",0),(0,c.A)(e,"mShadowCameraNear",1e-4),(0,c.A)(e,"mShadowCameraFar",1e3),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){this.mCastShadow=this.mSceneEntity.getValue("cast_shadow"),this.mShadowBias=this.mSceneEntity.getValue("shadow_bias"),this.mShadowCameraNear=this.mSceneEntity.getValue("shadow_camera_near"),this.mShadowCameraFar=this.mSceneEntity.getValue("shadow_camera_far")}},{key:"update",value:function(e){ay(t,"update",this,3)([e]),this.updateShadowMap()}},{key:"applyProperties",value:function(){this.mShadowGenerator&&(this.mShadowGenerator.bias=this.mShadowBias,this.mRenderObject&&(this.mRenderObject.shadowMinZ=this.mShadowCameraNear,this.mRenderObject.shadowMaxZ=this.mShadowCameraFar))}},{key:"onUpdateDirty",value:function(){ay(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.applyProperties()}},{key:"updateShadowMap",value:function(){var e=this;if(this.mCastShadow){if(this.mCastShadow&&!this.mShadowGenerator&&this.createShadowGenerator(this.mRenderObject),this.mShadowGenerator){var t=f.V.uuidV4();this.getRenderer().getScene().meshes.forEach((function(n){n.metadata&&(n.metadata.shadow_render_loop_id=t,e.mShadowGenerator.getShadowMap().renderList.find((function(e){return e.uniqueId===n.uniqueId}))?n.metadata.cast_shadow||(e.resetRefreshCounter(),e.mShadowGenerator.removeShadowCaster(n,!0)):n.metadata.cast_shadow&&(e.resetRefreshCounter(),e.mShadowGenerator.addShadowCaster(n,!0)))})),this.mShadowGenerator.getShadowMap().renderList.forEach((function(n){n.metadata.shadow_render_loop_id!==t&&(e.resetRefreshCounter(),e.mShadowGenerator.removeShadowCaster(n,!0))}))}}else this.destroyShadowGenerator()}},{key:"resetRefreshCounter",value:function(){this.mShadowGenerator&&this.mShadowGenerator.getShadowMap().resetRefreshCounter()}},{key:"createShadowGenerator",value:function(e){this.mCastShadow&&!this.mShadowGenerator&&(this.mShadowGenerator=this.getRenderer().createShadowGenerator(1024,e))}},{key:"destroyShadowGenerator",value:function(){this.mShadowGenerator&&(this.getRenderer().disposeShadowGenerator(this.mShadowGenerator),delete this.mShadowGenerator)}},{key:"createRenderObject",value:function(){this.mRenderObject?this.createShadowGenerator(this.mRenderObject):v.UX.error("Shadow draw technique created before mRenderObject is set.")}},{key:"destroyRenderObject",value:function(){this.destroyShadowGenerator(),ay(t,"destroyRenderObject",this,3)([])}}]);var r}(Vd);function sy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(sy=function(){return!!e})()}function uy(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var cy=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,sy()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mColor",Ft.v.White()),(0,c.A)(e,"mTarget",te.P.Zero()),(0,c.A)(e,"mIntensity",1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,uy(t,"loadResource",this,3)([]);case 2:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){uy(t,"updateProperties",this,3)([]);var e=this.mSceneEntity;this.mColor.copy(e.color),this.mTarget.copy(e.target),this.mIntensity=e.intensity}},{key:"applyProperties",value:function(){if(uy(t,"applyProperties",this,3)([]),this.mRenderObject){var e=this.mSceneEntity.transform.position.clone(),n=this.mTarget.clone();this.mRenderer.isRightHandedSystemActive()||(e.toggleCoordSystem(),n.toggleCoordSystem()),this.mRenderObject.position.set(e.x,e.y,e.z),this.mRenderObject.intensity=this.mIntensity,this.mRenderObject.diffuse.set(this.mColor.r,this.mColor.g,this.mColor.b),this.mRenderObject.setDirectionToTarget(new BABYLON.Vector3(n.x,n.y,n.z)),this.mRenderObject.autoCalcShadowZBounds=!0,this.mRenderObject.autoUpdateExtends=!0,this.mRenderObject.falloffType=BABYLON.Light.FALLOFF_DEFAULT,this.mRenderObject.intensityMode=BABYLON.Light.INTENSITYMODE_AUTOMATIC,this.mRenderObject.lightmapMode=BABYLON.Light.LIGHTMAP_DEFAULT}}},{key:"createRenderObject",value:function(){var e=new BABYLON.DirectionalLight("DirectionalLight",new BABYLON.Vector3(0,0,0),this.getRenderer().getScene());this.mRenderObject=e,uy(t,"createRenderObject",this,3)([]),this.applyProperties()}}]);var r}(oy);function ly(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ly=function(){return!!e})()}var hy=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,ly()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mColor",Ft.v.White()),(0,c.A)(e,"mGroundColor",Ft.v.White()),(0,c.A)(e,"mIntensity",1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mColor.copy(e.color),this.mGroundColor.copy(e.groundColor),this.mIntensity=e.intensity}},{key:"applyProperties",value:function(){this.mRenderObject&&(this.mRenderObject.diffuse.set(this.mColor.r,this.mColor.g,this.mColor.b),this.mRenderObject.groundColor.set(this.mGroundColor.r,this.mGroundColor.g,this.mGroundColor.b),this.mRenderObject.specular.set(0,0,0),this.mRenderObject.intensity=this.mIntensity,this.mRenderObject.direction.set(0,1,0),this.mRenderObject.falloffType=BABYLON.Light.FALLOFF_DEFAULT,this.mRenderObject.intensityMode=BABYLON.Light.INTENSITYMODE_AUTOMATIC,this.mRenderObject.lightmapMode=BABYLON.Light.LIGHTMAP_DEFAULT)}},{key:"onUpdateDirty",value:function(){var e,n,r,i,a;(e=t,n="onUpdateDirty",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties(),this.applyProperties()}},{key:"createRenderObject",value:function(){var e=new BABYLON.HemisphericLight("HemisphereLight",new BABYLON.Vector3(0,0,0),this.getRenderer().getScene());this.mRenderObject=e,this.applyProperties()}}]);var r}(Vd);function fy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fy=function(){return!!e})()}function my(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var py=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,fy()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mColor",Ft.v.White()),(0,c.A)(e,"mDistance",0),(0,c.A)(e,"mDecay",1),(0,c.A)(e,"mIntensity",1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,my(t,"loadResource",this,3)([]);case 2:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){my(t,"updateProperties",this,3)([]);var e=this.mSceneEntity;this.mColor.copy(e.color),this.mDistance=e.distance,this.mDecay=e.decay,this.mIntensity=e.intensity}},{key:"applyProperties",value:function(){if(my(t,"applyProperties",this,3)([]),this.mRenderObject){var e=this.mSceneEntity.transform.position.clone();this.mRenderer.isRightHandedSystemActive()||e.toggleCoordSystem(),this.mRenderObject.position.set(e.x,e.y,e.z),this.mRenderObject.intensity=this.mIntensity,this.mRenderObject.diffuse.set(this.mColor.r,this.mColor.g,this.mColor.b),this.mRenderObject.range=this.mDistance<=0?1/0:this.mDistance,this.mRenderObject.falloffType=BABYLON.Light.FALLOFF_DEFAULT,this.mRenderObject.intensityMode=BABYLON.Light.INTENSITYMODE_AUTOMATIC,this.mRenderObject.lightmapMode=BABYLON.Light.LIGHTMAP_DEFAULT}}},{key:"createRenderObject",value:function(){var e=new BABYLON.PointLight("PointLight",new BABYLON.Vector3(1,10,1),this.getRenderer().getScene());this.mRenderObject=e,my(t,"createRenderObject",this,3)([]),this.applyProperties()}}]);var r}(oy);function dy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dy=function(){return!!e})()}function vy(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var yy=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,dy()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mColor",Ft.v.White()),(0,c.A)(e,"mTarget",te.P.Zero()),(0,c.A)(e,"mDistance",0),(0,c.A)(e,"mAngle",.1*Math.PI),(0,c.A)(e,"mPenumbra",0),(0,c.A)(e,"mDecay",1),(0,c.A)(e,"mIntensity",1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,vy(t,"loadResource",this,3)([]);case 2:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){vy(t,"updateProperties",this,3)([]);var e=this.mSceneEntity;this.mColor.copy(e.color),this.mTarget.copy(e.target),this.mDistance=e.distance,this.mDecay=e.decay,this.mAngle=e.angle,this.mPenumbra=e.penumbra,this.mIntensity=e.intensity}},{key:"applyProperties",value:function(){if(vy(t,"applyProperties",this,3)([]),this.mRenderObject){var e=this.mSceneEntity.transform.position.clone();this.mRenderer.isRightHandedSystemActive()||e.toggleCoordSystem(),this.mRenderObject.position.set(e.x,e.y,e.z),this.mRenderObject.intensity=this.mIntensity,this.mRenderObject.diffuse.set(this.mColor.r,this.mColor.g,this.mColor.b),this.mRenderObject.range=this.mDistance<=0?Number.MAX_VALUE:this.mDistance,this.mRenderObject.angle=2*this.mAngle,this.mRenderObject.setDirectionToTarget(new BABYLON.Vector3(this.mTarget.x,this.mTarget.y,this.mTarget.z)),this.mRenderObject.falloffType=BABYLON.Light.FALLOFF_DEFAULT,this.mRenderObject.intensityMode=BABYLON.Light.INTENSITYMODE_AUTOMATIC,this.mRenderObject.lightmapMode=BABYLON.Light.LIGHTMAP_DEFAULT}}},{key:"createRenderObject",value:function(){var e=new BABYLON.SpotLight("SpotLight",new BABYLON.Vector3(0,0,0),new BABYLON.Vector3(0,-1,0),this.mAngle,0,this.getRenderer().getScene());this.mRenderObject=e,vy(t,"createRenderObject",this,3)([]),this.applyProperties()}}]);var r}(oy);function gy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gy=function(){return!!e})()}var by=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,gy()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"onEdit",new M.B),(0,c.A)(r,"userData",{}),(0,c.A)(r,"uiRenderer",void 0),(0,c.A)(r,"domElement",void 0),(0,c.A)(r,"mPositionType",Sl.FIXED),(0,c.A)(r,"mPosition",new te.P),(0,c.A)(r,"mLocked",!1),(0,c.A)(r,"mEditting",!1),(0,c.A)(r,"mVisible",!0),(0,c.A)(r,"mSceneObject",void 0),(0,c.A)(r,"mSubscriptions",[]),r.uiRenderer=n,r.mSceneObject=e,r.domElement=document.createElement("div"),r.domElement.style.position="absolute",r.domElement.style.top="0px",r.domElement.style.left="0px",r.domElement.addEventListener("click",(function(){r.uiRenderer.onUiSelected.next(r.getSceneObject())}),!1),r.mSubscriptions.push(r.onEdit.subscribe((function(e){r.getSceneObject().onEdit.next(e)}))),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"dispose",value:function(){this.domElement.parentNode&&this.domElement.parentNode.removeChild(this.domElement),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"getSceneObject",value:function(){return this.mSceneObject}},{key:"isObjectUI",get:function(){return!0}},{key:"update",value:function(e){var t=this.uiRenderer.getSize();if("projection"===this.mPositionType){var n=this.mPosition.clone(),r=e.transform.matrixWorld.clone().invert(),i=n.project(r,e.getProjectionMatrix());i.x=(i.x+1)/2*t.width,i.y=-(i.y-1)/2*t.height,i.x=i.x>t.width?t.width:i.x<0?0:i.x,i.y=i.y>t.height?t.height:i.y<0?0:i.y,this.domElement.style.left="".concat(i.x,"px"),this.domElement.style.top="".concat(i.y,"px")}}},{key:"setValue",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.proxySetValue(e,t,n);return r&&this.updateElement(),r}},{key:"getValue",value:function(e){return this.proxyGetValue(e)}},{key:"proxyGetValue",value:function(e){switch(e){case"position_type":return this.positionType;case"position":return this.position;case"locked":return this.locked}}},{key:"proxySetValue",value:function(e,t,n){switch(e){case"position_type":return this.positionType=t,!0;case"position":return this.position=t,!0;case"locked":return this.locked=t,!0}return!1}},{key:"position",get:function(){return this.mPosition},set:function(e){var t=e.toArray();this.mPosition.x=t[0],this.mPosition.y=t[1],t.length>2&&(this.mPosition.z=t[2]),this.domElement.style.top="".concat(this.mPosition.y,"px"),this.domElement.style.left="".concat(this.mPosition.x,"px")}},{key:"positionType",get:function(){return this.mPositionType},set:function(e){this.mPositionType=e}},{key:"element",get:function(){return this.domElement}},{key:"locked",get:function(){return this.mLocked},set:function(e){var t=this.mLocked;this.mLocked=e,t&&!e?this.makeEditable():!t&&e&&this.makeUnEditable()}},{key:"add",value:function(e){this.element.appendChild(e)}},{key:"remove",value:function(e){this.element.removeChild(e)}},{key:"hasParent",value:function(){return!!this.domElement.parentNode}},{key:"makeEditable",value:function(){var e=this;if(!this.hasParent())return!1;if(this.mEditting=!0,this.locked)return!1;if("undefined"!=typeof $){var t=$(this.domElement);void 0===t.draggable("instance")&&t.draggable({start:function(t,n){e.mPositionType!==Sl.PROJECTION&&e.onEdit.next({type:"drag",event:"start",data:n.position})},stop:function(t,n){e.mPositionType!==Sl.PROJECTION&&e.onEdit.next({type:"drag",event:"stop",data:n.position})},drag:function(t,n){e.mPositionType!==Sl.PROJECTION&&e.onEdit.next({type:"drag",event:"update",data:n.position})}})}var n=this.domElement.querySelector("#highlight_selected");return n||((n=document.createElement("div")).id="highlight_selected",n.style.width="100%",n.style.height="100%",n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.border="2px solid yellow",this.domElement.appendChild(n)),!0}},{key:"makeUnEditable",value:function(){if(this.mEditting=!1,this.hasParent()){if("undefined"!=typeof $){var e=$(this.domElement);void 0!==e.draggable("instance")&&e.draggable("destroy")}var t=this.domElement.querySelector("#highlight_selected");t&&t.remove()}}},{key:"visible",get:function(){return this.mVisible},set:function(e){this.mVisible=e,!this.mVisible&&this.mEditting&&this.makeUnEditable(),this.domElement.style.display=this.mVisible?"inline-block":"none"}}])}(nt.b);function Ay(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ay=function(){return!!e})()}function _y(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(by,"TypeRTTI",new le.O("UixObject",nt.b.TypeRTTI));var My=function(e){function t(e,n){var r,i,a,o,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Ay()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"onEvents",new M.B),(0,c.A)(r,"mTextElement",void 0),(0,c.A)(r,"mTagElement",void 0),(0,c.A)(r,"mOverlayElement",void 0),(0,c.A)(r,"mTitle","A1"),(0,c.A)(r,"mColor",new Ft.v("#1f1e1e")),(0,c.A)(r,"mHoverColor",new Ft.v("#343232")),(0,c.A)(r,"mTextColor",Ft.v.White()),(0,c.A)(r,"mMargin",2),(0,c.A)(r,"mFontSize",10),(0,c.A)(r,"mHtmlText",""),(0,c.A)(r,"mPositionIteration",0),(0,c.A)(r,"mVisibilityHandle",void 0),(0,c.A)(r,"mPresenting",!1),(0,c.A)(r,"mTagVisibilityOwners",{}),(0,c.A)(r,"OVERLAY_TIMEOUT",300),u.title&&(r.mTitle=u.title),u.margin&&(r.mMargin=u.margin),u.color&&r.mColor.set(u.color),u.hover&&r.mHoverColor.set(u.hover),u.fontSize&&(r.mFontSize=u.fontSize),u.textColor&&r.mTextColor.set(u.textColor),u.htmlText&&(r.mHtmlText=u.htmlText),r._createTag(),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"title":return this.mTitle=n,!0;case"color":return this.mColor.set(n),!0;case"hover":return this.mHoverColor.set(n),!0;case"textColor":return this.mTextColor.set(n),!0;case"fontSize":return this.mFontSize=parseInt(n,10),!0;case"margin":return this.mMargin=n,!0;case"htmlText":return this.setHtmlText(n),!0}return _y(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){switch(e){case"title":return this.mTitle;case"color":return this.mColor.getHexString();case"hover":return this.mHoverColor.getHexString();case"textColor":return this.mTextColor.getHexString();case"fontSize":return this.mFontSize;case"margin":return this.mMargin;case"htmlText":return this.mHtmlText}return _y(t,"proxyGetValue",this,3)([e])}},{key:"update",value:function(e){if(this.mPresenting||_y(t,"update",this,3)([e]),"projection"===this.mPositionType){var n=this.mPosition.clone(),r=e.transform.matrixWorld.clone().invert(),i=n.project(r,e.getProjectionMatrix());this.updateScale(e,this.mPosition),this.hideOutOfScreen(e,i),this.updateOverlay()}}},{key:"updateScale",value:function(e,t){var n=new te.P;e.transform.getWorldPosition(n);var r=t.distanceTo(n);r=Math.max(r,.001),r=Math.pow(r,1.25);var i=e.far-e.near,a=Math.min(Math.max(i/r,.25),1);this.mTagElement.style.transform="scale(".concat(a,")")}},{key:"hideOutOfScreen",value:function(e,t){var n=this.uiRenderer.getSize(),r=t.clone();r.x=(r.x+1)/2*n.width,r.y=-(r.y-1)/2*n.height,this.mTagElement.style.visibility=r.x>n.width||r.x<0||r.y>n.height||r.y<0?"hidden":"visible"}},{key:"updateOverlay",value:function(){this.mOverlayElement&&(this.mOverlayElement.style.transform="translate(-".concat(this.domElement.style.left,"px, -").concat(this.domElement.style.top,")"))}},{key:"fadeInOut",value:function(){var e=this;window.clearTimeout(this.mVisibilityHandle),this.mVisibilityHandle=window.setTimeout((function(){e.showTag("movement"),e.mPositionIteration=0,delete e.mVisibilityHandle}),100)}},{key:"hideWhenInMovement",value:function(){this.isInSceneEditor()||(this.mPositionIteration++>50&&this.hideTag("movement"),this.fadeInOut())}},{key:"showTag",value:function(e){delete this.mTagVisibilityOwners[e],0===Object.keys(this.mTagVisibilityOwners).length&&(this.mTagElement.style.display="flex")}},{key:"hideTag",value:function(e){this.mTagVisibilityOwners[e]=!0,this.mTagElement.style.display="none"}},{key:"setHtmlText",value:function(e){this.mHtmlText=e,this.mOverlayElement&&(this.mOverlayElement.querySelector(".xpv-annotation-html").innerHTML=this.mHtmlText)}},{key:"_createTag",value:function(){var e=this;this.mTextElement=document.createElement("div"),this.mTextElement.setAttribute("data-ui-type","annotation-tag-title"),this.mTextElement.textContent=this.mTitle,this.mTextElement.style.cssText="\n            font-size: ".concat(this.mFontSize,"px;\n            position: absolute;\n            top: 0px;\n            left: 0px;\n            visibility: hidden;\n            display: block;\n            transform-origin: top left;\n        "),document.body.appendChild(this.mTextElement);var t=this.mTextElement.offsetHeight+1,n=this.mTextElement.offsetWidth+1+t+this.mMargin,r="".concat(n,"px");document.body.removeChild(this.mTextElement),this.mTextElement.style.position="relative",this.mTextElement.style.visibility="",this.mTextElement.style.display="",this.mTagElement=document.createElement("div"),this.mTagElement.setAttribute("data-ui-type","annotation-tag"),this.mTagElement.setAttribute("data-annotation-uuid",this.mSceneObject.uuid),this.mTagElement.style.cssText="\n            position: relative;\n            top: 0px;\n            left: 0px;\n            width: ".concat(r,";\n            height: ").concat(r,";\n            background-color: ").concat(this.mColor.getHexString(),";\n            color: ").concat(this.mTextColor.getHexString(),";\n            border-radius: 50%;\n            border: 3px solid white;\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            transform-origin: left top;\n            -ms-user-select: none;\n            -moz-user-select: none;\n            -webkit-user-select: none;\n            user-select: none;\n        "),this.mTagElement.appendChild(this.mTextElement),this.mTagElement.addEventListener("mouseover",(function(){e.mTagElement.style.backgroundColor=e.mHoverColor.getHexString()})),this.mTagElement.addEventListener("mouseout",(function(){e.mTagElement.style.backgroundColor=e.mColor.getHexString()})),this.mTagElement.addEventListener("click",(function(){v.UX.print("Annotation '".concat(e.mTitle,"' clicked!"),e.getObjectId()),e.showOverlay(),e.onEvents.next({name:"click",data:e.getObjectId()})})),this.domElement.appendChild(this.mTagElement)}},{key:"showOverlay",value:function(){var e=this;this.mPresenting||this.mEditting||this.isInSceneEditor()||(this.mPresenting=!0,this.hideTag("overlay"),window.setTimeout((function(){e.createTextOverlay()}),this.OVERLAY_TIMEOUT))}},{key:"hideOverlay",value:function(){this.mPresenting=!1,this.showTag("overlay"),this.mOverlayElement.parentNode.removeChild(this.mOverlayElement),delete this.mOverlayElement}},{key:"isInSceneEditor",value:function(){return R.K.stateRegistery().get(X.V.SCENE_EDITOR)}},{key:"createTextOverlay",value:function(){var e=this;this.mOverlayElement=document.createElement("div"),this.mOverlayElement.setAttribute("data-ui-type","annotation-text-overlay");var t=this.uiRenderer.getSize();this.mOverlayElement.style.cssText="\n            top: 0;\n            left: 0;\n            position: absolute;\n            width: ".concat(t.width,"px;\n            height: ").concat(t.height,"px;\n            background: linear-gradient(0deg, rgba(255, 255, 255, 0.44) 0%, rgba(199, 209, 225, 0.55) 40%, rgba(15, 35, 39, 0.64) 100%);\n            display: block;\n            padding: 1rem;\n            overflow-y: auto;\n            color: #ffffff;\n            font-size: 2rem;\n            transform: translate(-").concat(this.domElement.style.left,", -").concat(this.domElement.style.top,");\n            z-index: 2;\n        ");var n=document.createElement("div");n.classList.add("xpv-annotation-html"),n.style.cssText="\n            border-left: 2px solid white;\n            padding: 0.5rem;\n        ",n.innerHTML=this.mHtmlText,this.mOverlayElement.appendChild(n);var r=document.createElement("div");r.style.cssText="\n            margin: 1rem 0;\n            font-weight: bold;\n            font-size: large;\n            cursor: pointer;\n            display: inline-block;\n        ",r.innerHTML='\n            Back\n            <br/>\n            <span style="font-size: 32px;line-height: 18px;margin-left: -1px;">\n                &#129044;\n            </span>\n        ',r.onclick=function(){e.hideOverlay(),e.onEvents.next({name:"back",data:e.getObjectId()})},this.mOverlayElement.appendChild(r),this.domElement.appendChild(this.mOverlayElement)}},{key:"updateElement",value:function(){if(this.mTextElement&&this.mTagElement){this.mTextElement.style.fontSize="".concat(this.mFontSize,"px"),this.mTextElement.textContent=this.mTitle;var e=this.mTextElement.clientHeight+1,t=this.mTextElement.clientWidth+1+e+this.mMargin,n="".concat(t,"px");this.mTagElement.style.backgroundColor=this.mColor.getHexString(),this.mTagElement.style.color=this.mTextColor.getHexString(),this.mTagElement.style.width=n,this.mTagElement.style.height=n}}}])}(by);function ky(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ky=function(){return!!e})()}(0,c.A)(My,"TypeRTTI",new le.O("AnnotationUixObject",by.TypeRTTI));var wy=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,ky()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mRenderObject",void 0),(0,c.A)(e,"mEditable",!1),(0,c.A)(e,"mLocked",!1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"ready",get:function(){return this.mReady}},{key:"attached",get:function(){return this.mAttached}},{key:"attach",value:function(){if(!this.mRenderObject)throw new Error("Trying to attach undefined object to scene");var e=this.mRenderer.getUiRenderer(),t=this.mRenderObject;e.add(t.element),this.mAttached=!0}},{key:"detach",value:function(){if(this.mAttached){var e=this.mRenderer.getUiRenderer(),t=this.mRenderObject;e.remove(t.element),this.mAttached=!1}}},{key:"getRenderObject",value:function(){return this.mRenderObject}},{key:"update",value:function(){if(this.mRenderObject){this.mSceneEntity.needsRenderUpdate()&&(this.mSceneEntity.setNeedsRenderUpdate(!1),this.onUpdateDirty());var e=R.K.sceneManager().getActiveCamera();this.mRenderObject.update(e)}}},{key:"onUpdateDirty",value:function(){if(this.mRenderObject){this.mRenderObject.visible=this.mSceneEntity.getVisibility();var e=this.mSceneEntity.editable;e!==this.mEditable&&(this.mEditable=e,this.onEditable(this.mEditable));var t=this.mSceneEntity.locked;t!==this.mLocked&&(this.mLocked=t,this.onLocked(this.mLocked))}}},{key:"destroyRenderObject",value:function(){}},{key:"onEditable",value:function(e){e?this.mRenderObject.makeEditable():this.mRenderObject.makeUnEditable()}},{key:"onLocked",value:function(e){this.mRenderObject.locked=e}},{key:"getSceneEntity",value:function(){return this.mSceneEntity}}])}(Ld);function Ty(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ty=function(){return!!e})()}var xy=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Ty()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mPositionType",Sl.FIXED),(0,c.A)(r,"mPosition",new te.P),(0,c.A)(r,"mOptions",{}),(0,c.A)(r,"mViewportPosition",new te.P),(0,c.A)(r,"mViewportRotation",new re.O),(0,c.A)(r,"mSubscriptions",[]),(0,c.A)(r,"mPreviousCamera",void 0),r.mPreviousCamera=new yd.d,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mPositionType=e.getValue("position_type"),this.mOptions=e.getValue("options"),this.mPosition.copy(e.getValue("position")),this.mViewportPosition.copy(e.getValue("viewport_position")),this.mViewportRotation.copy(e.getValue("viewport_rotation"))}},{key:"applyProperties",value:function(){if(this.mRenderObject){this.mRenderObject.positionType=this.mPositionType,this.mRenderObject.position=this.mPosition.clone();for(var e=0,t=Object.entries(this.mOptions);e<t.length;e++){var n=(0,o.A)(t[e],2),r=n[0],i=n[1];this.mRenderObject.setValue(r,i)}}}},{key:"update",value:function(){var e,n,r,i,a;this.updateProperties(),this.applyProperties(),(e=t,n="update",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}},{key:"createRenderObject",value:function(){var e=this.mRenderer.getUiRenderer(),t=new My(this.mSceneEntity,e,this.mOptions);t.locked=this.mLocked,this.mSubscriptions.push(t.onEvents.subscribe(this.uiEvent.bind(this))),this.mRenderObject=t,this.applyProperties()}},{key:"uiEvent",value:function(e){switch(e.name){case"click":this.moveToViewport();break;case"back":this.returnToPreviousCamera()}}},{key:"moveToViewport",value:function(){var e=R.K.sceneManager().getActiveCamera();this.mPreviousCamera.position.copy(e.transform.position),this.mPreviousCamera.quaternion.copy(e.transform.quaternion),R.K.messenger().send(new m.kU(this.mViewportPosition.clone(),new te.P(this.mViewportRotation.x,this.mViewportRotation.y,this.mViewportRotation.z),m.nN.PUSH_CONTROLLER))}},{key:"returnToPreviousCamera",value:function(){R.K.messenger().send(new m.kU(this.mPreviousCamera.position,new te.P(this.mPreviousCamera.rotation.x,this.mPreviousCamera.rotation.y,this.mPreviousCamera.rotation.z),m.nN.POP_CONTROLLER))}}]);var r}(wy);function Sy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sy=function(){return!!e})()}function Cy(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Ey=function(e){function t(e,n){var r,i,a,o,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Sy()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"onEvents",new M.B),(0,c.A)(r,"mBtnElment",void 0),(0,c.A)(r,"mTitle",""),(0,c.A)(r,"mColor",new Ft.v("#f06")),(0,c.A)(r,"mHoverColor",new Ft.v("#ca095e")),(0,c.A)(r,"mTextColor",Ft.v.Black()),(0,c.A)(r,"mMargin",5),(0,c.A)(r,"mFontSize",16),u.title&&(r.mTitle=u.title),u.margin&&(r.mMargin=u.margin),u.color&&r.mColor.set(u.color),u.hover&&r.mHoverColor.set(u.hover),u.fontSize&&(r.mFontSize=u.fontSize),u.textColor&&r.mTextColor.set(u.textColor),r.createButton(),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"title":return this.mTitle=n,!0;case"color":return this.mColor.set(n),!0;case"hover":return this.mHoverColor.set(n),!0;case"textColor":return this.mTextColor.set(n),!0;case"fontSize":return this.mFontSize=parseInt(n,10),!0;case"margin":return this.mMargin=n,!0}return Cy(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){switch(e){case"title":return this.mTitle;case"color":return this.mColor.getHexString();case"hover":return this.mHoverColor.getHexString();case"textColor":return this.mTextColor.getHexString();case"fontSize":return this.mFontSize;case"margin":return this.mMargin}return Cy(t,"proxyGetValue",this,3)([e])}},{key:"createButton",value:function(){this.mBtnElment=document.createElement("button"),this.mBtnElment.setAttribute("data-ui-type","button"),this.mBtnElment.type="button",this.mBtnElment.style.position="relative",this.mBtnElment.style.top="0px",this.mBtnElment.style.left="0px",this.mBtnElment.style.fontSize="".concat(this.mFontSize,"px"),this.mBtnElment.style.padding="".concat(this.mMargin,"px"),this.mBtnElment.style.backgroundColor=this.mColor.getHexString(),this.mBtnElment.style.color=this.mTextColor.getHexString(),this.mBtnElment.innerText=this.mTitle,this.mBtnElment.addEventListener("mouseover",this.onButtonMouseOver.bind(this)),this.mBtnElment.addEventListener("mouseout",this.onButtonMouseOut.bind(this)),this.mBtnElment.addEventListener("click",this.onButtonClick.bind(this)),this.domElement.appendChild(this.mBtnElment)}},{key:"onButtonMouseOver",value:function(){this.mBtnElment.style.backgroundColor=this.mHoverColor.getHexString()}},{key:"onButtonMouseOut",value:function(){this.mBtnElment.style.backgroundColor=this.mColor.getHexString()}},{key:"onButtonClick",value:function(){this.onEvents.next({name:"click",data:this.getObjectId()})}},{key:"updateElement",value:function(){this.mBtnElment&&(this.mBtnElment.style.fontSize="".concat(this.mFontSize,"px"),this.mBtnElment.style.padding="".concat(this.mMargin,"px"),this.mBtnElment.innerText=this.mTitle,this.mBtnElment.style.backgroundColor=this.mColor.getHexString(),this.mBtnElment.style.color=this.mTextColor.getHexString())}}])}(by);function Ry(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ry=function(){return!!e})()}(0,c.A)(Ey,"TypeRTTI",new le.O("ButtonUixObject",by.TypeRTTI));var Iy=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Ry()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mPositionType",Sl.FIXED),(0,c.A)(e,"mPosition",new te.P),(0,c.A)(e,"mOptions",{}),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){this.mPositionType=this.mSceneEntity.getValue("position_type"),this.mPosition.copy(this.mSceneEntity.getValue("position")),this.mOptions=this.mSceneEntity.getValue("options")}},{key:"applyProperties",value:function(){if(this.mRenderObject){this.mRenderObject.positionType=this.mPositionType,this.mRenderObject.position=this.mPosition.clone();for(var e=0,t=Object.entries(this.mOptions);e<t.length;e++){var n=(0,o.A)(t[e],2),r=n[0],i=n[1];this.mRenderObject.setValue(r,i)}}}},{key:"onUpdateDirty",value:function(){var e,n,r,i,a;(e=t,n="onUpdateDirty",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties(),this.applyProperties()}},{key:"createRenderObject",value:function(){var e=this.mRenderer.getUiRenderer(),t=new Ey(this.mSceneEntity,e,this.mOptions);t.positionType=this.mPositionType,t.locked=this.mLocked,this.mRenderObject=t,this.applyProperties()}}]);var r}(wy);function Oy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Oy=function(){return!!e})()}function Dy(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Py=function(e){function t(e,n,r){var i,a,o,u,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,s.A)(this,t),a=this,o=t,u=[e,n],o=(0,oe.A)(o),i=(0,ae.A)(a,Oy()?Reflect.construct(o,u||[],(0,oe.A)(a).constructor):o.apply(a,u)),(0,c.A)(i,"onEvents",new M.B),(0,c.A)(i,"mImagePath",void 0),(0,c.A)(i,"mImage",void 0),(0,c.A)(i,"mSize",new ee.I),i.mImagePath=r,l.width&&(i.mSize.x=l.width),l.height&&(i.mSize.y=l.height),i.createImage(),i}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"dispose",value:function(){this.mImage&&this.mImage.removeEventListener("click",this.onImageClick.bind(this)),Dy(t,"dispose",this,3)([])}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"image_path":case"imagePath":return this.setImagePath(n),!0;case"size":return this.setImageSize(n.x,n.y),!0;case"width":return this.setImageSize(n,this.mSize.y),!0;case"height":return this.setImageSize(this.mSize.x,n),!0}return Dy(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){switch(e){case"image_path":case"imagePath":return this.mImagePath;case"size":return this.mSize;case"width":return this.mSize.x;case"height":return this.mSize.y}return Dy(t,"proxyGetValue",this,3)([e])}},{key:"setImagePath",value:function(e){this.mImagePath!==e&&(this.mImagePath=e,this.mImage&&(this.mImage.src=e||this.imagePlaceholderPath))}},{key:"setImageSize",value:function(e,t){if(this.mSize.set(e,t),this.mImage&&(this.mImage.style.width="".concat(e,"px"),this.mImage.style.height="".concat(t,"px"),this.mEditting)){var n=$(this.mImage).resizable("instance");n&&n.element&&(n.element.width(e),n.element.height(t))}}},{key:"createImage",value:function(){this.mImage=document.createElement("img"),this.mImage.setAttribute("data-ui-type","image"),this.mImage.src=this.mImagePath||this.imagePlaceholderPath,this.mImage.style.position="relative",this.mImage.style.top="0px",this.mImage.style.left="0px",this.mSize.x*this.mSize.y>0&&this.setImageSize(this.mSize.x,this.mSize.y),this.mImage.addEventListener("click",this.onImageClick.bind(this)),this.domElement.appendChild(this.mImage)}},{key:"onImageClick",value:function(){this.onEvents.next({name:"click",data:this.getObjectId()})}},{key:"makeEditable",value:function(){var e=this;return!!Dy(t,"makeEditable",this,3)([])&&(this.mEditting&&!$(this.mImage).resizable("instance")&&$(this.mImage).resizable({start:function(t,n){e.onEdit.next({type:"resize",event:"start",data:n.size})},stop:function(t,n){e.onEdit.next({type:"resize",event:"stop",data:n.size})},resize:function(t,n){e.onEdit.next({type:"resize",event:"update",data:n.size})}}),!0)}},{key:"makeUnEditable",value:function(){this.mEditting&&$(this.mImage).resizable("instance")&&$(this.mImage).resizable("destroy"),Dy(t,"makeUnEditable",this,3)([])}},{key:"updateElement",value:function(){}},{key:"imagePlaceholderPath",get:function(){return"".concat(et.w.assetsUrl,"system/placeholders/no-image.jpg")}}])}(by);function By(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(By=function(){return!!e})()}(0,c.A)(Py,"TypeRTTI",new le.O("ImageUixObject",by.TypeRTTI));var Fy=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,By()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mPositionType",Sl.FIXED),(0,c.A)(e,"mPosition",new te.P),(0,c.A)(e,"mOptions",{}),(0,c.A)(e,"mImageId",-1),(0,c.A)(e,"mImagePath",void 0),(0,c.A)(e,"mActiveImageId",-1),(0,c.A)(e,"mSize",new ee.I(100,100)),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(a=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.prev=1,e.next=4,this.updateImage();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),v.UX.error("Failed to load image:",e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){this.mPositionType=this.mSceneEntity.getValue("position_type"),this.mPosition=this.mSceneEntity.getValue("position"),this.mOptions=this.mSceneEntity.getValue("options"),this.mImageId=this.mSceneEntity.getValue("image_id"),this.mSize.copy(this.mSceneEntity.getValue("size"))}},{key:"applyProperties",value:function(){if(this.mRenderObject){this.mRenderObject.positionType=this.mPositionType,this.mRenderObject.locked=this.mLocked,this.mRenderObject.position=this.mPosition.clone(),this.mRenderObject.setValue("size",this.mSize),this.mRenderObject.setValue("image_path",this.mImagePath);for(var e=0,t=Object.entries(this.mOptions);e<t.length;e++){var n=(0,o.A)(t[e],2),r=n[0],i=n[1];this.mRenderObject.setValue(r,i)}}}},{key:"updateImage",value:(r=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mActiveImageId!==this.mImageId){e.next=2;break}return e.abrupt("return");case 2:if(-1!==this.mImageId){e.next=6;break}return this.mActiveImageId=-1,this.mImagePath="",e.abrupt("return");case 6:return this.mActiveImageId=this.mImageId,e.next=9,tn.u.getInstance().resolveModel(this.mActiveImageId);case 9:t=e.sent,this.mImagePath=t.source_url;case 11:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"onUpdateDirty",value:function(){var e,n,r,i,a,o=this;(e=t,n="onUpdateDirty",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties(),this.applyProperties(),this.updateImage().then((function(){o.mRenderObject.setValue("image_path",o.mImagePath)}),(function(e){v.UX.error("Failed to load image:",e)}))}},{key:"createRenderObject",value:function(){var e=this.mRenderer.getUiRenderer(),t=new Py(this.mSceneEntity,e,this.mImagePath,this.mOptions);this.mRenderObject=t,this.applyProperties()}}]);var r,a}(wy);function Ny(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ny=function(){return!!e})()}function Ly(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var jy=function(e){function t(e,n){var r,i,a,o,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Ny()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"onEvents",new M.B),(0,c.A)(r,"mTextElement",void 0),(0,c.A)(r,"mTagElement",void 0),(0,c.A)(r,"mTitle",""),(0,c.A)(r,"mColor",new Ft.v("#f06")),(0,c.A)(r,"mTextColor",Ft.v.Black()),(0,c.A)(r,"mHover",new Ft.v("#ca095e")),(0,c.A)(r,"mMargin",0),(0,c.A)(r,"mFontSize",16),r.mTitle=u.title||"Title",r.mMargin=u.margin||0,u.color&&r.mColor.set(u.color),u.hover&&r.mHover.set(u.hover),r.mFontSize=u.fontSize||16,u.textColor&&r.mTextColor.set(u.textColor),r._createTag(),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"title":return this.mTitle=n,!0;case"color":return this.mColor.set(n),!0;case"hover":return this.mHover.set(n),!0;case"textColor":return this.mTextColor.set(n),!0;case"fontSize":return this.mFontSize=parseInt(n,10),!0;case"margin":return this.mMargin=n,!0}return Ly(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){switch(e){case"title":return this.mTitle;case"color":return this.mColor.getHexString();case"hover":return this.mHover.getHexString();case"textColor":return this.mTextColor.getHexString();case"fontSize":return this.mFontSize;case"margin":return this.mMargin}return Ly(t,"proxyGetValue",this,3)([e])}},{key:"_createTag",value:function(){this.mTextElement=document.createElement("div"),this.mTextElement.setAttribute("data-ui-type","tag-title"),this.mTextElement.innerText=this.mTitle,this.mTextElement.style.fontSize="".concat(this.mFontSize,"px"),this.mTextElement.style.position="absolute",this.mTextElement.style.top="0px",this.mTextElement.style.left="0px",this.mTextElement.style.visibility="hidden",this.mTextElement.style.display="block",document.body.appendChild(this.mTextElement);var e=this.mTextElement.offsetHeight+1,t=this.mTextElement.offsetWidth+1+e+this.mMargin,n="".concat(t,"px");document.body.removeChild(this.mTextElement),this.mTextElement.style.position="relative",this.mTextElement.style.visibility="",this.mTextElement.style.display="",this.mTagElement=document.createElement("div"),this.mTagElement.setAttribute("data-ui-type","tag"),this.mTagElement.style.position="relative",this.mTagElement.style.top="0px",this.mTagElement.style.left="0px",this.mTagElement.style.width=n,this.mTagElement.style.height=n,this.mTagElement.style.backgroundColor=this.mColor.getHexString(),this.mTagElement.style.borderRadius="50%",this.mTagElement.style.display="flex",this.mTagElement.style.justifyContent="center",this.mTagElement.style.alignItems="center",this.mTagElement.appendChild(this.mTextElement),this.mTagElement.addEventListener("mouseover",this.onTagMouseOver.bind(this)),this.mTagElement.addEventListener("mouseout",this.onTagMouseOut.bind(this)),this.mTagElement.addEventListener("click",this.onTagClick.bind(this)),this.domElement.appendChild(this.mTagElement)}},{key:"onTagClick",value:function(){this.onEvents.next({name:"click",data:this.getObjectId()})}},{key:"onTagMouseOver",value:function(){this.mTagElement.style.backgroundColor=this.mHover.getHexString()}},{key:"onTagMouseOut",value:function(){this.mTagElement.style.backgroundColor=this.mColor.getHexString()}},{key:"updateElement",value:function(){if(this.mTextElement&&this.mTagElement){this.mTextElement.style.fontSize="".concat(this.mFontSize,"px"),this.mTextElement.innerText=this.mTitle;var e=this.mTextElement.clientHeight+1,t=this.mTextElement.clientWidth+1+e+this.mMargin,n="".concat(t,"px");this.mTagElement.style.backgroundColor=this.mColor.getHexString(),this.mTagElement.style.color=this.mTextColor.getHexString(),this.mTagElement.style.width=n,this.mTagElement.style.height=n}}}])}(by);function Uy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Uy=function(){return!!e})()}(0,c.A)(jy,"TypeRTTI",new le.O("TagUixObject",by.TypeRTTI));var Vy=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Uy()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mPositionType",Sl.FIXED),(0,c.A)(e,"mPosition",new te.P),(0,c.A)(e,"mOptions",{}),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){this.mPositionType=this.mSceneEntity.getValue("position_type"),this.mPosition.copy(this.mSceneEntity.getValue("position")),this.mOptions=this.mSceneEntity.getValue("options")}},{key:"applyProperties",value:function(){this.mRenderObject.positionType=this.mPositionType,this.mRenderObject.position=this.mPosition.clone(),this.mRenderObject.locked=this.mLocked;for(var e=0,t=Object.entries(this.mOptions);e<t.length;e++){var n=(0,o.A)(t[e],2),r=n[0],i=n[1];this.mRenderObject.setValue(r,i)}}},{key:"onUpdateDirty",value:function(){var e,n,r,i,a;(e=t,n="onUpdateDirty",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties(),this.applyProperties()}},{key:"createRenderObject",value:function(){var e=this.mRenderer.getUiRenderer(),t=new jy(this.mSceneEntity,e,this.mOptions);this.mRenderObject=t,this.applyProperties()}}]);var r}(wy);function zy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zy=function(){return!!e})()}function Hy(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Gy=function(e){function t(e,n,r){var i,a,o,u,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,s.A)(this,t),a=this,o=t,u=[e,n],o=(0,oe.A)(o),i=(0,ae.A)(a,zy()?Reflect.construct(o,u||[],(0,oe.A)(a).constructor):o.apply(a,u)),(0,c.A)(i,"onEvents",new M.B),(0,c.A)(i,"mHtmlText",void 0),(0,c.A)(i,"mPanelColor",new Ft.v("#f06")),(0,c.A)(i,"mMargin",20),(0,c.A)(i,"mPanelElement",void 0),(0,c.A)(i,"mTextElement",void 0),(0,c.A)(i,"mSize",void 0),i.mHtmlText=r||l.text||"",l.panelColor&&i.mPanelColor.set(l.panelColor),i.mMargin=l.margin||20,i.mSize=new ee.I(l.width||150,l.height||200),i._createText(),i}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"_createText",value:function(){var e=this._buildPanel();this.domElement.appendChild(e)}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"htmlText":case"text":return this.mHtmlText=n,!0;case"panelColor":return this.mPanelColor.set(n),!0;case"margin":return this.mMargin=n,!0;case"size":return this.mSize.set(n.x,n.y),!0;case"width":return this.mSize.x=n,!0;case"height":return this.mSize.y=n,!0}return Hy(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){switch(e){case"htmlText":case"text":return this.mHtmlText;case"panelColor":return this.mPanelColor.getHexString();case"margin":return this.mMargin;case"size":return this.mSize;case"width":return this.mSize.x;case"height":return this.mSize.y}return Hy(t,"proxyGetValue",this,3)([e])}},{key:"_buildPanel",value:function(){return this.mPanelElement=document.createElement("div"),this.mPanelElement.style.backgroundColor=this.mPanelColor.getHexString(),this.mPanelElement.setAttribute("data-ui-type","text-panel"),this.mPanelElement.style.padding="".concat(this.mMargin,"px"),this.mPanelElement.style.position="relative",this.mPanelElement.style.top="0px",this.mPanelElement.style.left="0px",this.mPanelElement.style.width="".concat(this.mSize.x,"px"),this.mPanelElement.style.height="".concat(this.mSize.y,"px"),this.mTextElement=document.createElement("div"),this.mTextElement.setAttribute("data-ui-type","text-content"),this.mTextElement.style.width="100%",this.mTextElement.style.height="100%",this.mTextElement.style.overflow="auto",this.mTextElement.innerHTML=this.mHtmlText,this.mPanelElement.appendChild(this.mTextElement),this.mPanelElement}},{key:"makeEditable",value:function(){var e=this;return!!Hy(t,"makeEditable",this,3)([])&&(this.mEditting&&!$(this.mPanelElement).resizable("instance")&&$(this.mPanelElement).resizable({start:function(t,n){e.onEdit.next({type:"resize",event:"start",data:n.size})},stop:function(t,n){e.onEdit.next({type:"resize",event:"stop",data:n.size})},resize:function(t,n){e.onEdit.next({type:"resize",event:"update",data:n.size})}}),!0)}},{key:"makeUnEditable",value:function(){this.mEditting&&$(this.mPanelElement).resizable("instance")&&$(this.mPanelElement).resizable("destroy"),Hy(t,"makeUnEditable",this,3)([])}},{key:"updateElement",value:function(){this.mPanelElement&&(this.mTextElement.innerHTML=this.mHtmlText,this.mPanelElement.style.padding="".concat(this.mMargin,"px"),this.mPanelElement.style.backgroundColor=this.mPanelColor.getHexString(),this.mPanelElement.style.width="".concat(this.mSize.x,"px"),this.mPanelElement.style.height="".concat(this.mSize.y,"px"))}}])}(by);function qy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qy=function(){return!!e})()}(0,c.A)(Gy,"TypeRTTI",new le.O("TextUixObject",by.TypeRTTI));var Wy=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,qy()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mPositionType",Sl.FIXED),(0,c.A)(e,"mPosition",new te.P),(0,c.A)(e,"mOptions",{}),(0,c.A)(e,"mHtmlText",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.mPositionType=this.mSceneEntity.getValue("position_type"),this.mOptions=this.mSceneEntity.getValue("options"),this.mHtmlText=this.mSceneEntity.getValue("htmlText");case 3:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){this.mPositionType=this.mSceneEntity.getValue("position_type"),this.mPosition.copy(this.mSceneEntity.getValue("position")),this.mOptions=this.mSceneEntity.getValue("options"),this.mHtmlText=this.mSceneEntity.getValue("htmlText")}},{key:"applyProperties",value:function(){this.mRenderObject.positionType=this.mPositionType,this.mRenderObject.position=this.mPosition.clone(),this.mRenderObject.locked=this.mLocked;for(var e=0,t=Object.entries(this.mOptions);e<t.length;e++){var n=(0,o.A)(t[e],2),r=n[0],i=n[1];this.mRenderObject.setValue(r,i)}}},{key:"onUpdateDirty",value:function(){var e,n,r,i,a;(e=t,n="onUpdateDirty",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties(),this.applyProperties()}},{key:"createRenderObject",value:function(){var e=this.mRenderer.getUiRenderer(),t=new Gy(this.mSceneEntity,e,this.mHtmlText,this.mOptions);this.mRenderObject=t,this.applyProperties()}}]);var r}(wy),Ky=(0,u.A)((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te.P.Zero(),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:te.P.Zero(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;(0,s.A)(this,e),(0,c.A)(this,"direction",new te.P),(0,c.A)(this,"origin",new te.P),(0,c.A)(this,"length",void 0),this.direction.copy(t),this.origin.copy(n),this.length=r})),Xy=(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"distance",1/0),(0,c.A)(this,"point",te.P.Zero()),(0,c.A)(this,"entity",void 0),(0,c.A)(this,"uv",ee.I.Zero()),(0,c.A)(this,"uv2",ee.I.Zero()),(0,c.A)(this,"faceNormal",te.P.Up()),(0,c.A)(this,"normal",te.P.Up())}));function Yy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yy=function(){return!!e})()}var $y=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,Yy()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mInternalGeometry",void 0),(0,c.A)(r,"mHasVertexAlpha",!1),r.mInternalGeometry=new BABYLON.Geometry(f.V.guid(),e,n),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"setVertexData",value:function(e,t){var n=this.resolveAttributeKind(e);this.mInternalGeometry.setVerticesData(n,t.getData()),e===Ns.P.COLOR&&(this.mHasVertexAlpha=t.getItemSize()>3)}},{key:"setIndexData",value:function(e){this.mInternalGeometry.setIndices(e.getData())}},{key:"hasPositions",value:function(){return this.mInternalGeometry.isVerticesDataPresent(this.resolveAttributeKind(Ns.P.POSITION))}},{key:"hasNormals",value:function(){return this.mInternalGeometry.isVerticesDataPresent(this.resolveAttributeKind(Ns.P.NORMAL))}},{key:"hasTangents",value:function(){return this.mInternalGeometry.isVerticesDataPresent(this.resolveAttributeKind(Ns.P.TANGENT))}},{key:"hasUV",value:function(){return this.mInternalGeometry.isVerticesDataPresent(this.resolveAttributeKind(Ns.P.UV))}},{key:"hasUV2",value:function(){return this.mInternalGeometry.isVerticesDataPresent(this.resolveAttributeKind(Ns.P.UV2))}},{key:"hasColors",value:function(){return this.mInternalGeometry.isVerticesDataPresent(this.resolveAttributeKind(Ns.P.COLOR))}},{key:"hasAlpha",value:function(){return this.mHasVertexAlpha}},{key:"dispose",value:function(){this.mInternalGeometry.dispose()}},{key:"resolveAttributeKind",value:function(e){var t;switch(e){case Ns.P.NORMAL:t=BABYLON.VertexBuffer.NormalKind;break;case Ns.P.TANGENT:t=BABYLON.VertexBuffer.TangentKind;break;case Ns.P.UV:t=BABYLON.VertexBuffer.UVKind;break;case Ns.P.UV2:t=BABYLON.VertexBuffer.UV2Kind;break;case Ns.P.COLOR:t=BABYLON.VertexBuffer.ColorKind;break;default:case Ns.P.POSITION:t=BABYLON.VertexBuffer.PositionKind}return t}},{key:"getInternalGeometry",value:function(){return this.mInternalGeometry}}])}(Ns.L),Zy=(0,u.A)((function e(t,n){(0,s.A)(this,e),(0,c.A)(this,"mCamera",void 0),(0,c.A)(this,"mRenderer",void 0),this.mCamera=t,this.mRenderer=n}));function Qy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qy=function(){return!!e})()}var Jy,eg,tg,ng,rg,ig,ag=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Qy()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mEnabled",!0),(0,c.A)(r,"mPosition",te.P.Zero()),(0,c.A)(r,"mTarget",te.P.Zero()),(0,c.A)(r,"mLockUpHemisphere",!1),(0,c.A)(r,"mMinAzimuthAngle",null),(0,c.A)(r,"mMaxAzimuthAngle",null),(0,c.A)(r,"mMinPolarAngle",0),(0,c.A)(r,"mMaxPolarAngle",Math.PI),(0,c.A)(r,"mRotateEnabled",!0),(0,c.A)(r,"mRotationSpeed",1),(0,c.A)(r,"mPanEnabled",!0),(0,c.A)(r,"mPanSpeed",1),(0,c.A)(r,"mZoomEnabled",!0),(0,c.A)(r,"mMinZoom",1),(0,c.A)(r,"mMaxZoom",1e3),(0,c.A)(r,"mZoomSpeed",1),(0,c.A)(r,"mDampingEnabled",!0),(0,c.A)(r,"mDampFactor",.1),(0,c.A)(r,"mAutoRotateEnabled",!1),(0,c.A)(r,"mAutoRotateSpeed",2),(0,c.A)(r,"mKeysEnabled",!0),(0,c.A)(r,"mWheelPrecision",3),(0,c.A)(r,"mPreviousPosition",te.P.Zero()),(0,c.A)(r,"mPreviousTarget",te.P.Zero()),(0,c.A)(r,"mPreviousRadius",0),(0,c.A)(r,"mIsPanning",!1),(0,c.A)(r,"mIsRotating",!1),(0,c.A)(r,"mIsZooming",!1),(0,c.A)(r,"mIsAnimating",!1),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadCameraControls",value:function(){var e=this.mCamera.getSceneEntity(),t=e.getComponent("orbit-camera-controls");this.mEnabled=t.enabled,this.mIsAnimating=e.isAnimating,this.mPosition.copy(e.transform.position),this.mTarget.copy(e.target),this.mPanEnabled=t.panEnabled,this.mPanSpeed=t.panSpeed,this.mRotateEnabled=t.rotateEnabled,this.mRotationSpeed=t.rotateSpeed,this.mZoomEnabled=t.zoomEnabled,this.mMinZoom=t.zoomMin,this.mMaxZoom=t.zoomMax,this.mZoomSpeed=t.zoomSpeed,this.mLockUpHemisphere=t.isUpHemisphereLocked,this.mMinAzimuthAngle=t.azimuthAngleMin,this.mMaxAzimuthAngle=t.azimuthAngleMax,this.mMinPolarAngle=t.polarAngleMin,this.mMaxPolarAngle=t.polarAngleMax,this.mDampingEnabled=t.dampingEnabled,this.mDampFactor=t.dampingFactor,this.mAutoRotateEnabled=t.autoRotateEnabled,this.mAutoRotateSpeed=t.autoRotateSpeed,this.mKeysEnabled=t.keyboardEnabled}},{key:"createCameraControls",value:function(){var e=this.mCamera.getCamera(),t=this.mPosition.clone(),n=this.mTarget.clone(),r=t.distanceTo(this.mTarget);if(this.mRenderer.isRightHandedSystemActive()||(t.toggleCoordSystem(),n.toggleCoordSystem()),e||(e=new BABYLON.ArcRotateCamera(this.mCamera.getCameraName(),0,0,r,new BABYLON.Vector3(n.x,n.y,n.z),this.mRenderer.getScene()),this.mCamera.setCamera(e)),e.position||(e.position=new BABYLON.Vector3),e.position.set(t.x,t.y,t.z),e.radius=r,e.setTarget(new BABYLON.Vector3(n.x,n.y,n.z)),e.rebuildAnglesAndRadius(),e.setEnabled(this.mEnabled),e.inputs.clear(),e.inputs.addPointers(),e.inputs.addMouseWheel(),this.mKeysEnabled&&e.inputs.addKeyboard(),e.checkCollisions=!1,e.ignoreParentScaling=!0,e.speed=2,this.mZoomEnabled)e.lowerRadiusLimit=this.mMinZoom,e.upperRadiusLimit=this.mMaxZoom;else{e.lowerRadiusLimit=r+1.2,e.upperRadiusLimit=r+1.2}if(this.mWheelPrecision=1/Math.max(this.mZoomSpeed,Sn.EPS)*3,e.wheelPrecision=this.calculateWheelPrecision(),e.wheelDeltaPercentage=0,this.mPanEnabled){e.panningAxis=BABYLON.Vector3.One();var i=1/Math.max(this.mPanSpeed,Sn.EPS)*75;e.panningSensibility=i}else e.panningAxis=BABYLON.Vector3.Zero(),e.panningSensibility=1/0;if(this.mRotateEnabled){var a=1/Math.max(this.mRotationSpeed,Sn.EPS)*250;e.angularSensibilityX=a,e.angularSensibilityY=a}else e.angularSensibilityX=1/0,e.angularSensibilityY=1/0;if(this.mDampingEnabled){var o=Math.min(this.mDampFactor+.5,.999);e.inertia=o,e.panningInertia=o}else e.inertia=0,e.panningInertia=0;e.lowerAlphaLimit=this.mMinAzimuthAngle,e.upperAlphaLimit=this.mMaxAzimuthAngle,e.lowerBetaLimit=this.mMinPolarAngle+.001,this.mLockUpHemisphere?e.upperBetaLimit=Math.PI/2-.001:e.upperBetaLimit=this.mMaxPolarAngle-.001,e.useAutoRotationBehavior=this.mAutoRotateEnabled,e.useAutoRotationBehavior&&(e.autoRotationBehavior.zoomStopsAnimation=!1,e.autoRotationBehavior.idleRotationWaitTime=0,e.autoRotationBehavior.idleRotationSpinupTime=1,e.autoRotationBehavior.idleRotationSpeed=this.mAutoRotateSpeed),this.mPreviousPosition.set(e.position.x,e.position.y,e.position.z),this.mPreviousTarget.set(e.target.x,e.target.y,e.target.z),this.mPreviousRadius=e.radius,this.mCamera.attachCamera()}},{key:"calculateWheelPrecisionFactor",value:function(){var e=this.mCamera.getCamera().radius;if(e>=10)return 1;if(e<=0)return.05;return 1-.95*Math.exp(e/10*-2.5)}},{key:"calculateWheelPrecision",value:function(){return this.mWheelPrecision+100*(1-this.calculateWheelPrecisionFactor())}},{key:"update",value:function(e){var t=this.mCamera.getSceneEntity(),n=this.mCamera.getCamera(),r=!1,i=!1,a=!1,o=n.radius;Math.abs(this.mPreviousRadius-o)>Sn.EPS&&(n.wheelPrecision=this.calculateWheelPrecision(),r=!0),!this.mIsAnimating&&this.didPan()&&(t.target.set(n.target.x,n.target.y,n.target.z),i=!0),!this.mIsAnimating&&this.didRotate()&&(t.transform.position.set(n.position.x,n.position.y,n.position.z),t.transform.quaternion.set(n.absoluteRotation.x,n.absoluteRotation.y,n.absoluteRotation.z,n.absoluteRotation.w),i||r||(a=!0)),this.mPreviousRadius=o,this.mPreviousTarget.copy(t.target),this.mPreviousPosition.copy(t.transform.position);var s=ve.Unchanged,u=ve.Unchanged,c=ve.Unchanged;r&&!this.mIsZooming?s=ve.Started:!r&&this.mIsZooming?s=ve.Ended:r&&(s=ve.Changed),i&&!this.mIsPanning?u=ve.Started:!i&&this.mIsPanning?u=ve.Ended:i&&(u=ve.Changed),a&&!this.mIsRotating?c=ve.Started:!a&&this.mIsRotating?c=ve.Ended:a&&(c=ve.Changed),this.mIsPanning=i,this.mIsRotating=a,this.mIsZooming=r,s!==ve.Unchanged&&R.K.eventBus().dispatch(new Ce(s)),u!==ve.Unchanged&&R.K.eventBus().dispatch(new Me(ge.Pan,u)),c!==ve.Unchanged&&R.K.eventBus().dispatch(new Me(ge.Rotate,c))}},{key:"onUpdateDirty",value:function(){var e=this.mCamera.getSceneEntity();this.loadCameraControls(),this.createCameraControls(),e.getComponent("orbit-camera-controls").setNeedsRenderUpdate(!1)}},{key:"destroyCameraControls",value:function(){}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}},{key:"getComponentName",value:function(){return"orbit-camera-controls"}},{key:"didPan",value:function(){var e=this.mCamera.getCamera(),t=this.mPreviousTarget.x-e.target.x,n=this.mPreviousTarget.y-e.target.y,r=this.mPreviousTarget.z-e.target.z;return t*t+n*n+r*r>1e-8}},{key:"didRotate",value:function(){var e=this.mCamera.getCamera(),t=this.mPreviousPosition.x-e.position.x,n=this.mPreviousPosition.y-e.position.y,r=this.mPreviousPosition.z-e.position.z;return t*t+n*n+r*r>1e-8}}])}(Zy),og=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(0,s.A)(this,e),(0,c.A)(this,"radius",1),(0,c.A)(this,"phi",0),(0,c.A)(this,"theta",0),this.radius=t,this.phi=n,this.theta=r,this}return(0,u.A)(e,[{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}},{key:"copy",value:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}},{key:"makeSafe",value:function(){var e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}},{key:"setFromVector3",value:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}},{key:"setFromCartesianCoords",value:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos((0,_.qE)(t/this.radius,-1,1))),this}},{key:"clone",value:function(){return(new e).copy(this)}}])}();(eg=Jy||(Jy={}))[eg.NONE=-1]="NONE",eg[eg.ROTATE=0]="ROTATE",eg[eg.DOLLY=1]="DOLLY",eg[eg.TOUCH_ROTATE=2]="TOUCH_ROTATE",eg[eg.TOUCH_DOLLY_ROTATE=3]="TOUCH_DOLLY_ROTATE",(ng=tg||(tg={}))[ng.LEFT=0]="LEFT",ng[ng.MIDDLE=1]="MIDDLE",ng[ng.RIGHT=2]="RIGHT",ng[ng.ROTATE=0]="ROTATE",ng[ng.DOLLY=1]="DOLLY",(ig=rg||(rg={}))[ig.ROTATE=0]="ROTATE",ig[ig.DOLLY_ROTATE=1]="DOLLY_ROTATE";var sg=function(){return(0,u.A)((function e(t,n,r,i){(0,s.A)(this,e),(0,c.A)(this,"mCamera",void 0),(0,c.A)(this,"mObject",void 0),(0,c.A)(this,"mAxis",te.P.Up()),(0,c.A)(this,"mDomElement",void 0),(0,c.A)(this,"enabled",!0),(0,c.A)(this,"minDistance",0),(0,c.A)(this,"maxDistance",1/0),(0,c.A)(this,"minZoom",0),(0,c.A)(this,"maxZoom",1/0),(0,c.A)(this,"minPolarAngle",0),(0,c.A)(this,"maxPolarAngle",Math.PI),(0,c.A)(this,"minAzimuthAngle",-1/0),(0,c.A)(this,"maxAzimuthAngle",1/0),(0,c.A)(this,"enableDamping",!1),(0,c.A)(this,"dampingFactor",.05),(0,c.A)(this,"enableZoom",!0),(0,c.A)(this,"zoomSpeed",1),(0,c.A)(this,"enableRotate",!0),(0,c.A)(this,"rotateSpeed",1),(0,c.A)(this,"autoRotate",!1),(0,c.A)(this,"autoRotateSpeed",2),(0,c.A)(this,"mouseButtons",{LEFT:tg.ROTATE,MIDDLE:tg.DOLLY,RIGHT:tg.ROTATE}),(0,c.A)(this,"touches",{ONE:rg.ROTATE,TWO:rg.DOLLY_ROTATE}),(0,c.A)(this,"position0",new te.P),(0,c.A)(this,"quaternion0",new ne.P),(0,c.A)(this,"zoom0",1),(0,c.A)(this,"lastPosition",new te.P),(0,c.A)(this,"lastQuaternion",new ne.P),(0,c.A)(this,"startRotation",new ne.P),(0,c.A)(this,"changeEvent",{type:"change"}),(0,c.A)(this,"startEvent",{type:"start"}),(0,c.A)(this,"endEvent",{type:"end"}),(0,c.A)(this,"zoomEvent",{type:"zoom"}),(0,c.A)(this,"state",Jy.NONE),(0,c.A)(this,"mSpherical",new og),(0,c.A)(this,"mSphericalDelta",new og),(0,c.A)(this,"scale",1),(0,c.A)(this,"zoomChanged",!1),(0,c.A)(this,"rotateStart",new ee.I),(0,c.A)(this,"rotateEnd",new ee.I),(0,c.A)(this,"rotateDelta",new ee.I),(0,c.A)(this,"dollyStart",new ee.I),(0,c.A)(this,"dollyEnd",new ee.I),(0,c.A)(this,"dollyDelta",new ee.I),(0,c.A)(this,"_listeners",{}),this.mCamera=t,this.mObject=n,this.mAxis.copy(r),this.mDomElement=i,this.position0.copy(this.mObject.transform.position),this.quaternion0.copy(this.mObject.transform.quaternion),this.startRotation.copy(this.mObject.transform.quaternion),this.mObject?(this.mSpherical.radius=this.mCamera.transform.position.distanceTo(this.mObject.transform.position),this.mSpherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.mSpherical.radius))):this.mSpherical.radius=1,this.mDomElement.addEventListener("contextmenu",this.onContextMenu.bind(this),!1),this.mDomElement.addEventListener("mousedown",this.onMouseDown.bind(this),!1),this.mDomElement.addEventListener("wheel",this.onMouseWheel.bind(this),!1),this.mDomElement.addEventListener("touchstart",this.onTouchStart.bind(this),!1),this.mDomElement.addEventListener("touchend",this.onTouchEnd.bind(this),!1),this.mDomElement.addEventListener("touchmove",this.onTouchMove.bind(this),!1),-1===this.mDomElement.tabIndex&&(this.mDomElement.tabIndex=0),this.update()}),[{key:"getPolarAngle",value:function(){return this.mSpherical.phi}},{key:"getAzimuthalAngle",value:function(){return this.mSpherical.theta}},{key:"getRadius",value:function(){return this.mSpherical.radius}},{key:"saveState",value:function(){this.quaternion0.copy(this.mObject.transform.quaternion)}},{key:"reset",value:function(){this.mObject.transform.quaternion.copy(this.quaternion0),this.mCamera.updateProjectionMatrix(),this.dispatchEvent({type:this.changeEvent.type,state:"reset"}),this.update(),this.state=Jy.NONE}},{key:"update",value:function(){this.autoRotate&&this.state===Jy.NONE&&this.rotateLeft(this.getAutoRotationAngle()),this.enableDamping?(this.mSpherical.theta+=this.mSphericalDelta.theta*this.dampingFactor,this.mSpherical.phi+=this.mSphericalDelta.phi*this.dampingFactor):(this.mSpherical.theta+=this.mSphericalDelta.theta,this.mSpherical.phi+=this.mSphericalDelta.phi),this.mSpherical.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this.mSpherical.theta)),this.mSpherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this.mSpherical.phi)),this.minPolarAngle!==-1/0&&this.maxPolarAngle!==1/0&&this.mSpherical.makeSafe(),this.mSpherical.radius*=this.scale,this.mSpherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.mSpherical.radius));var e=this.mAxis.y>0?this.mSpherical.theta:this.mSpherical.phi,t=(new ne.P).setFromAxisAngle(this.mAxis,-e);return this.mObject.transform.quaternion.copy(this.startRotation.clone().multiply(t)),!0===this.enableDamping?(this.mSphericalDelta.theta*=1-this.dampingFactor,this.mSphericalDelta.phi*=1-this.dampingFactor):this.mSphericalDelta.set(0,0,0),this.scale=1,!!(this.zoomChanged||this.lastPosition.distanceToSquared(this.mObject.transform.position)>Sn.EPS||8*(1-this.lastQuaternion.dot(this.mObject.transform.quaternion))>Sn.EPS)&&(this.dispatchEvent({type:this.changeEvent.type,state:"any"}),this.lastPosition.copy(this.mObject.transform.position),this.lastQuaternion.copy(this.mObject.transform.quaternion),this.zoomChanged=!1,!0)}},{key:"dispose",value:function(){this.mDomElement.removeEventListener("contextmenu",this.onContextMenu.bind(this),!1),this.mDomElement.removeEventListener("mousedown",this.onMouseDown.bind(this),!1),this.mDomElement.removeEventListener("wheel",this.onMouseWheel.bind(this),!1),this.mDomElement.removeEventListener("touchstart",this.onTouchStart.bind(this),!1),this.mDomElement.removeEventListener("touchend",this.onTouchEnd.bind(this),!1),this.mDomElement.removeEventListener("touchmove",this.onTouchMove.bind(this),!1),document.removeEventListener("mousemove",this.onMouseMove.bind(this),!1),document.removeEventListener("mouseup",this.onMouseUp.bind(this),!1)}},{key:"getAutoRotationAngle",value:function(){return 2*Math.PI/60/60*this.autoRotateSpeed}},{key:"getZoomScale",value:function(){return Math.pow(.95,this.zoomSpeed)}},{key:"rotateLeft",value:function(e){this.mSphericalDelta.theta-=e}},{key:"rotateUp",value:function(e){this.mSphericalDelta.phi-=e}},{key:"dollyOut",value:function(e){this.mCamera instanceof Bt?(this.scale/=e,this.dispatchEvent({type:this.zoomEvent.type,state:"zoom-out"})):this.mCamera instanceof We||(v.UX.warn("WARNING: TurntableControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}},{key:"dollyIn",value:function(e){this.mCamera instanceof Bt?(this.scale*=e,this.dispatchEvent({type:this.zoomEvent.type,state:"zoom-in"})):this.mCamera instanceof We||(v.UX.warn("WARNING: TurntableControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}},{key:"handleMouseDownRotate",value:function(e){this.rotateStart.set(e.clientX,e.clientY)}},{key:"handleMouseDownDolly",value:function(e){this.dollyStart.set(e.clientX,e.clientY)}},{key:"handleMouseMoveRotate",value:function(e){this.rotateEnd.set(e.clientX,e.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed),this.rotateLeft(2*Math.PI*this.rotateDelta.x/this.mDomElement.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/this.mDomElement.clientHeight),this.rotateStart.copy(this.rotateEnd),this.update()}},{key:"handleMouseMoveDolly",value:function(e){this.dollyEnd.set(e.clientX,e.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyOut(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyIn(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update()}},{key:"handleMouseUp",value:function(e){}},{key:"handleMouseWheel",value:function(e){e.deltaY<0?this.dollyIn(this.getZoomScale()):e.deltaY>0&&this.dollyOut(this.getZoomScale()),this.update()}},{key:"handleTouchStartRotate",value:function(e){if(1===e.touches.length)this.rotateStart.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);this.rotateStart.set(t,n)}}},{key:"handleTouchStartDolly",value:function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);this.dollyStart.set(0,r)}},{key:"handleTouchStartDollyRotate",value:function(e){this.enableZoom&&this.handleTouchStartDolly(e),this.enableRotate&&this.handleTouchStartRotate(e)}},{key:"handleTouchMoveRotate",value:function(e){if(1===e.touches.length)this.rotateEnd.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);this.rotateEnd.set(t,n)}this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed),this.rotateLeft(2*Math.PI*this.rotateDelta.x/this.mDomElement.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/this.mDomElement.clientHeight),this.rotateStart.copy(this.rotateEnd)}},{key:"handleTouchMoveDolly",value:function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);this.dollyEnd.set(0,r),this.dollyDelta.set(0,Math.pow(this.dollyEnd.y/this.dollyStart.y,this.zoomSpeed)),this.dollyOut(this.dollyDelta.y),this.dollyStart.copy(this.dollyEnd)}},{key:"handleTouchMoveDollyRotate",value:function(e){this.enableZoom&&this.handleTouchMoveDolly(e),this.enableRotate&&this.handleTouchMoveRotate(e)}},{key:"handleTouchEnd",value:function(e){}},{key:"onMouseDown",value:function(e){if(!1!==this.enabled){var t;switch(e.preventDefault(),this.mDomElement.focus?this.mDomElement.focus():window.focus(),e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case tg.DOLLY:if(!1===this.enableZoom)return;this.handleMouseDownDolly(e),this.state=Jy.DOLLY;break;case tg.ROTATE:if(!1===this.enableRotate)return;this.handleMouseDownRotate(e),this.state=Jy.ROTATE;break;default:this.state=Jy.NONE}if(this.state!==Jy.NONE)switch(document.addEventListener("mousemove",this.onMouseMove.bind(this),!1),document.addEventListener("mouseup",this.onMouseUp.bind(this),!1),this.state){case Jy.ROTATE:this.dispatchEvent({type:this.startEvent.type,state:"rotate"});break;case Jy.DOLLY:this.dispatchEvent({type:this.startEvent.type,state:"zoom"});break;default:this.dispatchEvent({type:this.startEvent.type,state:"any"})}}}},{key:"onMouseMove",value:function(e){if(!1!==this.enabled)switch(e.preventDefault(),this.state){case Jy.ROTATE:if(!1===this.enableRotate)return;this.handleMouseMoveRotate(e);break;case Jy.DOLLY:if(!1===this.enableZoom)return;this.handleMouseMoveDolly(e)}}},{key:"onMouseUp",value:function(e){if(!1!==this.enabled){switch(this.handleMouseUp(e),document.removeEventListener("mousemove",this.onMouseMove.bind(this),!1),document.removeEventListener("mouseup",this.onMouseUp.bind(this),!1),this.state){case Jy.ROTATE:this.dispatchEvent({type:this.endEvent.type,state:"rotate"});break;case Jy.DOLLY:this.dispatchEvent({type:this.endEvent.type,state:"zoom"});break;default:this.dispatchEvent({type:this.endEvent.type,state:"any"})}this.state=Jy.NONE}}},{key:"onMouseWheel",value:function(e){!1===this.enabled||!1===this.enableZoom||this.state!==Jy.NONE&&this.state!==Jy.ROTATE||(e.preventDefault(),e.stopPropagation(),this.dispatchEvent({type:this.startEvent.type,state:"zoom"}),this.handleMouseWheel(e),this.dispatchEvent({type:this.endEvent.type,state:"zoom"}))}},{key:"onTouchStart",value:function(e){if(!1!==this.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(this.touches.ONE===rg.ROTATE){if(!1===this.enableRotate)return;this.handleTouchStartRotate(e),this.state=Jy.TOUCH_ROTATE}else this.state=Jy.NONE;break;case 2:if(this.touches.TWO===rg.DOLLY_ROTATE){if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchStartDollyRotate(e),this.state=Jy.TOUCH_DOLLY_ROTATE}else this.state=Jy.NONE;break;default:this.state=Jy.NONE}if(this.state!==Jy.NONE)if(this.state===Jy.TOUCH_ROTATE)this.dispatchEvent({type:this.startEvent.type,state:"rotate"});else this.dispatchEvent({type:this.startEvent.type,state:"any"})}}},{key:"onTouchMove",value:function(e){if(!1!==this.enabled)switch(e.preventDefault(),e.stopPropagation(),this.state){case Jy.TOUCH_ROTATE:if(!1===this.enableRotate)return;this.handleTouchMoveRotate(e),this.update();break;case Jy.TOUCH_DOLLY_ROTATE:if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchMoveDollyRotate(e),this.update();break;default:this.state=Jy.NONE}}},{key:"onTouchEnd",value:function(e){if(!1!==this.enabled){if(this.handleTouchEnd(e),this.state===Jy.TOUCH_ROTATE)this.dispatchEvent({type:this.endEvent.type,state:"rotate"});else this.dispatchEvent({type:this.endEvent.type,state:"any"});this.state=Jy.NONE}}},{key:"onContextMenu",value:function(e){!1!==this.enabled&&e.preventDefault()}},{key:"addEventListener",value:function(e,t){void 0===this._listeners[e]&&(this._listeners[e]=[]),-1===this._listeners[e].indexOf(t)&&this._listeners[e].push(t)}},{key:"hasEventListener",value:function(e,t){return void 0!==this._listeners[e]&&-1!==this._listeners[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},{key:"dispatchEvent",value:function(e){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e);e.target=null}}}])}();function ug(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ug=function(){return!!e})()}var cg=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,ug()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mControls",void 0),(0,c.A)(r,"mEnabled",!0),(0,c.A)(r,"mActiveEntity",void 0),(0,c.A)(r,"mPosition",te.P.Zero()),(0,c.A)(r,"mTarget",te.P.Zero()),(0,c.A)(r,"mZoomEnabled",void 0),(0,c.A)(r,"mMinZoom",void 0),(0,c.A)(r,"mMaxZoom",void 0),(0,c.A)(r,"mDirection",void 0),(0,c.A)(r,"mMinPolar",void 0),(0,c.A)(r,"mMaxPolar",void 0),(0,c.A)(r,"mMinAzimuth",void 0),(0,c.A)(r,"mMaxAzimuth",void 0),(0,c.A)(r,"mDampEnabled",void 0),(0,c.A)(r,"mDampFactor",void 0),(0,c.A)(r,"mAutoRotate",void 0),(0,c.A)(r,"mRotationSpeed",void 0),(0,c.A)(r,"mRotateState",ve.Unchanged),(0,c.A)(r,"mPanState",ve.Unchanged),(0,c.A)(r,"mZoomState",ve.Unchanged),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadCameraControls",value:function(){var e=this.mCamera.getSceneEntity(),t=e.getComponent("turntable-camera-controls");this.mEnabled=t.enabled,this.mPosition.copy(e.transform.position),this.mTarget.copy(e.target),this.mZoomEnabled=t.zoomEnabled,this.mMinZoom=t.zoomMin,this.mMaxZoom=t.zoomMax,this.mDirection=t.direction,this.mMinPolar=t.polarAngleMin,this.mMaxPolar=t.polarAngleMax,this.mMinAzimuth=t.azimuthAngleMin,this.mMaxAzimuth=t.azimuthAngleMax,this.mDampEnabled=t.dampingEnabled,this.mDampFactor=t.dampingFactor,this.mAutoRotate=!1,this.mRotationSpeed=t.rotationSpeed,this.mActiveEntity=t.getValue("active_object")}},{key:"createCameraControls",value:function(){var e=this.mCamera.getCamera(),t=this.mPosition.clone(),n=this.mTarget.clone();if(this.mRenderer.isRightHandedSystemActive()||(t.toggleCoordSystem(),n.toggleCoordSystem()),e||(e=new BABYLON.UniversalCamera(this.mCamera.getCameraName(),new BABYLON.Vector3(t.x,t.y,t.z),this.mRenderer.getScene()),this.mCamera.setCamera(e)),e.position||(e.position=new BABYLON.Vector3),e.position.set(t.x,t.y,t.z),e.setEnabled(this.mEnabled),e.setTarget(new BABYLON.Vector3(n.x,n.y,n.z)),e.inputs.clear(),!this.mControls){var r=this.mDirection===Pe.Theta?te.P.AxisY():te.P.AxisX();this.mControls=new sg(this.mCamera.getSceneEntity(),this.mActiveEntity,r,this.mRenderer.getCanvas())}this.mControls.enabled=this.mEnabled&&!!this.mActiveEntity,this.mControls.rotateSpeed=this.mRotationSpeed,this.mControls.autoRotate=this.mAutoRotate,this.mControls.enableDamping=this.mDampEnabled,Number.isFinite(this.mDampFactor)&&(this.mControls.dampingFactor=this.mDampFactor);var i=new te.P,a=new og;i.applyQuaternion((new ne.P).setFromUnitVectors(new te.P(e.upVector.x,e.upVector.y,e.upVector.z),new te.P(0,1,0))),a.setFromVector3(i),a.makeSafe(),this.mDirection===Pe.Phi?(this.mControls.minPolarAngle=this.mMinPolar,this.mControls.maxPolarAngle=this.mMaxPolar,this.mControls.minAzimuthAngle=a.theta,this.mControls.maxAzimuthAngle=a.theta):(this.mControls.minAzimuthAngle=this.mMinAzimuth,this.mControls.maxAzimuthAngle=this.mMaxAzimuth,this.mControls.minPolarAngle=a.phi,this.mControls.maxPolarAngle=a.phi),this.mControls.enableZoom=this.mZoomEnabled,this.mControls.minDistance=this.mMinZoom,this.mControls.maxDistance=this.mMaxZoom,this.mCamera.attachCamera()}},{key:"update",value:function(e){this.mControls&&this.mControls.update()}},{key:"onUpdateDirty",value:function(){var e=this.mCamera.getSceneEntity();this.loadCameraControls(),this.createCameraControls(),e.getComponent("turntable-camera-controls").setNeedsRenderUpdate(!1)}},{key:"destroyCameraControls",value:function(){this.mControls.dispose(),this.mControls=void 0}},{key:"onAttached",value:function(){this.mControls&&(this.mControls.addEventListener("start",this.onChangeStart.bind(this)),this.mControls.addEventListener("end",this.onChangeEnd.bind(this)),this.mControls.addEventListener("change",this.onChange.bind(this)),this.mControls.addEventListener("zoom",this.onZoom.bind(this)))}},{key:"onDetached",value:function(){this.mControls&&(this.mControls.removeEventListener("start",this.onChangeStart.bind(this)),this.mControls.removeEventListener("end",this.onChangeEnd.bind(this)),this.mControls.removeEventListener("change",this.onChange.bind(this)),this.mControls.removeEventListener("zoom",this.onZoom.bind(this)))}},{key:"onZoom",value:function(){if(this.mControls){var e=this.mCamera.getSceneEntity(),t=e.transform.position.clone().sub(this.mActiveEntity.transform.position).normalize(),n=this.mControls.getRadius(),r=this.mActiveEntity.transform.position.clone().addScaledVector(t,n);e.transform.position.copy(r),e.markNeedsRenderUpdate(),this.onControlsZoom()}}},{key:"onChangeStart",value:function(e){if(this.mControls&&"start"===e.type)switch(e.state){case"zoom":this.mZoomState=ve.Started,this.onControlsZoom();break;case"rotate":this.mRotateState=ve.Started,this.onControlsChange();break;case"pan":this.mPanState=ve.Started,this.onControlsChange()}}},{key:"onChangeEnd",value:function(e){if(this.mControls&&"end"===e.type)switch(e.state){case"zoom":this.mZoomState=ve.Ended,this.onControlsZoom();break;case"rotate":this.mRotateState=ve.Ended,this.onControlsChange();break;case"pan":this.mPanState=ve.Ended,this.onControlsChange()}}},{key:"onChange",value:function(e){if(this.mControls)switch(e.state){case"zoom":this.mZoomState=ve.Ended,this.onControlsZoom();break;case"rotate":this.mRotateState=ve.Ended,this.onControlsChange();break;case"pan":this.mPanState=ve.Ended,this.onControlsChange();break;case"any":this.mRotateState===ve.Started&&(this.mRotateState=ve.Changed),this.mPanState===ve.Started&&(this.mPanState=ve.Changed),this.mRotateState!==ve.Changed&&this.mPanState!==ve.Changed||this.onControlsChange(),this.mZoomState===ve.Started&&(this.mZoomState=ve.Changed,this.onControlsZoom())}}},{key:"onControlsChange",value:function(){this.mPanState!==ve.Unchanged&&R.K.eventBus().dispatch(new Me(ge.Pan,this.mPanState)),this.mRotateState!==ve.Unchanged&&R.K.eventBus().dispatch(new Me(ge.Rotate,this.mRotateState))}},{key:"onControlsZoom",value:function(){R.K.eventBus().dispatch(new Ce(this.mZoomState))}},{key:"getComponentName",value:function(){return"turntable-camera-controls"}}])}(Zy);function lg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lg=function(){return!!e})()}var hg=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,lg()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mEnabled",!0),(0,c.A)(r,"mPosition",te.P.Zero()),(0,c.A)(r,"mTarget",te.P.Zero()),(0,c.A)(r,"mMovementSpeed",void 0),(0,c.A)(r,"mConstrainVertical",void 0),(0,c.A)(r,"mKeysEnabled",void 0),(0,c.A)(r,"mLookSpeed",void 0),(0,c.A)(r,"mPreviousPosition",te.P.Zero()),(0,c.A)(r,"mPreviousQuaternion",ne.P.identity()),(0,c.A)(r,"mPreviousTarget",te.P.Zero()),(0,c.A)(r,"mIsPanning",!1),(0,c.A)(r,"mIsRotating",!1),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadCameraControls",value:function(){var e=this.mCamera.getSceneEntity(),t=e.getComponent("fps-camera-controls");this.mEnabled=t.enabled,this.mPosition.copy(e.transform.position),this.mTarget.copy(e.target),this.mMovementSpeed=t.movementSpeed,this.mConstrainVertical=t.constrainVertical,this.mKeysEnabled=t.keyboardEnabled,this.mLookSpeed=t.lookSpeed}},{key:"createCameraControls",value:function(){var e=this.mCamera.getCamera(),t=this.mPosition.clone(),n=this.mTarget.clone();this.mRenderer.isRightHandedSystemActive()||(t.toggleCoordSystem(),n.toggleCoordSystem()),e||(e=new BABYLON.UniversalCamera(this.mCamera.getCameraName(),new BABYLON.Vector3(t.x,t.y,t.z),this.mRenderer.getScene()),this.mCamera.setCamera(e)),e.position=new BABYLON.Vector3(t.x,t.y,t.z),e.setTarget(new BABYLON.Vector3(n.x,n.y,n.z)),e.setEnabled(this.mEnabled),e.inputs.clear(),e.inputs.addMouse(!0),e.inputs.addMouseWheel(),this.mKeysEnabled&&(e.inputs.addKeyboard(),e.keysUp.push(38,87),e.keysLeft.push(37,65),e.keysDown.push(40,83),e.keysRight.push(39,68)),e.inertia=0,e.checkCollisions=!1,e.applyGravity=!1,e.noRotationConstraint=!0,e.invertRotation=!1,e.speed=.05*this.mMovementSpeed,e.angularSensibility=.1/this.mLookSpeed*3750,this.mPreviousPosition.set(e.position.x,e.position.y,e.position.z),this.mPreviousTarget.set(e.target.x,e.target.y,e.target.z),this.mPreviousQuaternion.set(e.absoluteRotation.x,e.absoluteRotation.y,e.absoluteRotation.z,e.absoluteRotation.w),this.mCamera.attachCamera()}},{key:"update",value:function(e){var t=this.mCamera.getSceneEntity(),n=this.mCamera.getCamera(),r=!1,i=!1;this.didPan()&&(t.transform.position.set(n.position.x,n.position.y,n.position.z),r=!0),this.didRotate()&&(t.target.set(n.target.x,n.target.y,n.target.z),t.transform.quaternion.set(n.absoluteRotation.x,n.absoluteRotation.y,n.absoluteRotation.z,n.absoluteRotation.w),r||(i=!0)),this.mPreviousPosition.set(n.position.x,n.position.y,n.position.z),this.mPreviousTarget.set(n.target.x,n.target.y,n.target.z);var a=ve.Unchanged,o=ve.Unchanged;r&&!this.mIsPanning?a=ve.Started:!r&&this.mIsPanning?a=ve.Ended:r&&(a=ve.Changed),i&&!this.mIsRotating?o=ve.Started:!i&&this.mIsRotating?o=ve.Ended:i&&(o=ve.Changed),this.mIsPanning=r,this.mIsRotating=i,a!==ve.Unchanged&&R.K.eventBus().dispatch(new Me(ge.Pan,a)),o!==ve.Unchanged&&R.K.eventBus().dispatch(new Me(ge.Rotate,o))}},{key:"onUpdateDirty",value:function(){var e=this.mCamera.getSceneEntity();this.loadCameraControls(),this.createCameraControls(),e.getComponent("fps-camera-controls").setNeedsRenderUpdate(!1)}},{key:"destroyCameraControls",value:function(){}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}},{key:"getComponentName",value:function(){return"fps-camera-controls"}},{key:"didPan",value:function(){var e=this.mCamera.getCamera(),t=this.mPreviousPosition.x-e.position.x,n=this.mPreviousPosition.y-e.position.y,r=this.mPreviousPosition.z-e.position.z;return t*t+n*n+r*r>1e-8}},{key:"didRotate",value:function(){var e=this.mCamera.getCamera(),t=this.mPreviousTarget.x-e.target.x,n=this.mPreviousTarget.y-e.target.y,r=this.mPreviousTarget.z-e.target.z;return t*t+n*n+r*r>1e-8}}])}(Zy);function fg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fg=function(){return!!e})()}var mg=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,fg()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mEnabled",!0),(0,c.A)(r,"mPosition",te.P.Zero()),(0,c.A)(r,"mTarget",te.P.Zero()),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadCameraControls",value:function(){var e=this.mCamera.getSceneEntity();this.mPosition.copy(e.transform.position),this.mTarget.copy(e.target)}},{key:"createCameraControls",value:function(){var e=this.mCamera.getCamera(),t=this.mPosition.clone(),n=this.mTarget.clone();this.mRenderer.isRightHandedSystemActive()||(t.toggleCoordSystem(),n.toggleCoordSystem()),e||(e=new BABYLON.UniversalCamera(this.mCamera.getCameraName(),new BABYLON.Vector3(t.x,t.y,t.z),this.mRenderer.getScene()),this.mCamera.setCamera(e)),e.position=new BABYLON.Vector3(t.x,t.y,t.z),e.setTarget(new BABYLON.Vector3(n.x,n.y,n.z)),e.setEnabled(this.mEnabled),e.inputs.clear(),this.mCamera.attachCamera()}},{key:"update",value:function(e){}},{key:"onUpdateDirty",value:function(){this.loadCameraControls(),this.createCameraControls()}},{key:"destroyCameraControls",value:function(){}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}},{key:"getComponentName",value:function(){return"no-camera-controls"}}])}(Zy);function pg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pg=function(){return!!e})()}function dg(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var vg=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,pg()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mNear",.1),(0,c.A)(r,"mFar",1e3),(0,c.A)(r,"mFov",45),(0,c.A)(r,"mAspectRatio",1),(0,c.A)(r,"mCameraName","Camera Perspective"),(0,c.A)(r,"mControls",void 0),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.loadResourceFromEntity();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"loadResourceFromEntity",value:function(){var e=this.mSceneEntity;this.mCameraName=e.name,this.mFov=e.fov,this.mAspectRatio=e.getValue("aspect_ratio")||1,this.mNear=e.near,this.mFar=e.far;var t=e.getComponents(de.TypeRTTI),n=t.length>0?t[0]:void 0,r=null==n?void 0:n.getComponentName();if(!this.mControls||this.mControls.getComponentName()===r)switch(r){case"fps-camera-controls":this.mControls=new hg(this,this.getRenderer());break;case"turntable-camera-controls":this.mControls=new cg(this,this.getRenderer());break;case"orbit-camera-controls":this.mControls=new ag(this,this.getRenderer());break;default:this.mControls=new mg(this,this.getRenderer())}this.mControls.loadCameraControls()}},{key:"createRenderObject",value:function(){var e,t=this.mSceneEntity;null===(e=this.mControls)||void 0===e||e.createCameraControls();var n=this.mRenderObject;n.name=this.mCameraName,n.mode=BABYLON.Camera.PERSPECTIVE_CAMERA,n.fovMode=BABYLON.Camera.FOVMODE_VERTICAL_FIXED,t.needsProjectionMatrixUpdate()&&(n.minZ=this.mNear,n.maxZ=this.mFar,n.fov=(0,_.pu)(this.mFov),t.setProjectionMatrixUpdate(!1)),n.attachControl(this.getRenderer().getCanvas(),!0)}},{key:"destroyRenderObject",value:function(){var e;null===(e=this.mControls)||void 0===e||e.destroyCameraControls(),dg(t,"destroyRenderObject",this,3)([])}},{key:"onUpdateDirty",value:function(){var e;dg(t,"onUpdateDirty",this,3)([]),this.loadResourceFromEntity(),this.createRenderObject(),null===(e=this.mControls)||void 0===e||e.onUpdateDirty()}},{key:"update",value:function(e){var n;null===(n=this.mControls)||void 0===n||n.update(e),dg(t,"update",this,3)([e])}},{key:"updateTranslation",value:function(){return!1}},{key:"attach",value:function(){var e;dg(t,"attach",this,3)([]),null===(e=this.mControls)||void 0===e||e.onAttached(),this.mRenderer.setCameraActive(this)}},{key:"detach",value:function(){var e;dg(t,"detach",this,3)([]),null===(e=this.mControls)||void 0===e||e.onDetached()}},{key:"getSceneEntity",value:function(){return this.mSceneEntity}},{key:"isOrthographic",value:function(){return!1}},{key:"isPerspective",value:function(){return!0}},{key:"getCamera",value:function(){return this.mRenderObject}},{key:"setCamera",value:function(e){this.mRenderObject=e}},{key:"getCameraName",value:function(){return this.mCameraName}},{key:"attachCamera",value:function(){this.mRenderObject.attachControl(this.getRenderer().getCanvas(),!0)}},{key:"detachCamera",value:function(){this.mRenderObject.detachControl()}}]);var r}(Vd),yg=__webpack_require__(17632);function gg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gg=function(){return!!e})()}var bg=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,gg()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mInternalMaterial",void 0),(0,c.A)(r,"mEnvMapScale",ee.I.One()),(0,c.A)(r,"mFresnelDiffuseColor",Ft.v.Black()),(0,c.A)(r,"mNormalMapScale",ee.I.One()),(0,c.A)(r,"mEmissiveColor",Ft.v.Black()),(0,c.A)(r,"mSpecularColor",new Ft.v(.04,.067,.067)),(0,c.A)(r,"mShininess",30),(0,c.A)(r,"mLightMapIntensity",1),(0,c.A)(r,"mBumpMapLevel",1),(0,c.A)(r,"mDiffuseColor",Ft.v.White()),(0,c.A)(r,"mEnvMapCombineOp",Hd.Am.Multiply),(0,c.A)(r,"mDiffuseMap",void 0),(0,c.A)(r,"mAlphaMap",void 0),(0,c.A)(r,"mAoMap",void 0),(0,c.A)(r,"mBumpMap",void 0),(0,c.A)(r,"mNormalMap",void 0),(0,c.A)(r,"mLightMap",void 0),(0,c.A)(r,"mEmissiveMap",void 0),(0,c.A)(r,"mSpecularMap",void 0),(0,c.A)(r,"mEnvMap",void 0),(0,c.A)(r,"mDirty",!1),(0,c.A)(r,"mAlphaTestEnabled",!1),(0,c.A)(r,"mTransparent",!1),(0,c.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Fs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getEnvMapScale",value:function(){return this.mEnvMapScale}},{key:"setEnvMapScale",value:function(e){this.mEnvMapScale.copy(e),this.mEnvMap&&this.mEnvMap.getInternalTexture().scale(this.mEnvMapScale.x)}},{key:"isFresnelDiffuseEnabled",value:function(){return!0}},{key:"setFresnelDiffuseEnabled",value:function(e){}},{key:"getFresnelDiffuseBias",value:function(){return.01}},{key:"setFresnelDiffuseBias",value:function(e){}},{key:"getFresnelDiffuseScale",value:function(){return 1}},{key:"setFresnelDiffuseScale",value:function(e){}},{key:"getFresnelDiffusePower",value:function(){return 1}},{key:"setFresnelDiffusePower",value:function(e){}},{key:"getFresnelDiffuseColor",value:function(){return this.mFresnelDiffuseColor}},{key:"setFresnelDiffuseColor",value:function(e){}},{key:"isFresnelEnvMapEnabled",value:function(){return!0}},{key:"setFresnelEnvMapEnabled",value:function(e){}},{key:"getFresnelEnvMapBias",value:function(){return.01}},{key:"setFresnelEnvMapBias",value:function(e){}},{key:"getFresnelEnvMapScale",value:function(){return 1}},{key:"setFresnelEnvMapScale",value:function(e){}},{key:"getFresnelEnvMapPower",value:function(){return 1}},{key:"setFresnelEnvMapPower",value:function(e){}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel,this.mInternalMaterial.bumpTexture.coordinatesMode=vv(e))}},{key:"getBumpScale",value:function(){return this.mBumpMapLevel}},{key:"setBumpScale",value:function(e){this.mBumpMapLevel=e,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel)}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.setNormalScale(this.mNormalMapScale),this.mInternalMaterial.bumpTexture.coordinatesMode=vv(e))}},{key:"getNormalScale",value:function(){return this.mNormalMapScale}},{key:"setNormalScale",value:function(e){this.mNormalMapScale.copy(e),this.mInternalMaterial.bumpTexture&&this.mInternalMaterial.bumpTexture.scale(this.mNormalMapScale.x)}},{key:"getDisplacementMap",value:function(){}},{key:"setDisplacementMap",value:function(e){}},{key:"getDisplacementScale",value:function(){return 1}},{key:"setDisplacementScale",value:function(e){}},{key:"getDisplacementBias",value:function(){return.01}},{key:"setDisplacementBias",value:function(e){}},{key:"getSpecular",value:function(){return this.mSpecularColor}},{key:"setSpecular",value:function(e){this.mSpecularColor.copy(e),this.mInternalMaterial.reflectivityColor.set(this.mSpecularColor.r,this.mSpecularColor.g,this.mSpecularColor.b)}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightmapTexture=e?e.getInternalTexture():null,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity,this.mInternalMaterial.lightmapTexture.coordinatesMode=vv(e))}},{key:"getLightMapIntensity",value:function(){return this.mLightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mLightMapIntensity=e,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.environmentIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.environmentIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveTexture=e?e.getInternalTexture():null,this.mInternalMaterial.emissiveTexture&&(this.mInternalMaterial.emissiveTexture.coordinatesMode=vv(e))}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getShininess",value:function(){return this.mShininess}},{key:"setShininess",value:function(e){this.mShininess=e,this.mInternalMaterial.specularIntensity=this.mShininess/100}},{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null,this.mInternalMaterial.albedoTexture&&(this.mInternalMaterial.albedoTexture.coordinatesMode=vv(e))}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.opacityTexture&&(this.mInternalMaterial.opacityTexture.coordinatesMode=vv(e))}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null,this.mInternalMaterial.ambientTexture&&(this.mInternalMaterial.ambientTexture.coordinatesMode=vv(e))}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectivityTexture&&(this.mInternalMaterial.reflectivityTexture.coordinatesMode=vv(e))}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectionTexture&&(this.mInternalMaterial.reflectionTexture.coordinatesMode=vv(e,!0)),e&&this.setEnvMapScale(this.mEnvMapScale)}},{key:"getEnvMapCombine",value:function(){return this.mEnvMapCombineOp}},{key:"setEnvMapCombine",value:function(e){this.mEnvMapCombineOp=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectionColor.r}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectionColor.set(e,e,e)}},{key:"getIOR",value:function(){return this.mInternalMaterial.indexOfRefraction}},{key:"setIOR",value:function(e){this.mInternalMaterial.indexOfRefraction=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Hd.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return fv(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=mv(e)}},{key:"getTransparencyMode",value:function(){return pv(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=dv(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Hd.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return lv(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=hv(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Fs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mFresnelDiffuseColor.copy(e.mFresnelDiffuseColor),this.mEnvMapScale.copy(e.mEnvMapScale),this.mNormalMapScale.copy(e.mNormalMapScale),this.mEmissiveColor.copy(e.mEmissiveColor),this.mSpecularColor.copy(e.mSpecularColor),this.mShininess=e.mShininess,this.mLightMapIntensity=e.mLightMapIntensity,this.mBumpMapLevel=e.mBumpMapLevel,this.mDiffuseColor.copy(e.mDiffuseColor),this.mEnvMapScale.copy(e.mEnvMapScale),this.mEnvMapCombineOp=e.mEnvMapCombineOp,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mLightMap=e.mLightMap,this.mEmissiveMap=e.mEmissiveMap,this.mSpecularMap=e.mSpecularMap,this.mEnvMap=e.mEnvMap,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(yg.t);function Ag(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ag=function(){return!!e})()}var _g=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,Ag()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mInternalMaterial",void 0),(0,c.A)(r,"mDiffuseColor",Ft.v.White()),(0,c.A)(r,"mEmissiveColor",Ft.v.Black()),(0,c.A)(r,"mNormalMapScale",ee.I.One()),(0,c.A)(r,"mBumpMapLevel",1),(0,c.A)(r,"mLightMapIntensity",1),(0,c.A)(r,"mDiffuseMap",void 0),(0,c.A)(r,"mAlphaMap",void 0),(0,c.A)(r,"mAoMap",void 0),(0,c.A)(r,"mBumpMap",void 0),(0,c.A)(r,"mNormalMap",void 0),(0,c.A)(r,"mLightMap",void 0),(0,c.A)(r,"mEnvMap",void 0),(0,c.A)(r,"mEmissiveMap",void 0),(0,c.A)(r,"mRoughnessMap",void 0),(0,c.A)(r,"mMetalnessMap",void 0),(0,c.A)(r,"mSpecularMap",void 0),(0,c.A)(r,"mDirty",!1),(0,c.A)(r,"mAlphaTestEnabled",!1),(0,c.A)(r,"mTransparent",!1),(0,c.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Fs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null,this.mInternalMaterial.albedoTexture&&(this.mInternalMaterial.albedoTexture.coordinatesMode=vv(e))}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.opacityTexture&&(this.mInternalMaterial.opacityTexture.coordinatesMode=vv(e))}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null,this.mInternalMaterial.ambientTexture&&(this.mInternalMaterial.ambientTexture.coordinatesMode=vv(e))}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectivityTexture&&(this.mInternalMaterial.reflectivityTexture.coordinatesMode=vv(e))}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectionTexture&&(this.mInternalMaterial.reflectionTexture.coordinatesMode=vv(e,!0))}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectionColor.r}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectionColor.set(e,e,e)}},{key:"getIOR",value:function(){return this.mInternalMaterial.indexOfRefraction}},{key:"setIOR",value:function(e){this.mInternalMaterial.indexOfRefraction=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel,this.mInternalMaterial.bumpTexture.coordinatesMode=vv(e))}},{key:"getBumpScale",value:function(){return this.mBumpMapLevel}},{key:"setBumpScale",value:function(e){this.mBumpMapLevel=e,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel)}},{key:"getDisplacementMap",value:function(){}},{key:"setDisplacementMap",value:function(e){}},{key:"getDisplacementScale",value:function(){return 1}},{key:"setDisplacementScale",value:function(e){}},{key:"getDisplacementBias",value:function(){return.01}},{key:"setDisplacementBias",value:function(e){}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveTexture=e?e.getInternalTexture():null,this.mInternalMaterial.emissiveTexture&&(this.mInternalMaterial.emissiveTexture.coordinatesMode=vv(e))}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.environmentIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.environmentIntensity=e}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightmapTexture=e?e.getInternalTexture():null,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity,this.mInternalMaterial.lightmapTexture.coordinatesMode=vv(e))}},{key:"getLightMapIntensity",value:function(){return this.mLightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mLightMapIntensity=e,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metallic}},{key:"setMetalness",value:function(e){this.mInternalMaterial.metallic=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mMetalnessMap=e,this.mInternalMaterial.metallicTexture=e?e.getInternalTexture():null}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.setNormalScale(this.mNormalMapScale),this.mInternalMaterial.bumpTexture.coordinatesMode=vv(e))}},{key:"getNormalScale",value:function(){return this.mNormalMapScale}},{key:"setNormalScale",value:function(e){this.mNormalMapScale.copy(e),this.mInternalMaterial.bumpTexture&&this.mInternalMaterial.bumpTexture.scale(this.mNormalMapScale.x)}},{key:"getRoughness",value:function(){return this.mInternalMaterial.microSurface}},{key:"setRoughness",value:function(e){this.mInternalMaterial.microSurface=e}},{key:"getRoughnessMap",value:function(){return this.mRoughnessMap}},{key:"setRoughnessMap",value:function(e){this.mRoughnessMap=e,this.mInternalMaterial.microSurfaceTexture=e?e.getInternalTexture():null,this.mInternalMaterial.microSurfaceTexture&&(this.mInternalMaterial.microSurfaceTexture.coordinatesMode=vv(e))}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Hd.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return fv(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=mv(e)}},{key:"getTransparencyMode",value:function(){return pv(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=dv(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Hd.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return lv(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=hv(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Fs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mNormalMapScale.copy(e.mNormalMapScale),this.mBumpMapLevel=e.mBumpMapLevel,this.mLightMapIntensity=e.mLightMapIntensity,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mRoughnessMap=e.mRoughnessMap,this.mMetalnessMap=e.mMetalnessMap,this.mSpecularMap=e.mSpecularMap,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Dn.r),Mg=__webpack_require__(72713);function kg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kg=function(){return!!e})()}var wg=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,kg()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mInternalMaterial",void 0),(0,c.A)(r,"mFresnelDiffuseColor",Ft.v.Black()),(0,c.A)(r,"mSpecularColor",new Ft.v(.04,.067,.067)),(0,c.A)(r,"mDiffuseColor",Ft.v.White()),(0,c.A)(r,"mEnvMapScale",ee.I.One()),(0,c.A)(r,"mEmissiveColor",Ft.v.Black()),(0,c.A)(r,"mNormalMapScale",ee.I.One()),(0,c.A)(r,"mBumpMapLevel",1),(0,c.A)(r,"mLightMapIntensity",1),(0,c.A)(r,"mDiffuseMap",void 0),(0,c.A)(r,"mAlphaMap",void 0),(0,c.A)(r,"mAoMap",void 0),(0,c.A)(r,"mBumpMap",void 0),(0,c.A)(r,"mNormalMap",void 0),(0,c.A)(r,"mLightMap",void 0),(0,c.A)(r,"mEnvMap",void 0),(0,c.A)(r,"mEmissiveMap",void 0),(0,c.A)(r,"mRoughnessMap",void 0),(0,c.A)(r,"mMetalnessMap",void 0),(0,c.A)(r,"mSpecularMap",void 0),(0,c.A)(r,"mGlossinessMap",void 0),(0,c.A)(r,"mDirty",!1),(0,c.A)(r,"mAlphaTestEnabled",!1),(0,c.A)(r,"mTransparent",!1),(0,c.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Fs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getEnvMapScale",value:function(){return this.mEnvMapScale}},{key:"setEnvMapScale",value:function(e){this.mEnvMapScale.copy(e),this.mEnvMap&&this.mEnvMap.getInternalTexture().scale(this.mEnvMapScale.x)}},{key:"isSpecularGlossinessEnabled",value:function(){return!0}},{key:"setSpecularGlossinessEnabled",value:function(e){}},{key:"getSpecular",value:function(){return this.mSpecularColor}},{key:"setSpecular",value:function(e){this.mSpecularColor.copy(e)}},{key:"getGlossiness",value:function(){return 1-this.mInternalMaterial.microSurface}},{key:"setGlossiness",value:function(e){this.mInternalMaterial.microSurface=1-e}},{key:"getGlossinessMap",value:function(){return this.mGlossinessMap}},{key:"setGlossinessMap",value:function(e){this.mGlossinessMap=e,this.mInternalMaterial.microSurfaceTexture=e?e.getInternalTexture():null}},{key:"isFresnelDiffuseEnabled",value:function(){return!0}},{key:"setFresnelDiffuseEnabled",value:function(e){}},{key:"getFresnelDiffuseBias",value:function(){return.01}},{key:"setFresnelDiffuseBias",value:function(e){}},{key:"getFresnelDiffuseScale",value:function(){return 1}},{key:"setFresnelDiffuseScale",value:function(e){}},{key:"getFresnelDiffusePower",value:function(){return 1}},{key:"setFresnelDiffusePower",value:function(e){}},{key:"getFresnelDiffuseColor",value:function(){return this.mFresnelDiffuseColor}},{key:"setFresnelDiffuseColor",value:function(e){}},{key:"isFresnelEnvMapEnabled",value:function(){return!0}},{key:"setFresnelEnvMapEnabled",value:function(e){}},{key:"getFresnelEnvMapBias",value:function(){return.01}},{key:"setFresnelEnvMapBias",value:function(e){}},{key:"getFresnelEnvMapScale",value:function(){return 1}},{key:"setFresnelEnvMapScale",value:function(e){}},{key:"getFresnelEnvMapPower",value:function(){return 1}},{key:"setFresnelEnvMapPower",value:function(e){}},{key:"getClearCoat",value:function(){return this.mInternalMaterial.clearCoat.intensity}},{key:"setClearCoat",value:function(e){this.mInternalMaterial.clearCoat.isEnabled=!0,this.mInternalMaterial.clearCoat.intensity=e}},{key:"getClearCoatRoughness",value:function(){return this.mInternalMaterial.clearCoat.roughness}},{key:"setClearCoatRoughness",value:function(e){this.mInternalMaterial.clearCoat.isEnabled=!0,this.mInternalMaterial.clearCoat.roughness=e}},{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null,this.mInternalMaterial.albedoTexture&&(this.mInternalMaterial.albedoTexture.coordinatesMode=vv(e))}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.opacityTexture&&(this.mInternalMaterial.opacityTexture.coordinatesMode=vv(e))}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null,this.mInternalMaterial.ambientTexture&&(this.mInternalMaterial.ambientTexture.coordinatesMode=vv(e))}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectivityTexture&&(this.mInternalMaterial.reflectivityTexture.coordinatesMode=vv(e))}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectionTexture&&(this.mInternalMaterial.reflectionTexture.coordinatesMode=vv(e,!0)),e&&this.setEnvMapScale(this.mEnvMapScale)}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectionColor.r}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectionColor.set(e,e,e)}},{key:"getIOR",value:function(){return this.mInternalMaterial.indexOfRefraction}},{key:"setIOR",value:function(e){this.mInternalMaterial.indexOfRefraction=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel,this.mInternalMaterial.bumpTexture.coordinatesMode=vv(e))}},{key:"getBumpScale",value:function(){return this.mBumpMapLevel}},{key:"setBumpScale",value:function(e){this.mBumpMapLevel=e,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel)}},{key:"getDisplacementMap",value:function(){}},{key:"setDisplacementMap",value:function(e){}},{key:"getDisplacementScale",value:function(){return 1}},{key:"setDisplacementScale",value:function(e){}},{key:"getDisplacementBias",value:function(){return.01}},{key:"setDisplacementBias",value:function(e){}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveTexture=e?e.getInternalTexture():null,this.mInternalMaterial.emissiveTexture&&(this.mInternalMaterial.emissiveTexture.coordinatesMode=vv(e))}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.environmentIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.environmentIntensity=e}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightmapTexture=e?e.getInternalTexture():null,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity,this.mInternalMaterial.lightmapTexture.coordinatesMode=vv(e))}},{key:"getLightMapIntensity",value:function(){return this.mLightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mLightMapIntensity=e,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metallic}},{key:"setMetalness",value:function(e){this.mInternalMaterial.metallic=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mMetalnessMap=e,this.mInternalMaterial.metallicTexture=e?e.getInternalTexture():null}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.setNormalScale(this.mNormalMapScale),this.mInternalMaterial.bumpTexture.coordinatesMode=vv(e))}},{key:"getNormalScale",value:function(){return this.mNormalMapScale}},{key:"setNormalScale",value:function(e){this.mNormalMapScale.copy(e),this.mInternalMaterial.bumpTexture&&this.mInternalMaterial.bumpTexture.scale(this.mNormalMapScale.x)}},{key:"getRoughness",value:function(){return this.mInternalMaterial.microSurface}},{key:"setRoughness",value:function(e){this.mInternalMaterial.microSurface=e}},{key:"getRoughnessMap",value:function(){return this.mRoughnessMap}},{key:"setRoughnessMap",value:function(e){this.mRoughnessMap=e,this.mInternalMaterial.microSurfaceTexture=e?e.getInternalTexture():null,this.mInternalMaterial.microSurfaceTexture&&(this.mInternalMaterial.microSurfaceTexture.coordinatesMode=vv(e))}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Hd.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return fv(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=mv(e)}},{key:"getTransparencyMode",value:function(){return pv(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=dv(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Hd.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return lv(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=hv(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Fs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mEnvMapScale.copy(e.mEnvMapScale),this.mFresnelDiffuseColor.copy(e.mFresnelDiffuseColor),this.mSpecularColor.copy(e.mSpecularColor),this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mEnvMapScale.copy(e.mEnvMapScale),this.mNormalMapScale.copy(e.mNormalMapScale),this.mBumpMapLevel=e.mBumpMapLevel,this.mLightMapIntensity=e.mLightMapIntensity,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mRoughnessMap=e.mRoughnessMap,this.mMetalnessMap=e.mMetalnessMap,this.mSpecularMap=e.mSpecularMap,this.mGlossinessMap=e.mGlossinessMap,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Mg.K),Tg=__webpack_require__(8015);function xg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xg=function(){return!!e})()}var Sg=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,xg()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mInternalMaterial",void 0),(0,c.A)(r,"mDiffuseColor",Ft.v.White()),(0,c.A)(r,"mEmissiveColor",Ft.v.Black()),(0,c.A)(r,"mNormalMapScale",ee.I.One()),(0,c.A)(r,"mBumpMapLevel",1),(0,c.A)(r,"mLightMapIntensity",1),(0,c.A)(r,"mDiffuseMap",void 0),(0,c.A)(r,"mAlphaMap",void 0),(0,c.A)(r,"mAoMap",void 0),(0,c.A)(r,"mBumpMap",void 0),(0,c.A)(r,"mNormalMap",void 0),(0,c.A)(r,"mLightMap",void 0),(0,c.A)(r,"mEnvMap",void 0),(0,c.A)(r,"mEmissiveMap",void 0),(0,c.A)(r,"mRoughnessMap",void 0),(0,c.A)(r,"mMetalnessMap",void 0),(0,c.A)(r,"mSpecularMap",void 0),(0,c.A)(r,"mDirty",!1),(0,c.A)(r,"mAlphaTestEnabled",!1),(0,c.A)(r,"mTransparent",!1),(0,c.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Fs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getClearCoat",value:function(){return this.mInternalMaterial.clearCoat.intensity}},{key:"setClearCoat",value:function(e){this.mInternalMaterial.clearCoat.isEnabled=!0,this.mInternalMaterial.clearCoat.intensity=e}},{key:"getClearCoatRoughness",value:function(){return this.mInternalMaterial.clearCoat.roughness}},{key:"setClearCoatRoughness",value:function(e){this.mInternalMaterial.clearCoat.isEnabled=!0,this.mInternalMaterial.clearCoat.roughness=e}},{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null,this.mInternalMaterial.albedoTexture&&(this.mInternalMaterial.albedoTexture.coordinatesMode=vv(e))}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.opacityTexture&&(this.mInternalMaterial.opacityTexture.coordinatesMode=vv(e))}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null,this.mInternalMaterial.ambientTexture&&(this.mInternalMaterial.ambientTexture.coordinatesMode=vv(e))}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectivityTexture&&(this.mInternalMaterial.reflectivityTexture.coordinatesMode=vv(e))}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectionTexture&&(this.mInternalMaterial.reflectionTexture.coordinatesMode=vv(e,!0))}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectionColor.r}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectionColor.set(e,e,e)}},{key:"getIOR",value:function(){return this.mInternalMaterial.indexOfRefraction}},{key:"setIOR",value:function(e){this.mInternalMaterial.indexOfRefraction=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel,this.mInternalMaterial.bumpTexture.coordinatesMode=vv(e))}},{key:"getBumpScale",value:function(){return this.mBumpMapLevel}},{key:"setBumpScale",value:function(e){this.mBumpMapLevel=e,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel)}},{key:"getDisplacementMap",value:function(){}},{key:"setDisplacementMap",value:function(e){}},{key:"getDisplacementScale",value:function(){return 1}},{key:"setDisplacementScale",value:function(e){}},{key:"getDisplacementBias",value:function(){return.01}},{key:"setDisplacementBias",value:function(e){}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveTexture=e?e.getInternalTexture():null,this.mInternalMaterial.emissiveTexture&&(this.mInternalMaterial.emissiveTexture.coordinatesMode=vv(e))}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.environmentIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.environmentIntensity=e}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightmapTexture=e?e.getInternalTexture():null,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity,this.mInternalMaterial.lightmapTexture.coordinatesMode=vv(e))}},{key:"getLightMapIntensity",value:function(){return this.mLightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mLightMapIntensity=e,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metallic}},{key:"setMetalness",value:function(e){this.mInternalMaterial.metallic=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mMetalnessMap=e,this.mInternalMaterial.metallicTexture=e?e.getInternalTexture():null}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.setNormalScale(this.mNormalMapScale),this.mInternalMaterial.bumpTexture.coordinatesMode=vv(e))}},{key:"getNormalScale",value:function(){return this.mNormalMapScale}},{key:"setNormalScale",value:function(e){this.mNormalMapScale.copy(e),this.mInternalMaterial.bumpTexture&&this.mInternalMaterial.bumpTexture.scale(this.mNormalMapScale.x)}},{key:"getRoughness",value:function(){return this.mInternalMaterial.microSurface}},{key:"setRoughness",value:function(e){this.mInternalMaterial.microSurface=e}},{key:"getRoughnessMap",value:function(){return this.mRoughnessMap}},{key:"setRoughnessMap",value:function(e){this.mRoughnessMap=e,this.mInternalMaterial.microSurfaceTexture=e?e.getInternalTexture():null,this.mInternalMaterial.microSurfaceTexture&&(this.mInternalMaterial.microSurfaceTexture.coordinatesMode=vv(e))}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Hd.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return fv(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=mv(e)}},{key:"getTransparencyMode",value:function(){return pv(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=dv(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Hd.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return lv(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=hv(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Fs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mNormalMapScale.copy(e.mNormalMapScale),this.mBumpMapLevel=e.mBumpMapLevel,this.mLightMapIntensity=e.mLightMapIntensity,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mRoughnessMap=e.mRoughnessMap,this.mMetalnessMap=e.mMetalnessMap,this.mSpecularMap=e.mSpecularMap,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Tg.l);function Cg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cg=function(){return!!e})()}var Eg=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,Cg()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mInternalMaterial",void 0),(0,c.A)(r,"mDiffuseColor",Ft.v.White()),(0,c.A)(r,"mDiffuseMap",void 0),(0,c.A)(r,"mDirty",!1),(0,c.A)(r,"mAlphaTestEnabled",!1),(0,c.A)(r,"mAlphaCutOff",0),(0,c.A)(r,"mTransparent",!1),(0,c.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.StandardMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Fs.k.Front),r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.useAlphaFromDiffuseTexture=!0,r.mInternalMaterial.disableLighting=!0,r.mInternalMaterial.specularColor=BABYLON.Color3.Black(),r.mInternalMaterial.emissiveColor=BABYLON.Color3.White(),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.diffuseTexture=e?e.getInternalTexture():null}},{key:"needAlphaTesting",value:function(){return this.mInternalMaterial.needAlphaTesting()}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e,this.mInternalMaterial.depthFunction=e?0:BABYLON.Engine.ALWAYS}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mAlphaCutOff}},{key:"setAlphaTest",value:function(e){this.mAlphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Hd.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return fv(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=mv(e)}},{key:"getTransparencyMode",value:function(){return pv(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=dv(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Hd.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return lv(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=hv(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mDiffuseColor.copy(e.mDiffuseColor),this.mDiffuseMap=e.mDiffuseMap,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mAlphaCutOff=e.mAlphaCutOff,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(En.k);function Rg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rg=function(){return!!e})()}var Ig=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,Rg()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mInternalMaterial",void 0),(0,c.A)(r,"mDiffuseColor",Ft.v.White()),(0,c.A)(r,"mEnvMapScale",ee.I.One()),(0,c.A)(r,"mEmissiveColor",Ft.v.Black()),(0,c.A)(r,"mLightMapIntensity",1),(0,c.A)(r,"mEnvMapCombineOp",Hd.Am.Multiply),(0,c.A)(r,"mDiffuseMap",void 0),(0,c.A)(r,"mAlphaMap",void 0),(0,c.A)(r,"mAoMap",void 0),(0,c.A)(r,"mSpecularMap",void 0),(0,c.A)(r,"mEnvMap",void 0),(0,c.A)(r,"mLightMap",void 0),(0,c.A)(r,"mEmissiveMap",void 0),(0,c.A)(r,"mDirty",!1),(0,c.A)(r,"mAlphaTestEnabled",!1),(0,c.A)(r,"mTransparent",!1),(0,c.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Fs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r.mInternalMaterial.unlit=!0,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null,this.mInternalMaterial.albedoTexture&&(this.mInternalMaterial.albedoTexture.coordinatesMode=vv(e))}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null,this.mInternalMaterial.ambientTexture&&(this.mInternalMaterial.ambientTexture.coordinatesMode=vv(e))}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectivityTexture&&(this.mInternalMaterial.reflectivityTexture.coordinatesMode=vv(e))}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectionTexture&&(this.mInternalMaterial.reflectionTexture.coordinatesMode=vv(e,!0))}},{key:"getEnvMapCombine",value:function(){return this.mEnvMapCombineOp}},{key:"setEnvMapCombine",value:function(e){this.mEnvMapCombineOp=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectionColor.r}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectionColor.set(e,e,e)}},{key:"getIOR",value:function(){return this.mInternalMaterial.indexOfRefraction}},{key:"setIOR",value:function(e){this.mInternalMaterial.indexOfRefraction=e}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightmapTexture=e?e.getInternalTexture():null,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity,this.mInternalMaterial.lightmapTexture.coordinatesMode=vv(e))}},{key:"getLightMapIntensity",value:function(){return this.mLightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mLightMapIntensity=e,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.environmentIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.environmentIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveTexture=e?e.getInternalTexture():null,this.mInternalMaterial.emissiveTexture&&(this.mInternalMaterial.emissiveTexture.coordinatesMode=vv(e))}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Hd.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return fv(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=mv(e)}},{key:"getTransparencyMode",value:function(){return pv(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=dv(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Hd.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return lv(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=hv(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Fs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mEnvMapScale.copy(e.mEnvMapScale),this.mLightMapIntensity=e.mLightMapIntensity,this.mEnvMapCombineOp=e.mEnvMapCombineOp,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mSpecularMap=e.mSpecularMap,this.mEnvMap=e.mEnvMap,this.mLightMap=e.mLightMap,this.mEmissiveMap=e.mEmissiveMap,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(On.r);function Og(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Og=function(){return!!e})()}var Dg=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,Og()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mInternalMaterial",void 0),(0,c.A)(r,"mDiffuseColor",Ft.v.White()),(0,c.A)(r,"mEnvMapCombineOp",Hd.Am.Multiply),(0,c.A)(r,"mDiffuseMap",void 0),(0,c.A)(r,"mAlphaMap",void 0),(0,c.A)(r,"mAoMap",void 0),(0,c.A)(r,"mSpecularMap",void 0),(0,c.A)(r,"mEnvMap",void 0),(0,c.A)(r,"mDirty",!1),(0,c.A)(r,"mAlphaTestEnabled",!1),(0,c.A)(r,"mTransparent",!1),(0,c.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Fs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r.mInternalMaterial.unlit=!0,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null,this.mInternalMaterial.albedoTexture&&(this.mInternalMaterial.albedoTexture.coordinatesMode=vv(e))}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.opacityTexture&&(this.mInternalMaterial.opacityTexture.coordinatesMode=vv(e))}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null,this.mInternalMaterial.ambientTexture&&(this.mInternalMaterial.ambientTexture.coordinatesMode=vv(e))}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectivityTexture&&(this.mInternalMaterial.reflectivityTexture.coordinatesMode=vv(e))}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectionTexture&&(this.mInternalMaterial.reflectionTexture.coordinatesMode=vv(e,!0))}},{key:"getEnvMapCombine",value:function(){return this.mEnvMapCombineOp}},{key:"setEnvMapCombine",value:function(e){this.mEnvMapCombineOp=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectionColor.r}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectionColor.set(e,e,e)}},{key:"getIOR",value:function(){return this.mInternalMaterial.indexOfRefraction}},{key:"setIOR",value:function(e){this.mInternalMaterial.indexOfRefraction=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Hd.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return fv(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=mv(e)}},{key:"getTransparencyMode",value:function(){return pv(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=dv(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Hd.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return lv(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=hv(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Fs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEnvMapCombineOp=e.mEnvMapCombineOp,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mSpecularMap=e.mSpecularMap,this.mEnvMap=e.mEnvMap,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(In._);function Pg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pg=function(){return!!e})()}var Bg=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,Pg()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mInternalMaterial",void 0),(0,c.A)(r,"mNormalMapScale",ee.I.One()),(0,c.A)(r,"mEmissiveColor",Ft.v.Black()),(0,c.A)(r,"mSpecularColor",new Ft.v(.04,.067,.067)),(0,c.A)(r,"mShininess",30),(0,c.A)(r,"mLightMapIntensity",1),(0,c.A)(r,"mBumpMapLevel",1),(0,c.A)(r,"mDiffuseColor",Ft.v.White()),(0,c.A)(r,"mEnvMapCombineOp",Hd.Am.Multiply),(0,c.A)(r,"mDiffuseMap",void 0),(0,c.A)(r,"mAlphaMap",void 0),(0,c.A)(r,"mAoMap",void 0),(0,c.A)(r,"mBumpMap",void 0),(0,c.A)(r,"mNormalMap",void 0),(0,c.A)(r,"mLightMap",void 0),(0,c.A)(r,"mEmissiveMap",void 0),(0,c.A)(r,"mSpecularMap",void 0),(0,c.A)(r,"mEnvMap",void 0),(0,c.A)(r,"mDirty",!1),(0,c.A)(r,"mAlphaTestEnabled",!1),(0,c.A)(r,"mTransparent",!1),(0,c.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Fs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel,this.mInternalMaterial.bumpTexture.coordinatesMode=vv(e))}},{key:"getBumpScale",value:function(){return this.mBumpMapLevel}},{key:"setBumpScale",value:function(e){this.mBumpMapLevel=e,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel)}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.setNormalScale(this.mNormalMapScale),this.mInternalMaterial.bumpTexture.coordinatesMode=vv(e))}},{key:"getNormalScale",value:function(){return this.mNormalMapScale}},{key:"setNormalScale",value:function(e){this.mNormalMapScale.copy(e),this.mInternalMaterial.bumpTexture&&this.mInternalMaterial.bumpTexture.scale(this.mNormalMapScale.x)}},{key:"getDisplacementMap",value:function(){}},{key:"setDisplacementMap",value:function(e){}},{key:"getDisplacementScale",value:function(){return 1}},{key:"setDisplacementScale",value:function(e){}},{key:"getDisplacementBias",value:function(){return.01}},{key:"setDisplacementBias",value:function(e){}},{key:"getSpecular",value:function(){return this.mSpecularColor}},{key:"setSpecular",value:function(e){this.mSpecularColor.copy(e),this.mInternalMaterial.reflectivityColor.set(this.mSpecularColor.r,this.mSpecularColor.g,this.mSpecularColor.b)}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightmapTexture=e?e.getInternalTexture():null,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity,this.mInternalMaterial.lightmapTexture.coordinatesMode=vv(e))}},{key:"getLightMapIntensity",value:function(){return this.mLightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mLightMapIntensity=e,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.environmentIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.environmentIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveTexture=e?e.getInternalTexture():null,this.mInternalMaterial.emissiveTexture&&(this.mInternalMaterial.emissiveTexture.coordinatesMode=vv(e))}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getShininess",value:function(){return this.mShininess}},{key:"setShininess",value:function(e){this.mShininess=e,this.mInternalMaterial.specularIntensity=this.mShininess/100}},{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null,this.mInternalMaterial.albedoTexture&&(this.mInternalMaterial.albedoTexture.coordinatesMode=vv(e))}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.opacityTexture&&(this.mInternalMaterial.opacityTexture.coordinatesMode=vv(e))}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null,this.mInternalMaterial.ambientTexture&&(this.mInternalMaterial.ambientTexture.coordinatesMode=vv(e))}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectivityTexture&&(this.mInternalMaterial.reflectivityTexture.coordinatesMode=vv(e))}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectionTexture&&(this.mInternalMaterial.reflectionTexture.coordinatesMode=vv(e,!0))}},{key:"getEnvMapCombine",value:function(){return this.mEnvMapCombineOp}},{key:"setEnvMapCombine",value:function(e){this.mEnvMapCombineOp=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectionColor.r}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectionColor.set(e,e,e)}},{key:"getIOR",value:function(){return this.mInternalMaterial.indexOfRefraction}},{key:"setIOR",value:function(e){this.mInternalMaterial.indexOfRefraction=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Hd.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return fv(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=mv(e)}},{key:"getTransparencyMode",value:function(){return pv(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=dv(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Hd.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return lv(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=hv(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Fs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mNormalMapScale.copy(e.mNormalMapScale),this.mEmissiveColor.copy(e.mEmissiveColor),this.mSpecularColor.copy(e.mSpecularColor),this.mShininess=e.mShininess,this.mLightMapIntensity=e.mLightMapIntensity,this.mBumpMapLevel=e.mBumpMapLevel,this.mDiffuseColor.copy(e.mDiffuseColor),this.mEnvMapCombineOp=e.mEnvMapCombineOp,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mLightMap=e.mLightMap,this.mEmissiveMap=e.mEmissiveMap,this.mSpecularMap=e.mSpecularMap,this.mEnvMap=e.mEnvMap,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Yi.u),Fg=__webpack_require__(4976);function Ng(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ng=function(){return!!e})()}var Lg=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,Ng()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mInternalMaterial",void 0),(0,c.A)(r,"mDiffuseColor",Ft.v.White()),(0,c.A)(r,"mDirty",!1),(0,c.A)(r,"mAlphaTestEnabled",!1),(0,c.A)(r,"mTransparent",!1),(0,c.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.StandardMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Fs.k.Front),r.mInternalMaterial.useAlphaFromDiffuseTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.disableLighting=!1,r.mInternalMaterial.specularColor=BABYLON.Color3.Black(),r.mInternalMaterial.emissiveColor=BABYLON.Color3.White(),r.mInternalMaterial.diffuseColor=BABYLON.Color3.White(),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Hd.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return fv(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=mv(e)}},{key:"getTransparencyMode",value:function(){return pv(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=dv(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Hd.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return lv(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=hv(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Fs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mDiffuseColor.copy(e.mDiffuseColor),this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Fg.S),jg=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mMediaId",void 0),(0,c.A)(this,"mDisposed",!1),(0,c.A)(this,"mLayer",void 0),this.mMediaId=t}),[{key:"enable",value:function(e){var t=this;tn.u.getInstance().resolveModel(this.mMediaId).then((function(n){t.mDisposed||(t.mLayer=new BABYLON.Layer("background-layer",n.source_url,e,!0,new BABYLON.Color4(1,1,1,1)))}),(function(e){v.UX.error("Failed to enable layer:",e)}))}},{key:"disable",value:function(){this.mDisposed=!0,this.mLayer&&(this.mLayer.dispose(),delete this.mLayer)}}])}(),Ug=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mMediaId",void 0),(0,c.A)(this,"mDisposed",!1),(0,c.A)(this,"mSkybox",void 0),(0,c.A)(this,"mMaterial",void 0),(0,c.A)(this,"mTexture",void 0),this.mMediaId=t}),[{key:"enable",value:function(e){var t=this;tn.u.getInstance().resolveModel(this.mMediaId).then((function(n){t.mDisposed||(t.mTexture=new BABYLON.EquiRectangularCubeTexture(n.source_url,e,1024),t.mSkybox=BABYLON.MeshBuilder.CreateBox("background-equirect-mesh",{size:1e3,updatable:!1},e),t.mSkybox.renderingGroupId=0,t.mSkybox.infiniteDistance=!0,t.mSkybox.isPickable=!1,t.mSkybox.isVisible=!0,t.mSkybox.visibility=1,t.mSkybox.alwaysSelectAsActiveMesh=!0,t.mSkybox.forceRenderingWhenOccluded=!0,t.mSkybox.isOccluded=!1,t.mSkybox.occlusionType=BABYLON.Mesh.OCCLUSION_TYPE_NONE,t.mSkybox.ignoreCameraMaxZ=!0,t.mMaterial=new BABYLON.PBRMaterial("background-equirect-material",e),t.mMaterial.cullBackFaces=!1,t.mMaterial.backFaceCulling=!1,t.mMaterial.reflectionTexture=t.mTexture,t.mMaterial.reflectionTexture.coordinatesMode=BABYLON.Texture.SKYBOX_MODE,t.mMaterial.microSurface=1,t.mMaterial.specularIntensity=0,t.mMaterial.disableLighting=!1,t.mSkybox.material=t.mMaterial)}),(function(e){v.UX.warn("failed to enable layer: ",e)}))}},{key:"disable",value:function(){this.mDisposed=!0,this.mSkybox&&(this.mSkybox.dispose(),delete this.mSkybox),this.mMaterial&&(this.mMaterial.dispose(),delete this.mMaterial),this.mTexture&&(this.mTexture.dispose(),delete this.mTexture)}}])}(),Vg=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mMediaIds",void 0),(0,c.A)(this,"mDisposed",!1),(0,c.A)(this,"mSkybox",void 0),(0,c.A)(this,"mMaterial",void 0),(0,c.A)(this,"mTexture",void 0),this.mMediaIds=t}),[{key:"loadMediaModels",value:(e=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.mMediaIds.map(function(){var e=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",tn.u.getInstance().resolveModel(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.abrupt("return",Promise.all(t));case 2:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"enable",value:function(e){var t=this;this.loadMediaModels().then((function(n){if(!t.mDisposed){var r=n.map((function(e){return e.source_url}));t.mTexture=BABYLON.CubeTexture.CreateFromImages([r[0],r[2],r[4],r[1],r[3],r[5]],e,!1),t.mTexture.name="background-skybox-texture",t.mTexture.sphericalPolynomial=new BABYLON.SphericalPolynomial,t.mSkybox=BABYLON.MeshBuilder.CreateBox("background-skybox-mesh",{size:1e3,updatable:!1,sideOrientation:BABYLON.Mesh.BACKSIDE},e),t.mSkybox.renderingGroupId=0,t.mSkybox.infiniteDistance=!0,t.mSkybox.isPickable=!1,t.mSkybox.isVisible=!0,t.mSkybox.visibility=1,t.mSkybox.alwaysSelectAsActiveMesh=!0,t.mSkybox.forceRenderingWhenOccluded=!0,t.mSkybox.isOccluded=!1,t.mSkybox.occlusionType=BABYLON.Mesh.OCCLUSION_TYPE_NONE,t.mSkybox.ignoreCameraMaxZ=!0,t.mMaterial=new BABYLON.PBRMaterial("background-skybox-material",e),t.mMaterial.cullBackFaces=!1,t.mMaterial.backFaceCulling=!1,t.mMaterial.reflectionTexture=t.mTexture,t.mMaterial.reflectionTexture.coordinatesMode=BABYLON.Texture.SKYBOX_MODE,t.mMaterial.reflectionTexture.sphericalPolynomial=new BABYLON.SphericalPolynomial,t.mMaterial.microSurface=1,t.mMaterial.specularIntensity=0,t.mMaterial.disableLighting=!1,t.mSkybox.material=t.mMaterial}}),(function(e){v.UX.error("failed to enable layer:",e)}))}},{key:"disable",value:function(){this.mDisposed=!0,this.mSkybox&&(this.mSkybox.dispose(),delete this.mSkybox),this.mMaterial&&(this.mMaterial.dispose(),delete this.mMaterial),this.mTexture&&(this.mTexture.dispose(),delete this.mTexture)}}]);var e}(),zg=function(){return(0,u.A)((function e(t,n,r,i){(0,s.A)(this,e),(0,c.A)(this,"mDisposed",!1),(0,c.A)(this,"mSkybox",void 0),(0,c.A)(this,"mMaterial",void 0),(0,c.A)(this,"mTexture",void 0),(0,c.A)(this,"mScale",void 0),(0,c.A)(this,"mBlur",void 0),this.mTexture=t.clone(),this.mScale=n,this.mBlur=r,this.mTexture.isCube&&this.mTexture.setReflectionTextureMatrix(BABYLON.Matrix.RotationY(i))}),[{key:"enable",value:function(e){!this.mDisposed&&this.mTexture&&(this.mSkybox=BABYLON.MeshBuilder.CreateBox("background-env-mesh",{size:this.mScale,updatable:!1},e),this.mSkybox.renderingGroupId=0,this.mSkybox.infiniteDistance=!0,this.mSkybox.isPickable=!1,this.mSkybox.isVisible=!0,this.mSkybox.visibility=1,this.mSkybox.alwaysSelectAsActiveMesh=!0,this.mSkybox.forceRenderingWhenOccluded=!0,this.mSkybox.isOccluded=!1,this.mSkybox.occlusionType=BABYLON.Mesh.OCCLUSION_TYPE_NONE,this.mSkybox.ignoreCameraMaxZ=!0,this.mMaterial=new BABYLON.PBRMaterial("background-env-material",e),this.mMaterial.backFaceCulling=!1,this.mMaterial.reflectionTexture=this.mTexture,this.mMaterial.reflectionTexture.coordinatesMode=BABYLON.Texture.SKYBOX_MODE,this.mMaterial.microSurface=1-this.mBlur,this.mMaterial.twoSidedLighting=!0,this.mMaterial.specularIntensity=0,this.mMaterial.disableLighting=!1,this.mSkybox.material=this.mMaterial)}},{key:"disable",value:function(){this.mDisposed=!0,this.mSkybox&&(this.mSkybox.dispose(),delete this.mSkybox),this.mMaterial&&(this.mMaterial.dispose(),delete this.mMaterial),this.mTexture&&(this.mTexture.dispose(),delete this.mTexture)}}])}();function Hg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hg(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qg,Wg,Kg,Xg,Yg,$g,Zg=function(){return(0,u.A)((function e(t,n){var r=this;(0,s.A)(this,e),(0,c.A)(this,"_scene",void 0),(0,c.A)(this,"_options",void 0),(0,c.A)(this,"_opaqueRenderTarget",null),(0,c.A)(this,"_opaqueMeshesCache",[]),(0,c.A)(this,"_transparentMeshesCache",[]),(0,c.A)(this,"_materialObservers",{}),(0,c.A)(this,"refractionLayer",1),(0,c.A)(this,"onErrorObservable",void 0),this._options=Gg(Gg({},e._getDefaultOptions()),t),this._scene=n,this._scene._transmissionHelper=this,this.onErrorObservable=new BABYLON.Observable,this._scene.onDisposeObservable.addOnce((function(){r.dispose()})),this._parseScene(),this._setupRenderTargets()}),[{key:"updateOptions",value:function(e){var t=this;if(Object.keys(e).filter((function(n){return t._options[n]!==e[n]})).length){var n=Gg(Gg({},this._options),e),r=this._options;this._options=n,n.renderSize===r.renderSize&&n.renderTargetTextureType===r.renderTargetTextureType&&n.generateMipmaps===r.generateMipmaps&&this._opaqueRenderTarget?(this._opaqueRenderTarget.samples=n.samples,this._opaqueRenderTarget.lodGenerationScale=n.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=n.lodGenerationOffset):this._setupRenderTargets()}}},{key:"getOpaqueTarget",value:function(){return this._opaqueRenderTarget}},{key:"shouldRenderAsTransmission",value:function(e){return!!e&&!!(e instanceof BABYLON.PBRMaterial&&e.subSurface.isRefractionEnabled)}},{key:"_addMesh",value:function(e){var t=this;this._materialObservers[e.uniqueId]=e.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this)),BABYLON.Tools.SetImmediate((function(){var n,r=null===(n=e.material)||void 0===n||null===(n=n.metadata)||void 0===n?void 0:n.renderLayer;(null==r||(new rn.z).setMask(r).isEnabled(t.refractionLayer))&&(t.shouldRenderAsTransmission(e.material)?(e.material.refractionTexture=t._opaqueRenderTarget,t._transparentMeshesCache.push(e)):t._opaqueMeshesCache.push(e))}))}},{key:"_removeMesh",value:function(e){e.onMaterialChangedObservable.remove(this._materialObservers[e.uniqueId]),delete this._materialObservers[e.uniqueId];var t=this._transparentMeshesCache.indexOf(e);-1!==t&&this._transparentMeshesCache.splice(t,1),-1!==(t=this._opaqueMeshesCache.indexOf(e))&&this._opaqueMeshesCache.splice(t,1)}},{key:"_parseScene",value:function(){this._scene.meshes.forEach(this._addMesh.bind(this)),this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)),this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this))}},{key:"_onMeshMaterialChanged",value:function(e){var t;if(e){var n=this._transparentMeshesCache.indexOf(e),r=this._opaqueMeshesCache.indexOf(e),i=this.shouldRenderAsTransmission(e.material),a=null===(t=e.material)||void 0===t||null===(t=t.metadata)||void 0===t?void 0:t.renderLayer;null==a||(new rn.z).setMask(a).isEnabled(this.refractionLayer)?i?(e.material instanceof BABYLON.PBRMaterial&&(e.material.subSurface.refractionTexture=this._opaqueRenderTarget),-1!==r?(this._opaqueMeshesCache.splice(r,1),this._transparentMeshesCache.push(e)):-1===n&&this._transparentMeshesCache.push(e)):-1!==n?(this._transparentMeshesCache.splice(n,1),this._opaqueMeshesCache.push(e)):-1===r&&this._opaqueMeshesCache.push(e):-1!==n?this._transparentMeshesCache.splice(n,1):-1!==r&&this._opaqueMeshesCache.splice(r,1)}}},{key:"_setupRenderTargets",value:function(){var e,t,n,r,i=this;this._opaqueRenderTarget&&this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=new BABYLON.RenderTargetTexture("opaqueSceneTexture",this._options.renderSize,this._scene,this._options.generateMipmaps,void 0,this._options.renderTargetTextureType),this._opaqueRenderTarget.ignoreCameraViewport=!0,this._opaqueRenderTarget.renderList=this._opaqueMeshesCache,this._opaqueRenderTarget.clearColor=null!==(e=null===(t=this._options.clearColor)||void 0===t?void 0:t.clone())&&void 0!==e?e:this._scene.clearColor.clone(),this._opaqueRenderTarget.gammaSpace=!1,this._opaqueRenderTarget.lodGenerationScale=this._options.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=this._options.lodGenerationOffset,this._opaqueRenderTarget.samples=this._options.samples,this._opaqueRenderTarget.onBeforeBindObservable.add((function(e){r=i._scene.environmentIntensity,i._scene.environmentIntensity=1,n=i._scene.imageProcessingConfiguration.applyByPostProcess,i._options.clearColor?e.clearColor.copyFrom(i._options.clearColor):i._scene.clearColor.toLinearSpaceToRef(e.clearColor),i._scene.imageProcessingConfiguration._applyByPostProcess=!0})),this._opaqueRenderTarget.onAfterUnbindObservable.add((function(){i._scene.environmentIntensity=r,i._scene.imageProcessingConfiguration._applyByPostProcess=n})),this._transparentMeshesCache.forEach((function(e){i.shouldRenderAsTransmission(e.material)&&(e.material.refractionTexture=i._opaqueRenderTarget)}))}},{key:"dispose",value:function(){this._scene._transmissionHelper=void 0,this._opaqueRenderTarget&&(this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=null),this._transparentMeshesCache=[],this._opaqueMeshesCache=[]}}],[{key:"_getDefaultOptions",value:function(){return{renderSize:1024,samples:4,lodGenerationScale:1,lodGenerationOffset:-4,renderTargetTextureType:BABYLON.Constants.TEXTURETYPE_HALF_FLOAT,generateMipmaps:!0}}}])}();function Qg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qg=function(){return!!e})()}function Jg(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(Wg=qg||(qg={}))[Wg.OBJECT=0]="OBJECT",Wg[Wg.TARGET=1]="TARGET",Wg[Wg.PROPERTY=2]="PROPERTY",(Xg=Kg||(Kg={}))[Xg.TRANSLATE=0]="TRANSLATE",Xg[Xg.ROTATE=1]="ROTATE",Xg[Xg.SCALE=2]="SCALE",($g=Yg||(Yg={}))[$g.LOCAL=0]="LOCAL",$g[$g.WORLD=1]="WORLD";var eb=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[e],i=(0,oe.A)(i),n=(0,ae.A)(r,Qg()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"renderTechnique",Ot._1.transform_controls_gizmo),(0,c.A)(n,"mTargetMode",void 0),(0,c.A)(n,"mMode",void 0),(0,c.A)(n,"mSpace",void 0),(0,c.A)(n,"mSize",void 0),(0,c.A)(n,"mObject",void 0),(0,c.A)(n,"mResetFlag",void 0),(0,c.A)(n,"mObjectProperty",void 0),n.mName="TransformControlsGizmoEntity",n.mMode=Kg.TRANSLATE,n.mSpace=Yg.WORLD,n.mTargetMode=qg.OBJECT,n.mSize=1,n.mResetFlag=!1,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxyGetValue",value:function(e){switch(e){case"mode":return this.mMode;case"target_mode":return this.mTargetMode;case"space":return this.mSpace;case"size":return this.mSize;case"reset":return this.mResetFlag}return Jg(t,"proxyGetValue",this,3)([e])}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"mode":return this.mMode=n,!0;case"space":return this.mSpace=n,!0;case"target_mode":return this.mTargetMode=n,!0;case"size":return this.mSize=parseFloat(n),!0;case"reset":return this.mResetFlag=!!n,!0}return Jg(t,"proxySetValue",this,3)([e,n,r])}},{key:"serialize",value:function(e){return Object.assign(Jg(t,"serialize",this,3)([e]),{type:"transform_controls_gizmo"})}},{key:"mode",get:function(){return this.mMode},set:function(e){this.mMode=e,this.markNeedsRenderUpdate()}},{key:"targetMode",get:function(){return this.mTargetMode},set:function(e){this.mTargetMode=e,this.markNeedsRenderUpdate()}},{key:"objectProperty",get:function(){return this.mObjectProperty},set:function(e){this.mObjectProperty=e,this.markNeedsRenderUpdate()}},{key:"space",get:function(){return this.mSpace},set:function(e){this.mSpace=e,this.markNeedsRenderUpdate()}},{key:"size",get:function(){return this.mSize},set:function(e){this.mSize=e,this.markNeedsRenderUpdate()}},{key:"object",get:function(){return this.mObject},set:function(e){this.mObject=e,this.markNeedsRenderUpdate()}},{key:"setNeedsRenderUpdate",value:function(e){Jg(t,"setNeedsRenderUpdate",this,3)([e]),this.resetRenderFlags()}},{key:"resetRenderFlags",value:function(){this.mResetFlag=!1}}])}(iu.a);function tb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tb=function(){return!!e})()}(0,c.A)(eb,"TypeRTTI",new le.O("TransformControlsGizmoEntity",iu.a.TypeRTTI));var nb,rb,ib=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[t.getTopicName(e)],a=(0,oe.A)(a),r=(0,ae.A)(i,tb()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mType",void 0),(0,c.A)(r,"mData",void 0),r.mType=e,r.mData=n,r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return this.mType}},{key:"getData",value:function(){return this.mData}}],[{key:"getTopicName",value:function(e){return"TransformControlsGizmoUpdateType.".concat(e)}}])}(Ae.J);function ab(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ab=function(){return!!e})()}function ob(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(rb=nb||(nb={}))[rb.ObjectChange=0]="ObjectChange",rb[rb.MouseDown=1]="MouseDown",rb[rb.MouseUp=2]="MouseUp";var sb=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,ab()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mControls",void 0),(0,c.A)(r,"mEnabled",void 0),(0,c.A)(r,"mObject",void 0),(0,c.A)(r,"mMode",void 0),(0,c.A)(r,"mTargetMode",void 0),(0,c.A)(r,"mSpace",void 0),(0,c.A)(r,"mSize",1),(0,c.A)(r,"mObjectProperty",""),(0,c.A)(r,"mTransformParentObject",void 0),(0,c.A)(r,"mTransformObject",void 0),(0,c.A)(r,"mPreviousPosition",te.P.Zero()),(0,c.A)(r,"mPreviousQuaternion",ne.P.identity()),(0,c.A)(r,"mPreviousScale",te.P.One()),(0,c.A)(r,"mTranslateObservers",void 0),(0,c.A)(r,"mRotateObservers",void 0),(0,c.A)(r,"mScaleObservers",void 0),r.mTranslateObservers={mouseDown:void 0,mouseUp:void 0},r.mRotateObservers={mouseDown:void 0,mouseUp:void 0},r.mScaleObservers={mouseDown:void 0,mouseUp:void 0},r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mEnabled=e.enabled,this.mMode=e.mode,this.mTargetMode=e.targetMode,this.mSpace=e.space,this.mSize=e.size,this.mObjectProperty=e.objectProperty;var t=e.object;t!==this.mObject&&(this.mObject=t)}},{key:"onUpdateDirty",value:function(){ob(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.createRenderObject()}},{key:"createRenderObject",value:function(){var e=this;if(!this.mControls){var t=this.getRenderer().getScene();this.mControls=new BABYLON.GizmoManager(t,1),this.mTransformParentObject=new BABYLON.TransformNode("gizmo-manager-object-parent",t),this.mTransformParentObject.rotationQuaternion=BABYLON.Quaternion.Identity(),this.mTransformObject=new BABYLON.TransformNode("gizmo-manager-object",t),this.mTransformObject.setParent(this.mTransformParentObject),this.mTransformObject.rotationQuaternion=BABYLON.Quaternion.Identity()}if(this.mEnabled?(this.mMode===Kg.TRANSLATE?(this.mControls.positionGizmoEnabled=!0,this.mTranslateObservers.mouseDown||(this.mTranslateObservers.mouseDown=this.mControls.gizmos.positionGizmo.onDragStartObservable.add((function(){e.onMouseDown()}))),this.mTranslateObservers.mouseUp||(this.mTranslateObservers.mouseUp=this.mControls.gizmos.positionGizmo.onDragEndObservable.add((function(){e.onMouseUp()}))),this.mControls.gizmos.positionGizmo.planarGizmoEnabled=!0,this.mControls.gizmos.positionGizmo.scaleRatio=this.mSize,this.mControls.gizmos.positionGizmo.updateGizmoPositionToMatchAttachedMesh=!0,this.mControls.gizmos.positionGizmo.updateGizmoRotationToMatchAttachedMesh=this.mSpace===Yg.LOCAL):this.mControls.positionGizmoEnabled=!1,this.mMode===Kg.ROTATE?(this.mControls.rotationGizmoEnabled=!0,this.mRotateObservers.mouseDown||(this.mRotateObservers.mouseDown=this.mControls.gizmos.rotationGizmo.onDragStartObservable.add((function(){e.onMouseDown()}))),this.mRotateObservers.mouseUp||(this.mRotateObservers.mouseUp=this.mControls.gizmos.rotationGizmo.onDragEndObservable.add((function(){e.onMouseUp()}))),this.mControls.gizmos.rotationGizmo.scaleRatio=this.mSize,this.mControls.gizmos.rotationGizmo.updateGizmoPositionToMatchAttachedMesh=!0,this.mControls.gizmos.rotationGizmo.updateGizmoRotationToMatchAttachedMesh=!1):this.mControls.rotationGizmoEnabled=!1,this.mMode===Kg.SCALE?(this.mControls.scaleGizmoEnabled=!0,this.mScaleObservers.mouseDown||(this.mScaleObservers.mouseDown=this.mControls.gizmos.scaleGizmo.onDragStartObservable.add((function(){e.onMouseDown()}))),this.mScaleObservers.mouseUp||(this.mScaleObservers.mouseUp=this.mControls.gizmos.scaleGizmo.onDragEndObservable.add((function(){e.onMouseUp()}))),this.mControls.gizmos.scaleGizmo.sensitivity=5,this.mControls.gizmos.scaleGizmo.scaleRatio=this.mSize,this.mControls.gizmos.scaleGizmo.updateGizmoPositionToMatchAttachedMesh=!0):this.mControls.scaleGizmoEnabled=!1,this.mControls.boundingBoxGizmoEnabled=!1):(this.mControls.positionGizmoEnabled=!1,this.mControls.rotationGizmoEnabled=!1,this.mControls.scaleGizmoEnabled=!1),this.mControls.usePointerToAttachGizmos=!1,this.mObject?(this.updateTransformNodeFromEntity(this.mObject),this.mControls.attachToNode(this.mTransformObject)):this.mControls.attachToNode(null),this.mObject)if(this.mTargetMode===qg.OBJECT)this.mPreviousPosition.copy(this.mObject.transform.position),this.mPreviousQuaternion.copy(this.mObject.transform.quaternion),this.mPreviousScale.copy(this.mObject.transform.scale);else if(this.mTargetMode===qg.TARGET){var n=this.mObject.getValue("target");this.mPreviousPosition.copy(n),this.mPreviousQuaternion.set(0,0,0,1),this.mPreviousScale.set(1,1,1)}else if(this.mTargetMode===qg.PROPERTY){var r=this.mObject.getValue(this.mObjectProperty);this.mPreviousPosition.copy(r)}this.mRenderObject=null}},{key:"destroyRenderObject",value:function(){this.mRenderObject&&(this.mControls.gizmos.positionGizmo&&(this.mTranslateObservers.mouseDown&&(this.mControls.gizmos.positionGizmo.onDragStartObservable.remove(this.mTranslateObservers.mouseDown),delete this.mTranslateObservers.mouseDown),this.mTranslateObservers.mouseUp&&(this.mControls.gizmos.positionGizmo.onDragEndObservable.remove(this.mTranslateObservers.mouseUp),delete this.mTranslateObservers.mouseUp)),this.mControls.gizmos.rotationGizmo&&(this.mRotateObservers.mouseDown&&(this.mControls.gizmos.rotationGizmo.onDragStartObservable.remove(this.mRotateObservers.mouseDown),delete this.mRotateObservers.mouseDown),this.mRotateObservers.mouseUp&&(this.mControls.gizmos.rotationGizmo.onDragEndObservable.remove(this.mRotateObservers.mouseUp),delete this.mRotateObservers.mouseUp)),this.mControls.gizmos.scaleGizmo&&(this.mScaleObservers.mouseDown&&(this.mControls.gizmos.scaleGizmo.onDragStartObservable.remove(this.mScaleObservers.mouseDown),delete this.mScaleObservers.mouseDown),this.mScaleObservers.mouseUp&&(this.mControls.gizmos.scaleGizmo.onDragEndObservable.remove(this.mScaleObservers.mouseUp),delete this.mScaleObservers.mouseUp)),this.mTransformObject.dispose(),this.mControls.dispose(),delete this.mControls),ob(t,"destroyRenderObject",this,3)([])}},{key:"update",value:function(e){ob(t,"update",this,3)([e]);var n=!1,r=!1,i=!1;if(this.mObject){if(this.mMode===Kg.TRANSLATE&&this.didPan(this.mTransformObject.position)){if(this.mTargetMode===qg.OBJECT)this.mObject.transform.position.set(this.mTransformObject.position.x,this.mTransformObject.position.y,this.mTransformObject.position.z),this.mPreviousPosition.copy(this.mObject.transform.position);else if(this.mTargetMode===qg.TARGET){var a=new te.P(this.mTransformObject.position.x,this.mTransformObject.position.y,this.mTransformObject.position.z);this.mObject.setValue("target",a),this.mPreviousPosition.copy(a)}else if(this.mTargetMode===qg.PROPERTY){var o=new te.P(this.mTransformObject.position.x,this.mTransformObject.position.y,this.mTransformObject.position.z);this.mObject.setValue(this.mObjectProperty,o),this.mPreviousPosition.copy(o)}n=!0}this.mMode===Kg.ROTATE&&this.didRotate(this.mTransformObject.rotationQuaternion)&&(this.mTargetMode===qg.OBJECT&&(this.mObject.transform.quaternion.set(this.mTransformObject.rotationQuaternion.x,this.mTransformObject.rotationQuaternion.y,this.mTransformObject.rotationQuaternion.z,this.mTransformObject.rotationQuaternion.w),this.mPreviousQuaternion.copy(this.mObject.transform.quaternion)),r=!0),this.mMode===Kg.SCALE&&this.didScale(this.mTransformObject.scaling)&&(this.mTargetMode===qg.OBJECT&&(this.mObject.transform.scale.set(this.mTransformObject.scaling.x,this.mTransformObject.scaling.y,this.mTransformObject.scaling.z),this.mPreviousScale.copy(this.mObject.transform.scale)),i=!0),(n||r||i)&&this.onObjectChange()}}},{key:"onObjectChange",value:function(){R.K.eventBus().dispatch(new ib(nb.ObjectChange,this.mObject))}},{key:"onMouseDown",value:function(){R.K.eventBus().dispatch(new ib(nb.MouseDown))}},{key:"onMouseUp",value:function(){R.K.eventBus().dispatch(new ib(nb.MouseUp))}},{key:"updateTransformNodeFromEntity",value:function(e){var t=e instanceof Hs.i?e.getParent():void 0;if(t){var n=te.P.Zero();t.transform.getWorldPosition(n),this.mTransformParentObject.position.set(n.x,n.y,n.z);var r=ne.P.identity();t.transform.getWorldQuaternion(r),this.mTransformParentObject.rotationQuaternion.set(r.x,r.y,r.z,r.w);var i=te.P.Zero();t.transform.getWorldScale(i),this.mTransformParentObject.scaling.set(i.x,i.y,i.z)}else this.mTransformParentObject.position.set(0,0,0),this.mTransformParentObject.rotationQuaternion.set(0,0,0,1),this.mTransformParentObject.scaling.set(1,1,1);if(this.mTargetMode===qg.OBJECT)this.mTransformObject.position.set(e.transform.position.x,e.transform.position.y,e.transform.position.z),this.mTransformObject.rotationQuaternion.set(e.transform.quaternion.x,e.transform.quaternion.y,e.transform.quaternion.z,e.transform.quaternion.w),this.mTransformObject.scaling.set(e.transform.scale.x,e.transform.scale.y,e.transform.scale.z);else if(this.mTargetMode===qg.TARGET){var a=this.mObject.getValue("target");this.mTransformObject.position.set(a.x,a.y,a.z),this.mTransformObject.rotationQuaternion.set(0,0,0,1),this.mTransformObject.scaling.set(1,1,1)}else if(this.mTargetMode===qg.PROPERTY){var o=this.mObject.getValue(this.mObjectProperty);this.mTransformObject.position.set(o.x,o.y,o.z),this.mTransformObject.rotationQuaternion.set(0,0,0,1),this.mTransformObject.scaling.set(1,1,1)}}},{key:"didPan",value:function(e){var t=this.mPreviousPosition.x-e.x,n=this.mPreviousPosition.y-e.y,r=this.mPreviousPosition.z-e.z;return t*t+n*n+r*r>Sn.EPS}},{key:"didRotate",value:function(e){var t=this.mPreviousQuaternion.x-e.x,n=this.mPreviousQuaternion.y-e.y,r=this.mPreviousQuaternion.z-e.z,i=this.mPreviousQuaternion.w-e.w;return t*t+n*n+r*r+i*i>Sn.EPS}},{key:"didScale",value:function(e){var t=this.mPreviousScale.x-e.x,n=this.mPreviousScale.y-e.y,r=this.mPreviousScale.z-e.z;return t*t+n*n+r*r>Sn.EPS}}]);var r}(Vd);function ub(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ub=function(){return!!e})()}var cb=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,ub()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mFlareMesh",void 0),(0,c.A)(e,"mFlareMaterial",void 0),(0,c.A)(e,"mReceiveShadow",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(a=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.prev=1,e.next=4,this.loadTextures();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),v.UX.warn("Failed to load water textures:",e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mReceiveShadow=e.receiveShadow,this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder,this.mFlareMesh.renderingGroupId=e.renderOrder)}},{key:"loadTextures",value:(r=(0,n.A)(i().mark((function e(){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){if(++t.sTextures.revision>1)return e();var r=n.getRenderer().getScene();t.sTextures.textures=[new BABYLON.Texture("".concat(et.w.assetsUrl,"system/textures/flare-strip.png"),r)],t.sTextures.textures[0].hasAlpha=!0,BABYLON.Texture.WhenAllReady(t.sTextures.textures,(function(){e()}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"disposeTextures",value:function(){--t.sTextures.revision>0||(t.sTextures.revision=0,t.sTextures.textures.splice(0).forEach((function(e){e.dispose()})))}},{key:"createRenderObject",value:function(){var e=new BABYLON.Mesh("flare-group",this.getRenderer().getScene());e.renderingGroupId=this.mSceneEntity.renderOrder,this.mFlareMaterial=new BABYLON.StandardMaterial("flare-material",this.getRenderer().getScene()),this.mFlareMaterial.diffuseColor=new BABYLON.Color3(1,1,1),this.mFlareMaterial.diffuseTexture=t.sTextures.textures[0],this.mFlareMaterial.transparencyMode=BABYLON.StandardMaterial.MATERIAL_ALPHABLEND,this.mFlareMaterial.alpha=.9,this.mFlareMaterial.useAlphaFromDiffuseTexture=!0,this.mFlareMaterial.backFaceCulling=!0,this.mFlareMaterial.sideOrientation=BABYLON.StandardMaterial.CounterClockWiseSideOrientation,this.mFlareMesh=BABYLON.MeshBuilder.CreatePlane("flare-mesh",{size:1},this.getRenderer().getScene()),this.mFlareMesh.renderingGroupId=this.mSceneEntity.renderOrder,this.mFlareMesh.scaling=new BABYLON.Vector3(4,1,1),this.mFlareMesh.material=this.mFlareMaterial,this.mFlareMesh.parent=e,this.mFlareMesh.metadata={scene_entity_id:this.mSceneEntity.id},this.mRenderObject=e}},{key:"dispose",value:function(){var e,n,r,i,a;this.mFlareMesh&&(this.mFlareMesh.dispose(),delete this.mFlareMesh),this.mFlareMaterial&&(this.mFlareMaterial.diffuseTexture=null,this.mFlareMaterial.dispose(),delete this.mFlareMaterial,this.disposeTextures()),(e=t,n="dispose",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}}]);var r,a}(Vd);function lb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lb=function(){return!!e})()}function hb(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(cb,"sTextures",{revision:0,textures:[]});var fb=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,lb()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mGlareMesh",void 0),(0,c.A)(e,"mGlareMaterial",void 0),(0,c.A)(e,"mGlowLayer",void 0),(0,c.A)(e,"mReceiveShadow",void 0),(0,c.A)(e,"mEdges",4),(0,c.A)(e,"mSize",1),(0,c.A)(e,"mBlur",2),(0,c.A)(e,"mExtension",0),(0,c.A)(e,"mColor",Ft.v.White()),(0,c.A)(e,"mFlareColor",Ft.v.White()),(0,c.A)(e,"mAlpha",1),(0,c.A)(e,"mAngle",1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(a=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.prev=1,e.next=4,this.loadTextures();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),v.UX.warn("Failed to load water textures:",e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mReceiveShadow=e.receiveShadow,this.mEdges=e.edges,this.mSize=e.size,this.mBlur=e.blur,this.mExtension=e.extension,this.mColor.copy(e.color),this.mFlareColor.copy(e.flareColor),this.mAlpha=e.alpha,this.mAngle=e.angle,this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder,this.mGlareMesh.renderingGroupId=e.renderOrder)}},{key:"loadTextures",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){if(++t.sTextures.revision>1)return e();t.sTextures.textures=[],BABYLON.Texture.WhenAllReady(t.sTextures.textures,(function(){e()}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"disposeTextures",value:function(){--t.sTextures.revision>0||(t.sTextures.revision=0,t.sTextures.textures.splice(0).forEach((function(e){e.dispose()})))}},{key:"onUpdateDirty",value:function(){hb(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mGlareMaterial.emissiveColor.set(this.mColor.r,this.mColor.g,this.mColor.b);var e=this.mSize*(.5*this.mEdges);this.mGlareMesh.scaling.set(e,e,e)}},{key:"createRenderObject",value:function(){var e=new BABYLON.Mesh("glare-group",this.getRenderer().getScene());e.renderingGroupId=this.mSceneEntity.renderOrder,this.mGlareMaterial=new BABYLON.StandardMaterial("glare-material",this.getRenderer().getScene()),this.mGlareMaterial.diffuseColor=new BABYLON.Color3(1,1,1),this.mGlareMaterial.transparencyMode=BABYLON.StandardMaterial.MATERIAL_ALPHABLEND,this.mGlareMaterial.alpha=this.mAlpha,this.mGlareMaterial.emissiveColor=new BABYLON.Color3(this.mColor.r,this.mColor.g,this.mColor.b),this.mGlareMesh=BABYLON.MeshBuilder.CreateSphere("glare-mesh",{segments:32,diameter:1},this.getRenderer().getScene()),this.mGlareMesh.renderingGroupId=this.mSceneEntity.renderOrder;var t=this.mSize*(.5*this.mEdges);this.mGlareMesh.scaling=new BABYLON.Vector3(t,t,t),this.mGlareMesh.material=this.mGlareMaterial,this.mGlareMesh.parent=e,this.mGlareMesh.metadata={scene_entity_id:this.mSceneEntity.id},this.mGlowLayer=new BABYLON.GlowLayer("glare-glow-layer",this.getRenderer().getScene(),{mainTextureFixedSize:256,blurKernelSize:64}),this.mGlowLayer.intensity=10,this.mGlowLayer.addIncludedOnlyMesh(this.mGlareMesh),this.mRenderObject=e}},{key:"dispose",value:function(){this.mGlowLayer&&(this.mGlowLayer.dispose(),delete this.mGlowLayer),this.mGlareMesh&&(this.mGlareMesh.dispose(),delete this.mGlareMesh),this.mGlareMaterial&&(this.mGlareMaterial.dispose(),delete this.mGlareMaterial,this.disposeTextures()),hb(t,"dispose",this,3)([])}}]);var r,a}(Vd);function mb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mb(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function db(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(db=function(){return!!e})()}(0,c.A)(fb,"sTextures",{revision:0,textures:[]});var vb=function(e){function t(e,n,r){var i,a,o,u;return(0,s.A)(this,t),a=this,o=t,u=[n,r],o=(0,oe.A)(o),i=(0,ae.A)(a,db()?Reflect.construct(o,u||[],(0,oe.A)(a).constructor):o.apply(a,u)),(0,c.A)(i,"mEngine",void 0),(0,c.A)(i,"mScene",void 0),(0,c.A)(i,"mSceneDefaultBgMesh",void 0),(0,c.A)(i,"mSceneDefaultBgTexture",void 0),(0,c.A)(i,"mSceneDefaultBgMaterial",void 0),(0,c.A)(i,"mDefaultCamera",void 0),(0,c.A)(i,"mCamera",void 0),(0,c.A)(i,"mSyncHashHelper",new yp.Q),(0,c.A)(i,"mClippingCache",{}),(0,c.A)(i,"mCanvas",void 0),(0,c.A)(i,"mTransmissionHelper",void 0),(0,c.A)(i,"mTransmissionReferenceCounter",{}),(0,c.A)(i,"mSceneBackgroundStatePresent",!1),(0,c.A)(i,"mShadowGenerators",[]),(0,c.A)(i,"mShadowGeneratorsRequireUpdate",!1),i.mCanvas=e,i.mCanvas.style.outline="none",i.init(),i.mDefaultCamera=new BABYLON.ArcRotateCamera("camera",0,Math.PI/2.5,8,new BABYLON.Vector3(0,0,0),i.mScene),i.mDefaultCamera.minZ=.1,i.mDefaultCamera.maxZ=1e3,i.mDefaultCamera.lowerRadiusLimit=.1,i.mDefaultCamera.upperRadiusLimit=1/0,i.mDefaultCamera.attachControl(i.mCanvas,!0),i.mDefaultCamera.wheelPrecision=5,i}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"init",value:function(){this.initEngine(),this.initScene()}},{key:"getScene",value:function(){return this.mScene}},{key:"getEngine",value:function(){return this.mEngine}},{key:"getActiveCamera",value:function(){return this.mCamera?this.mCamera.getRenderObject():this.mDefaultCamera}},{key:"initScene",value:function(){var e=this;this.mScene=new BABYLON.Scene(this.mEngine),this.mScene.preventDefaultOnPointerUp=!1,this.mScene.preventDefaultOnPointerDown=!1,this.mScene.useRightHandedSystem=!0,this.mScene.autoClear=!1;var t=["".concat(et.w.assetsUrl,"system/textures/cube-grayblue-side.png"),"".concat(et.w.assetsUrl,"system/textures/cube-grayblue-top.png"),"".concat(et.w.assetsUrl,"system/textures/cube-grayblue-side.png"),"".concat(et.w.assetsUrl,"system/textures/cube-grayblue-side.png"),"".concat(et.w.assetsUrl,"system/textures/cube-grayblue-bottom.png"),"".concat(et.w.assetsUrl,"system/textures/cube-grayblue-side.png")];this.mSceneDefaultBgTexture=BABYLON.CubeTexture.CreateFromImages(t,this.mScene,!1),this.mSceneDefaultBgTexture.onLoadObservable.addOnce((function(){e.mSceneBackgroundStatePresent||(e.mSceneDefaultBgMesh=BABYLON.MeshBuilder.CreateBox("scene-default-background-mesh",{size:1e3,updatable:!1,sideOrientation:BABYLON.Mesh.BACKSIDE},e.mScene),e.mSceneDefaultBgMesh.renderingGroupId=1,e.mSceneDefaultBgMesh.infiniteDistance=!0,e.mSceneDefaultBgMesh.isPickable=!1,e.mSceneDefaultBgMesh.isVisible=!0,e.mSceneDefaultBgMesh.visibility=1,e.mSceneDefaultBgMesh.alwaysSelectAsActiveMesh=!0,e.mSceneDefaultBgMesh.forceRenderingWhenOccluded=!0,e.mSceneDefaultBgMesh.isOccluded=!1,e.mSceneDefaultBgMesh.occlusionType=BABYLON.Mesh.OCCLUSION_TYPE_NONE,e.mSceneDefaultBgMesh.ignoreCameraMaxZ=!0,e.mSceneDefaultBgMaterial=new BABYLON.PBRMaterial("scene-default-background-material",e.mScene),e.mSceneDefaultBgMaterial.backFaceCulling=!0,e.mSceneDefaultBgMaterial.reflectionTexture=e.mSceneDefaultBgTexture,e.mSceneDefaultBgMaterial.reflectionTexture.coordinatesMode=BABYLON.Texture.SKYBOX_MODE,e.mSceneDefaultBgMaterial.reflectionTexture.sphericalPolynomial=new BABYLON.SphericalPolynomial,e.mSceneDefaultBgMaterial.microSurface=1,e.mSceneDefaultBgMaterial.specularIntensity=0,e.mSceneDefaultBgMaterial.disableLighting=!1,e.mSceneDefaultBgMesh.material=e.mSceneDefaultBgMaterial)})),this.mScene.environmentIntensity=1;var n=this.getDeviceSceneSettings().clear_color,r=n>>24,i=n>>16&255,a=n>>8&255,o=255&n;r=(r/=127)>1?1:r,this.mScene.clearColor=new BABYLON.Color4(i/255,a/255,o/255,r),this.mScene.useOrderIndependentTransparency=!1}},{key:"initEngine",value:function(){BABYLON.RenderingManager.MAX_RENDERINGGROUPS=Ot.L_.MAX_RENDERINGGROUPS+2;var e=this.getDeviceSceneSettings();this.mEngine=new BABYLON.Engine(this.mCanvas,e.anti_aliasing,{alpha:e.alpha,audioEngine:!1,autoEnableWebVR:!1},!1)}},{key:"setShadowProperties",value:function(e,t){switch(e.transparencyShadow=!0,e.enableSoftTransparentShadow=!0,e.getShadowMap().refreshRate=BABYLON.RenderTargetTexture.REFRESHRATE_RENDER_ONCE,t.shadow){case"1":e.usePercentageCloserFiltering=!1;break;case"2":e.usePercentageCloserFiltering=!0,e.filteringQuality=BABYLON.ShadowGenerator.QUALITY_MEDIUM;break;case"3":e.usePercentageCloserFiltering=!0,e.filteringQuality=BABYLON.ShadowGenerator.QUALITY_HIGH}}},{key:"createShadowGenerator",value:function(e,t){var n=this.getDeviceSceneSettings();if("0"!=n.shadow){var r=new BABYLON.ShadowGenerator(e,t);return this.setShadowProperties(r,n),this.mShadowGenerators.push(r),r}}},{key:"disposeShadowGenerator",value:function(e){e.dispose(),this.mShadowGenerators=this.mShadowGenerators.filter((function(t){return t.id!==e.id}))}},{key:"markShadowMapUpdate",value:function(){this.mShadowGeneratorsRequireUpdate=!0}},{key:"clear",value:function(e,t,n){this.mEngine.clear(this.mScene.clearColor,e,t,n)}},{key:"beforeRender",value:function(e){this.mSyncHashHelper.newHash(),(e.lightsNeedRenderUpdate()||e.drawablesNeedRenderUpdate())&&this.markShadowMapUpdate()}},{key:"afterRender",value:function(e){this.renderCacheReady(!0)&&this.clearOutOfSync(),this.mShadowGeneratorsRequireUpdate&&(this.mShadowGeneratorsRequireUpdate=!1,this.mShadowGenerators.forEach((function(e){return e.getShadowMap().resetRefreshCounter()}))),this.renderFrame()}},{key:"renderFrame",value:function(){this.mEngine.beginFrame(),this.mScene.render(),this.mEngine.endFrame()}},{key:"clipPlaneKey",value:function(e){return"clipPlane".concat(0===e?"":e+1)}},{key:"onBeforeMeshRender",value:function(e,t){var n,r=this,i=null===(n=this.mClippingCache)||void 0===n?void 0:n[t.getObjectId()];null==i||i.forEach((function(e,t){t>5||(r.getScene()[r.clipPlaneKey(t)]=e)}))}},{key:"onAfterMeshRender",value:function(e,t){for(var n=this.getScene(),r=0;r<=6;r++)delete n[this.clipPlaneKey(r)]}},{key:"raycast",value:function(e){var t=this,n=e.origin.clone(),r=e.direction.clone();this.isRightHandedSystemActive()||(n.toggleCoordSystem(),r.toggleCoordSystem());var i=new BABYLON.Ray(new BABYLON.Vector3(n.x,n.y,n.z),new BABYLON.Vector3(r.x,r.y,r.z),e.length);return this.mScene.multiPickWithRay(i,null).filter((function(e){return!!e.pickedPoint})).map((function(e){if(e.hit){var n=e.getNormal(!1,!0),r=e.getNormal(!0,!0),i=e.getTextureCoordinates(),a=t.getEntityFromObject(e.pickedMesh),o=n?new te.P(n.x,n.y,n.z):te.P.Up(),s=r?new te.P(r.x,r.y,r.z):te.P.Up(),u=i?new ee.I(i.x,i.y):ee.I.Zero(),c=u.clone(),l=new te.P(e.pickedPoint.x,e.pickedPoint.y,e.pickedPoint.z);t.isRightHandedSystemActive()||(l.toggleCoordSystem(),n&&o.toggleCoordSystem(),r&&s.toggleCoordSystem());var h=new Xy;return h.distance=e.distance,h.point.copy(l),h.normal.copy(s),h.faceNormal.copy(o),h.uv.copy(u),h.uv2.copy(c),h.entity=a,h}})).filter((function(e){return e&&(!e.entity||!e.entity.layers.isEnabled(4))})).sort((function(e,t){return e.distance-t.distance}))}},{key:"raycastIntersects",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.origin.clone(),a=e.direction.clone();this.isRightHandedSystemActive()||(i.toggleCoordSystem(),a.toggleCoordSystem());var o=new BABYLON.Ray(new BABYLON.Vector3(i.x,i.y,i.z),new BABYLON.Vector3(a.x,a.y,a.z),e.length),s=t.map((function(e){var t=n.getObjectFromEntity(e);return t instanceof BABYLON.AbstractMesh?t:void 0})).filter((function(e){return e}));return o.intersectsMeshes(s,r).map((function(e){if(e.hit){var t=e.getNormal(!1,!0),r=e.getNormal(!0,!0),i=e.getTextureCoordinates(),a=n.getEntityFromObject(e.pickedMesh),o=t?new te.P(t.x,t.y,t.z):te.P.Up(),s=r?new te.P(r.x,r.y,r.z):te.P.Up(),u=i?new ee.I(i.x,i.y):ee.I.Zero(),c=u.clone(),l=new te.P(e.pickedPoint.x,e.pickedPoint.y,e.pickedPoint.z);n.isRightHandedSystemActive()||(l.toggleCoordSystem(),t&&o.toggleCoordSystem(),r&&s.toggleCoordSystem());var h=new Xy;return h.distance=e.distance,h.point.copy(l),h.normal.copy(s),h.faceNormal.copy(o),h.uv.copy(u),h.uv2.copy(c),h.entity=a,h}})).filter((function(e){return e&&(!e.entity||!e.entity.layers.isEnabled(4))})).sort((function(e,t){return e.distance-t.distance}))}},{key:"getForwardRayFromCamera",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=new Ky;n.length=t;var r=this.getTechniqueFromEntity(e);if(!(r&&r instanceof vg))return n;var i=r.getCamera().getForwardRay(t);return n.origin.set(i.origin.x,i.origin.y,i.origin.z),n.direction.set(i.direction.x,i.direction.y,i.direction.z),this.isRightHandedSystemActive()||(n.origin.toggleCoordSystem(),n.direction.toggleCoordSystem()),n}},{key:"getForwardRayFromScreenCoords",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,i=new Ky;i.length=r;var a=this.getTechniqueFromEntity(e);if(!(a&&a instanceof vg))return i;var o=this.mScene.createPickingRay(t,n,BABYLON.Matrix.Identity(),a.getCamera(),!1);return i.direction.set(o.direction.x,o.direction.y,o.direction.z),i.origin.set(o.origin.x,o.origin.y,o.origin.z),this.isRightHandedSystemActive()||(i.direction.toggleCoordSystem(),i.origin.toggleCoordSystem()),i}},{key:"createTexture2D",value:function(e,t,n,r,i,a,o,s,u,c,l,h,f,m){return new tv(this.mScene,e,t,n,r,i,a,o,s,u,c,l,h,f,m)}},{key:"createTextureCanvas",value:function(e,t,n,r,i,a,o,s,u,c,l,h,f,m){return new cv(this.mScene,e,t,n,r,i,a,o,s,u,c,l,h,f,m)}},{key:"createBuffer",value:function(){return new $y(this.mScene)}},{key:"createMaterialLambert",value:function(e){return new Ig(e,this.mScene)}},{key:"createMaterialBasic",value:function(e){return new Dg(e,this.mScene)}},{key:"createMaterialPhong",value:function(e){return new Bg(e,this.mScene)}},{key:"createMaterialPhongExt",value:function(e){return new bg(e,this.mScene)}},{key:"createMaterialStandard",value:function(e){return new _g(e,this.mScene)}},{key:"createMaterialPhysical",value:function(e){return new Sg(e,this.mScene)}},{key:"createMaterialPhysicalExt",value:function(e){return new wg(e,this.mScene)}},{key:"createMaterialLine",value:function(e){return new Lg(e,this.mScene)}},{key:"createMaterialSimple",value:function(e){return new Eg(e,this.mScene)}},{key:"createMaterialPBR",value:function(e){return new gv(e,this.mScene)}},{key:"enablePerspectiveCamera",value:function(e,t){this.createOrUpdate(e,vg)}},{key:"enableAmbientLight",value:function(e,t){this.createOrUpdate(e,ry)}},{key:"enableDirectionalLight",value:function(e,t){this.createOrUpdate(e,cy)}},{key:"enableHemisphericLight",value:function(e,t){this.createOrUpdate(e,hy)}},{key:"enablePointLight",value:function(e,t){this.createOrUpdate(e,py)}},{key:"enableSpotLight",value:function(e,t){this.createOrUpdate(e,yy)}},{key:"enableRectAreaLight",value:function(e,t){}},{key:"drawEffectAoPlane",value:function(e,t){this.createOrUpdate(e,Ov)}},{key:"drawEffectFire",value:function(e,t){this.createOrUpdate(e,Pv)}},{key:"drawEffectFlare",value:function(e,t){this.createOrUpdate(e,cb)}},{key:"drawEffectGlare",value:function(e,t){this.createOrUpdate(e,fb)}},{key:"drawEffectReflector",value:function(e,t){this.createOrUpdate(e,Nv)}},{key:"drawEffectSkyCube",value:function(e,t){}},{key:"drawEffectSkyEquirect",value:function(e,t){this.createOrUpdate(e,Uv)}},{key:"drawEffectWater",value:function(e,t){this.createOrUpdate(e,Hv)}},{key:"drawGridArea",value:function(e,t){this.createOrUpdate(e,Sv)}},{key:"drawPrimitiveLine",value:function(e,t){this.createOrUpdate(e,Wv)}},{key:"drawPrimitiveBox",value:function(e,t){this.createOrUpdate(e,Yv)}},{key:"drawPrimitivePlane",value:function(e,t){this.createOrUpdate(e,Qv)}},{key:"drawPrimitiveSphere",value:function(e,t){this.createOrUpdate(e,ty)}},{key:"drawUI",value:function(e,t){switch(e.getType().getTypeName()){case"UiEntityAnnotation":this.createOrUpdate(e,xy);break;case"UiEntityButton":this.createOrUpdate(e,Iy);break;case"UiEntityImage":this.createOrUpdate(e,Fy);break;case"UiEntityTag":this.createOrUpdate(e,Vy);break;case"UiEntityText":this.createOrUpdate(e,Wy);break;default:v.UX.warn("Unknown ui entity to renderer: ",e.getType().getTypeName())}}},{key:"drawMesh",value:function(e,t){this.createOrUpdate(e,Mv)}},{key:"drawMeshLine",value:function(e,t){this.createOrUpdate(e,Tv)}},{key:"pushGlobalStates",value:function(){}},{key:"popGlobalStates",value:function(){}},{key:"enableClippingPlane",value:function(e,t,n){var r=this,i=e,a=this.mClippingCache[t.getObjectId()]||[],o=i.getPlanes();o.forEach((function(e,t){var n=new BABYLON.Vector3(e.normal.x,e.normal.y,e.normal.z),i=e.constant;if(r.isRightHandedSystemActive()&&(n.negateInPlace(),i*=-1),t<a.length)return a[t].normal.set(n.x,n.y,n.z),void(a[t].d=i);a.push(new BABYLON.Plane(n.x,n.y,n.z,i))})),o.length<a.length&&a.splice(o.length),this.mClippingCache[t.getObjectId()]=a}},{key:"drawTransformControlsGizmo",value:function(e,t){this.createOrUpdate(e,sb)}},{key:"enableSceneBackground",value:function(e,t){switch(this.mSceneBackgroundStatePresent=!0,this.mSceneDefaultBgMesh&&this.mScene.removeMesh(this.mSceneDefaultBgMesh),e.getBackgroundType()){case Ro.transparent:return this.enableSceneBackgroundTransparent(e,t);case Ro.color:return this.enableSceneBackgroundColor(e,t);case Ro.image:return this.enableSceneBackgroundImage(e,t);case Ro.equirect:return this.enableSceneBackgroundEquirect(e,t);case Ro.skybox:return this.enableSceneBackgroundSkybox(e,t);case Ro.environment:return this.enableSceneBackgroundEnvironment(e,t);default:return void v.UX.error("Unknown scene background state:",e)}}},{key:"enableEnvironment",value:function(e,t){var n,r,i=this,a=this.mScene.environmentTexture,o=new M.B;e.getEnvironment()?"system"===(null!==(r=e.getEnvironment().type)&&void 0!==r?r:"system")?this.mScene.environmentTexture=e.getEnvironment().environment?BABYLON.CubeTexture.CreateFromPrefilteredData(e.getEnvironment().environment,this.mScene):void 0:"upload"===e.getEnvironment().type&&(e.getEnvironment().media_id?(0,xn.H)(tn.u.getInstance().resolveModel(e.getEnvironment().media_id)).pipe((0,ls.Q)(o),(0,E.s)(1)).subscribe({next:function(e){i.mScene.environmentTexture=BABYLON.CubeTexture.CreateFromPrefilteredData(e.source_url,i.mScene)},error:function(e){v.UX.error(e),i.mScene.environmentTexture=void 0}}):this.mScene.environmentTexture=void 0):this.mScene.environmentTexture=void 0;return null===(n=this.mScene.environmentTexture)||void 0===n||n.onLoadObservable.addOnce((function(){window.requestAnimationFrame((function(){i.renderFrame()}))})),{state:e,restore:function(){i.mScene.environmentTexture&&i.mScene.environmentTexture.dispose(),i.mScene.environmentTexture=a,o.next(),o.complete()}}}},{key:"enableEnvironmentIntensity",value:function(e){var t=this,n=this.mScene.environmentIntensity;return this.mScene.environmentIntensity=e.getIntensity(),{state:e,restore:function(){t.mScene.environmentIntensity=n}}}},{key:"enableEnvironmentRotation",value:function(e){var t,n=this;if(null!==(t=this.mScene.environmentTexture)&&void 0!==t&&t.isCube){var r=this.mScene.environmentTexture,i=r.getReflectionTextureMatrix();return r.setReflectionTextureMatrix(BABYLON.Matrix.RotationY(e.getRotation())),{state:e,restore:function(){var e;null!==(e=n.mScene.environmentTexture)&&void 0!==e&&e.isCube&&n.mScene.environmentTexture.setReflectionTextureMatrix(i)}}}}},{key:"enableSceneBackgroundTransparent",value:function(e,t){var n=this,r=this.mScene.clearColor;return this.mScene.clearColor=new BABYLON.Color4(0,0,0,0),{state:e,restore:function(){n.mScene.clearColor=r}}}},{key:"enableSceneBackgroundColor",value:function(e,t){var n=this,r=e.getColor(),i=this.mScene.clearColor;return this.mScene.clearColor=new BABYLON.Color4(r.r,r.g,r.b,1),{state:e,restore:function(){n.mScene.clearColor=i}}}},{key:"enableSceneBackgroundImage",value:function(e,t){var n=e.getMediaId(),r=new jg(n);return r.enable(this.mScene),{state:e,restore:function(){r.disable()}}}},{key:"enableSceneBackgroundEquirect",value:function(e,t){var n=e.getMediaId(),r=new Ug(n);return r.enable(this.mScene),{state:e,restore:function(){r.disable()}}}},{key:"enableSceneBackgroundSkybox",value:function(e,t){var n=e.getMediaIds(),r=new Vg(n);return r.enable(this.mScene),{state:e,restore:function(){r.disable()}}}},{key:"enableSceneBackgroundEnvironment",value:function(e,t){var n=this.mScene.environmentTexture;if(n){var r=new zg(n,e.getScale(),e.getBlur(),e.getRotation());return r.enable(this.mScene),{state:e,restore:function(){r.disable()}}}}},{key:"disableDefaultBackground",value:function(){this.mSceneDefaultBgMesh&&this.mScene.removeMesh(this.mSceneDefaultBgMesh),this.mSceneBackgroundStatePresent=!0}},{key:"dispose",value:function(){for(var e=0,t=Object.entries(this.mRenderCache);e<t.length;e++){(0,o.A)(t[e],2)[1].dispose()}this.mRenderCache={},this.mTransmissionHelper&&(this.mTransmissionHelper.dispose(),delete this.mTransmissionHelper),this.mSceneDefaultBgMesh&&(this.mSceneDefaultBgMesh.dispose(!0,!1),delete this.mSceneDefaultBgMesh),this.mSceneDefaultBgTexture&&(this.mSceneDefaultBgTexture.dispose(),delete this.mSceneDefaultBgTexture),this.mSceneDefaultBgMaterial&&(this.mSceneDefaultBgMaterial.dispose(!0,!1),delete this.mSceneDefaultBgMaterial),this.mSceneBackgroundStatePresent=!1,this.mEngine.dispose(),this.mUiRenderer.dispose(),this.mSyncHashHelper.newHash()}},{key:"createOrUpdate",value:function(e,t){var n=this.mRenderCache[e.getObjectId()];n||(this.mRenderCache[e.getObjectId()]=n=new t(e,this),n.initialize()),n.disposed||(n.setSyncHash(this.mSyncHashHelper.getHash()),n.ready&&this.renderCacheReady()&&(n.attached||(n.attach(),this.markShadowMapUpdate()),n.update(this.mDeltaTime)))}},{key:"clearOutOfSync",value:function(){for(var e=0,t=Object.keys(this.mRenderCache);e<t.length;e++){var n=t[e],r=this.mRenderCache[n];r.getSyncHash()!==this.mSyncHashHelper.getHash()&&(r.detach(),r.dispose(),delete this.mRenderCache[n],delete this.mClippingCache[n],this.markShadowMapUpdate())}}},{key:"getObjectFromEntity",value:function(e){var t=this.getTechniqueFromEntity(e);return t instanceof Vd?t.getRenderObject():void 0}},{key:"getEntityFromObject",value:function(e){if(e&&e.metadata)for(var t=e.metadata.scene_entity_id,n=0,r=Object.entries(this.mRenderCache);n<r.length;n++){var i=(0,o.A)(r[n],2)[1];if(i.equalsId(t))return i.getSceneEntity()}}},{key:"getTechniqueFromEntity",value:function(e){for(var t=0,n=Object.entries(this.mRenderCache);t<n.length;t++){var r=(0,o.A)(n[t],2)[1];if(r.equals(e))return r}}},{key:"setSize",value:function(e,t){this.mEngine.setSize(e,t),this.mUiRenderer.resize(e,t),this.clear(!0,!0,!0),this.mScene.render()}},{key:"setPixelRatio",value:function(e){}},{key:"getCanvas",value:function(){return this.mCanvas}},{key:"getSceneBoundingBox",value:function(){for(var e=new Os.N,t=0,n=Object.entries(this.mRenderCache);t<n.length;t++){var r=(0,o.A)(n[t],2)[1];if(r.getSceneEntity().visible&&(!(r.getSceneEntity().layers.isEnabled(1)||r.getSceneEntity().layers.isEnabled(2)||r.getSceneEntity().layers.isEnabled(3)||r.getSceneEntity().layers.isEnabled(5)||r.getSceneEntity().layers.isEnabled(7))&&r instanceof Vd)){var i=r.getRenderObject();if(i instanceof BABYLON.AbstractMesh){var a=i.getHierarchyBoundingVectors(!0),s=new Os.N(new te.P(a.min.x,a.min.y,a.min.z),new te.P(a.max.x,a.max.y,a.max.z));s.applyMatrix4(r.getSceneEntity().transform.matrixWorld),e.union(s)}}}return new Os.N(new te.P(e.min.x,e.min.y,e.min.z),new te.P(e.max.x,e.max.y,e.max.z))}},{key:"setCameraActive",value:function(e){this.mCamera=e,this.mScene.activeCamera=e.getRenderObject(),this.mScene.activeCameras[0]=e.getRenderObject()}},{key:"isRightHandedSystemActive",value:function(){return this.mScene.useRightHandedSystem}},{key:"initiateTransmission",value:function(e,t){var n="".concat(e,"-").concat(t);n in this.mTransmissionReferenceCounter||(this.mTransmissionReferenceCounter[n]=1),this.mTransmissionHelper||(v.UX.print("Transmission Helper initiated!"),this.mTransmissionHelper=new Zg({renderSize:(0,H.Fr)()?512:1024,samples:4,lodGenerationScale:1,lodGenerationOffset:-4,renderTargetTextureType:BABYLON.Constants.TEXTURETYPE_HALF_FLOAT,generateMipmaps:!0},this.mScene))}},{key:"disposeTransmission",value:function(e,t){if(this.mTransmissionHelper){var n="".concat(e,"-").concat(t);n in this.mTransmissionReferenceCounter&&delete this.mTransmissionReferenceCounter[n],0===Object.keys(this.mTransmissionReferenceCounter).length&&(v.UX.print("Transmission Helper disposed!"),this.mTransmissionHelper.dispose(),delete this.mTransmissionHelper)}}},{key:"transmissionUpdateMaterial",value:function(e){this.mTransmissionHelper&&e&&this.mTransmissionHelper._onMeshMaterialChanged(e)}},{key:"getInternalScene",value:function(){return this.mScene}},{key:"getInternalRenderer",value:function(){return this.mEngine}}],[{key:"loadScripts",value:(r=(0,n.A)(i().mark((function e(){var t,n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,__webpack_require__.e(317).then(__webpack_require__.t.bind(__webpack_require__,67828,23));case 2:return t=e.sent,e.next=5,Promise.all([__webpack_require__.e(317),__webpack_require__.e(131)]).then(__webpack_require__.t.bind(__webpack_require__,5695,23));case 5:return n=e.sent,e.next=8,Promise.all([__webpack_require__.e(317),__webpack_require__.e(392)]).then(__webpack_require__.t.bind(__webpack_require__,14216,23));case 8:r=e.sent,window.BABYLON=pb(pb(pb({},t),n),r);case 10:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})}]);var r}(Ot.L_);function yb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yb=function(){return!!e})()}function gb(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(vb,"TypeRTTI",new le.O("BabylonjsRenderer",Ot.L_.TypeRTTI));var bb=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,yb()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mRenderObject",void 0),(0,c.A)(e,"mMatrix",new THREE.Matrix4),(0,c.A)(e,"mBoundingBox",new Os.N),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"attach",value:function(){if(!this.mRenderObject)throw new Error("Trying to attach undefined object to scene");gb(t,"attach",this,3)([]),this.mRenderer.getScene().add(this.mRenderObject),this.onAttached()}},{key:"detach",value:function(){this.mAttached&&(this.mRenderer.getScene().remove(this.mRenderObject),this.onDetached(),gb(t,"detach",this,3)([]))}},{key:"getRenderObject",value:function(){return this.mRenderObject}},{key:"getRenderer",value:function(){return this.mRenderer}},{key:"update",value:function(e){gb(t,"update",this,3)([e]),this.updateTranslation(),this.mSceneEntity.needsBoundingBoxUpdate()&&this.mRenderObject&&this.updateBoundingBox(),this.mSceneEntity.needsRenderUpdate()&&(this.onUpdateDirty(),this.mSceneEntity.setNeedsRenderUpdate(!1))}},{key:"onUpdateDirty",value:function(){this.mRenderObject&&(this.mRenderObject.visible=this.mSceneEntity.getVisibility())}},{key:"updateTranslation",value:function(){if(!this.mSceneEntity.transform.matrixNeedsUpdate&&!this.mSceneEntity.transform.matrixWorldNeedsUpdate)return!1;this.mRenderObject.matrixAutoUpdate=!1;var e=this.mSceneEntity.transform.matrixWorld.clone();this.mRenderer.isRightHandedSystemActive()||e.toggleCoordSystem();var t=e.elements;return this.mMatrix.set(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]),this.mRenderObject.matrix.copy(this.mMatrix),this.mRenderObject.matrixWorldNeedsUpdate=!0,!0}},{key:"updateBoundingBox",value:function(){this.mSceneEntity._updateBoundingBox(this.mBoundingBox)}},{key:"afterCreateRenderObject",value:function(){gb(t,"afterCreateRenderObject",this,3)([]),this.mRenderObject.userData||(this.mRenderObject.userData={}),this.mRenderObject.userData.scene_entity_id=this.mSceneEntity.id}},{key:"destroyRenderObject",value:function(){}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}}])}(Ld);function Ab(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ab=function(){return!!e})()}function _b(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Mb=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,Ab()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mCastShadow",!1),(0,c.A)(r,"mReceiveShadow",!1),(0,c.A)(r,"mOldGeometryResolver",void 0),(0,c.A)(r,"mGeometryResolver",void 0),(0,c.A)(r,"mOldMaterialResolver",void 0),(0,c.A)(r,"mMaterialResolver",void 0),(0,c.A)(r,"mGeometryHandle",void 0),(0,c.A)(r,"mMaterialHandle",void 0),(0,c.A)(r,"mGeometry",void 0),(0,c.A)(r,"mMaterial",void 0),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(l=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.next=3,this.loadResources();case 3:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"geometryHasChanged",value:function(){return!this.mGeometryResolver||!this.mGeometryResolver.getHandle().validateHandle(this.mGeometryHandle)}},{key:"materialHasChanged",value:function(){return!this.mMaterialResolver||!this.mMaterialResolver.getHandle().validateHandle(this.mMaterialHandle)}},{key:"loadGeometry",value:(o=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mGeometryResolver||!this.mGeometryResolver.getHandle().validateHandle(this.mGeometryHandle)){e.next=4;break}return e.next=3,this.mGeometryResolver.load(this.onGeometryProgress.bind(this));case 3:return e.abrupt("return",e.sent);case 4:if(this.mGeometryResolver&&(this.mOldGeometryResolver=this.mGeometryResolver,delete this.mGeometryResolver),this.mGeometryHandle){e.next=7;break}throw new Error("Invalid geometry handle");case 7:return this.mGeometryResolver=new zd(this.mGeometryHandle,en.n.GeometryManager,!0),e.next=10,this.mGeometryResolver.load(this.onGeometryProgress.bind(this));case 10:return t=e.sent,this.mOldGeometryResolver&&(this.mOldGeometryResolver.dispose(),delete this.mOldGeometryResolver),e.abrupt("return",t);case 13:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"loadMaterial",value:(a=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mMaterialResolver||!this.mMaterialResolver.getHandle().validateHandle(this.mMaterialHandle)){e.next=4;break}return e.next=3,this.mMaterialResolver.load();case 3:return e.abrupt("return",e.sent);case 4:if(this.mMaterialResolver&&(this.mOldMaterialResolver=this.mMaterialResolver,delete this.mMaterialResolver),this.mMaterialHandle){e.next=7;break}throw new Error("Invalid material handle");case 7:return this.mMaterialResolver=new zd(this.mMaterialHandle,en.n.MaterialManager,!0),e.next=10,this.mMaterialResolver.load();case 10:return t=e.sent,this.mOldMaterialResolver&&(this.mOldMaterialResolver.dispose(),delete this.mOldMaterialResolver),e.abrupt("return",t);case 13:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateGeometryAsync",value:function(){var e=this;this.geometryHasChanged()&&this.loadGeometry().then((function(t){e.mGeometry=t,e.mRenderObject&&(e.mRenderObject.geometry=e.mGeometry.getInternalGeometry(),e.mRenderer.markShadowMapUpdate(),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)))})).catch((function(e){v.UX.warn("Failed to load geometry:",e)}))}},{key:"updateMaterialAsync",value:function(){var e=this;this.materialHasChanged()&&this.loadMaterial().then((function(t){e.mMaterial=t,e.mRenderObject&&(e.mRenderObject.material=e.mMaterial?e.mMaterial.getInternalMaterial():null,e.mRenderer.markShadowMapUpdate(),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)))})).catch((function(e){v.UX.warn("Failed to load material:",e)}))}},{key:"loadResources",value:(r=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.loadGeometry(),this.loadMaterial()]);case 2:if(t=e.sent,this.mGeometry=t[0],this.mMaterial=t[1],this.mMaterial){e.next=7;break}throw new Error("No material found on mesh!");case 7:R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame));case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;if(this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow,this.mGeometryHandle=e.getGeometry(),this.mMaterialHandle=e.getMaterial(),this.mRenderObject){this.mRenderObject.renderOrder=e.renderOrder,this.updateShadowProperties(this.mRenderObject);var t=this.mMaterial.getMetaData()||{};void 0!==t.renderOrder&&(this.mRenderObject.renderOrder=t.renderOrder)}}},{key:"onUpdateDirty",value:function(){_b(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.updateGeometryAsync(),this.updateMaterialAsync(),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))}},{key:"updateTranslation",value:function(){_b(t,"updateTranslation",this,3)([])&&(this.mReceiveShadow||this.mCastShadow)&&this.mRenderer.markShadowMapUpdate()}},{key:"onGeometryProgress",value:function(e){}},{key:"updateShadowProperties",value:function(e){if(this.mMaterial){var t=this.mMaterial.getOpacity();e.receiveShadow=this.mReceiveShadow&&t>.5,e.castShadow=this.mCastShadow&&t>.99}}},{key:"createRenderObject",value:function(){var e=this,t=new THREE.Mesh(this.mGeometry.getInternalGeometry(),this.mMaterial.getInternalMaterial());t.name=this.mSceneEntity.name,t.visible=this.mSceneEntity.getVisibility(),t.renderOrder=this.mSceneEntity.renderOrder,t.castShadow=this.mCastShadow,t.receiveShadow=this.mReceiveShadow,t.material.vertexColors=this.mGeometry.hasColors()?THREE.VertexColors:THREE.NoColors;var n=this.mMaterial.getMetaData()||{};void 0!==n.renderOrder&&(t.renderOrder=n.renderOrder),this.updateShadowProperties(t),t.onBeforeRender=function(n,r,i,a,o){e.getRenderer().onBeforeMeshRender(t,e.mSceneEntity,n,r,i,a,o)},t.onAfterRender=function(n,r,i,a,o){e.getRenderer().onAfterMeshRender(t,e.mSceneEntity,n,r,i,a,o)},this.mRenderObject=t}},{key:"updateBoundingBox",value:function(){this.mGeometry.getInternalGeometry().boundingBox||this.mGeometry.getInternalGeometry().computeBoundingBox();var e=(new te.P).fromArray(this.mGeometry.getInternalGeometry().boundingBox.min.toArray()),n=(new te.P).fromArray(this.mGeometry.getInternalGeometry().boundingBox.max.toArray());this.mBoundingBox.copy(new Os.N(e,n)),_b(t,"updateBoundingBox",this,3)([])}},{key:"destroyRenderObject",value:function(){if(this.mRenderObject&&(delete this.mRenderObject.onBeforeRender,delete this.mRenderObject.onAfterRender),this.mMaterialResolver)try{this.mMaterialResolver.dispose(),delete this.mMaterialResolver}catch(e){v.UX.warn("Failed to dispose resource",e)}if(this.mOldMaterialResolver)try{this.mOldMaterialResolver.dispose(),delete this.mOldMaterialResolver}catch(e){v.UX.warn("Failed to dispose resource",e)}if(this.mGeometryResolver)try{this.mGeometryResolver.dispose(),delete this.mGeometryResolver}catch(e){v.UX.warn("Failed to dispose resource",e)}if(this.mOldGeometryResolver)try{this.mOldGeometryResolver.dispose(),delete this.mOldGeometryResolver}catch(e){v.UX.warn("Failed to dispose resource",e)}_b(t,"destroyRenderObject",this,3)([])}}]);var r,a,o,l}(bb);function kb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kb=function(){return!!e})()}function wb(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Tb=function(e){function t(e,n){return(0,s.A)(this,t),r=this,i=t,a=[e,n],i=(0,oe.A)(i),(0,ae.A)(r,kb()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a));var r,i,a}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadGeometry",value:(r=(0,n.A)(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wb(t,"loadGeometry",this,3)([]);case 2:return(n=e.sent)&&n.getInternalGeometry().setIndex(null),e.abrupt("return",n);case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"createRenderObject",value:function(){var e=this;this.mGeometry&&this.mGeometry.getInternalGeometry().setIndex(null);var t=new THREE.LineSegments(this.mGeometry.getInternalGeometry(),this.mMaterial.getInternalMaterial());t.material.vertexColors=this.mGeometry.hasColors()?THREE.VertexColors:THREE.NoColors,t.computeLineDistances(),t.name=this.mSceneEntity.name,t.visible=this.mSceneEntity.getVisibility(),t.castShadow=this.mCastShadow,t.receiveShadow=this.mReceiveShadow,t.onBeforeRender=function(n,r,i,a,o){e.getRenderer().onBeforeMeshRender(t,e.mSceneEntity,n,r,i,a,o)},t.onAfterRender=function(n,r,i,a,o){e.getRenderer().onAfterMeshRender(t,e.mSceneEntity,n,r,i,a,o)},this.mRenderObject=t}}]);var r}(Mb);function xb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xb=function(){return!!e})()}var Sb=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,xb()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mCellWidth",1),(0,c.A)(r,"mCellHeight",1),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"updateProperties",value:function(){var e,n,r,i,a;(e=t,n="updateProperties",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]);var o=this.mSceneEntity;this.mCellWidth=o.getValue("cell_width"),this.mCellHeight=o.getValue("cell_height")}}])}(Mb);function Cb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Eb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cb(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rb(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ib(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ib(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ib(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ob(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ob=function(){return!!e})()}function Db(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Pb=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Ob()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mPersCamera",void 0),(0,c.A)(e,"mOrthoCamera",void 0),(0,c.A)(e,"mScreenScene",void 0),(0,c.A)(e,"mBlurShader",void 0),(0,c.A)(e,"mAOPlaneShader",void 0),(0,c.A)(e,"mDepthShaderMaterial",void 0),(0,c.A)(e,"mRT1",void 0),(0,c.A)(e,"mRT2",void 0),(0,c.A)(e,"mPlane",void 0),(0,c.A)(e,"mPlaneSize",void 0),(0,c.A)(e,"mPlaneMaterial",void 0),(0,c.A)(e,"mScreenQuad",void 0),(0,c.A)(e,"AOPlaneRTSize",256),(0,c.A)(e,"mClipDistance",.05),(0,c.A)(e,"mSamplingRadius",8),(0,c.A)(e,"mPower",.5),(0,c.A)(e,"mRebuildAO",!0),(0,c.A)(e,"mVertexShader","\n        precision highp float;\n\n        varying float vDepth;\n        varying vec2 vUv;\n        varying vec3 vModelPosition;\n\n        void main() {\n            vec4 modelPosition = modelViewMatrix * vec4( position, 1.0 );\n            vModelPosition = modelPosition.xyz;\n            vDepth =  -modelPosition.z;\n            vUv = uv;\n            gl_Position = projectionMatrix * modelPosition;\n        }\n    "),(0,c.A)(e,"mFragmentDepthShader","\n        #ifdef HIGHP_SUPPORTED\n            precision highp float;\n        #endif\n\n        #include <packing>\n        uniform float far;\n\n        varying float vDepth;\n\n        void main (){\n            gl_FragColor = packDepthToRGBA(vDepth/far); // Save depth in part-components space.\n        }\n    "),(0,c.A)(e,"mFragmentBlurShader","\n        #ifdef HIGHP_SUPPORTED\n            precision highp float;\n        #endif\n\n        uniform vec2 iResolution;\n        uniform vec2 direction;\n        uniform sampler2D tDiffuse;\n\n        varying vec2 vUv;\n\n        vec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {\n            vec4 color = vec4(0.0);\n            vec2 off1 = vec2(1.3846153846) * direction;\n            vec2 off2 = vec2(3.2307692308) * direction;\n            color += texture2D(image, uv) * 0.2270270270;\n            color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;\n            color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;\n            color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;\n            color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;\n            return color;\n        }\n\n        void main() {\n            gl_FragColor = blur9(tDiffuse, vUv, iResolution.xy, direction);\n        }\n    "),(0,c.A)(e,"mFragmentAO","\n        #ifdef HIGHP_SUPPORTED\n            precision highp float;\n        #endif\n\n        uniform sampler2D Sample0; // View space position data\n        uniform vec2 TexelSize;\n        uniform float SamplingRadius;\n        uniform float Power;\n        uniform float CameraFar;\n        uniform float CameraNear;\n        uniform vec2 RightTop;\n\n        varying vec3 vModelPosition;\n        varying vec2 vUv;\n\n        #include <packing>\n\n        vec3 reconstructPosition(vec2 uv){\n            vec2 ndc = uv*2.0 - vec2(1.0, 1.0);\n            vec4 sampleDepth = texture2D(Sample0, uv);\n            float modelDepth = unpackRGBAToDepth(sampleDepth);\n            vec2 pnear = ndc * RightTop;\n            float pz = -modelDepth*CameraFar;\n            return vec3(-pz*pnear.x / CameraNear, -pz*pnear.y / CameraNear, pz);\n        }\n\n        float SamplePixels (vec3 srcPosition, vec2 uv)\n        {\n            vec3 dstPosition = reconstructPosition(uv);\n\n            vec3 positionVec = dstPosition - srcPosition;\n            float dist = length(positionVec);\n            float intensity = dist*dist*dist*dist;\n            intensity = intensity*Power;\n            intensity = exp(-(intensity));\n\n            return min(-dstPosition.z, intensity);\n        }\n\n        void main ()\n        {\n            float kernelRadius = SamplingRadius;\n\n            // Sample neighbouring pixels\n            vec2 kernel[4];\n            kernel[0] = vec2(0.0, 1.0); // top\n            kernel[1] = vec2(1.0, 0.0); // right\n            kernel[2] = vec2(0.0, -1.0); // bottom\n            kernel[3] = vec2(-1.0, 0.0); // left\n\n            const float Sin45 = 0.707107; // 45 degrees = sin(PI / 4)\n\n            float occlusion = 0.0;\n            for (int i = 0; i < 4; ++i)\n            {\n                vec2 k1 = kernel[i];\n                vec2 k2 = vec2(k1.x * Sin45 - k1.y * Sin45, k1.x * Sin45 + k1.y * Sin45);\n                k1 *= TexelSize;\n                k2 *= TexelSize;\n                occlusion += SamplePixels(vModelPosition, vUv + k1 * kernelRadius);\n                occlusion += SamplePixels(vModelPosition, vUv + k2 * kernelRadius * 0.75);\n                occlusion += SamplePixels(vModelPosition, vUv + k1 * kernelRadius * 0.5);\n                occlusion += SamplePixels(vModelPosition, vUv + k2 * kernelRadius * 0.25);\n            }\n\n            // Average and clamp ambient occlusion.\n            occlusion /= 16.0;\n            occlusion = clamp(occlusion, 0.0, 1.0);\n\n            gl_FragColor = vec4(0.0, 0.0, 0.0, exp(occlusion) - 1.0);\n        }\n    "),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"isDirty",get:function(){return this.mRebuildAO},set:function(e){this.mRebuildAO=e}},{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties(),this.isDirty=!0;case 2:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"onUpdateDirty",value:function(){Db(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.isDirty=!0}},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mClipDistance=e.clipDistance,this.mSamplingRadius=e.samplingRadius,this.mPower=e.power}},{key:"calculatePower",value:function(){return 1/Math.exp(9*(1-(1-this.mPower)))}},{key:"fitCameraToObject",value:function(){var e=this.getRenderer().getSceneBoundingBox();e.isEmpty()&&e.set(new te.P(0,0,0),new te.P(0,0,0));var n=new te.P;e.getCenter(n);var r=new THREE.Vector3(e.max.x-e.min.x,e.max.y-e.min.y,e.max.z-e.min.z),i=r.x>r.z?r.x:r.z;if(!(i<=0)){var a=i/2/Math.tan(45*Math.PI/360);this.mPersCamera.position.set(n.x,n.y-(a+r.y),n.z),this.mPersCamera.far=Math.abs(this.mPersCamera.position.y-e.min.y)*(1+this.mClipDistance),this.mPersCamera.fov=45,this.mPersCamera.lookAt(new THREE.Vector3(n.x,n.y,n.z)),this.mPersCamera.updateProjectionMatrix();var o=2*Math.tan(Math.PI/180*45/2)*this.mPersCamera.near,s=2*Math.tan(Math.PI/180*45/2)*this.mPersCamera.far,u=new THREE.Vector3(n.x,e.min.y-t.POSITION_EPSILON,n.z),c=(s-o)*((this.mPersCamera.position.distanceTo(u)-this.mPersCamera.near)/(this.mPersCamera.far-this.mPersCamera.near));this.updatePlaneGeometry(u,c)}}},{key:"updatePlaneGeometry",value:function(e,t){if(this.mPlaneSize!==t){this.mPlane.geometry&&this.mPlane.geometry.dispose(),this.mPlaneSize=t,this.mPlane.geometry=new THREE.PlaneGeometry(t,t,1,1);var n=this.mSceneEntity;n.width=t,n.height=t}this.mPlane.position.copy(e),this.mPlane.rotation.set(1.57,0,0)}},{key:"renderPlaneDepth",value:function(e,t,n){this.mPlane.visible=!1,this.fitCameraToObject(),this.mDepthShaderMaterial.uniforms.far.value=this.mPersCamera.far,this.mDepthShaderMaterial.needsUpdate=!0;var r=t.overrideMaterial,i=t.background,a=e.getRenderTarget();t.overrideMaterial=this.mDepthShaderMaterial,t.background=null;var o=e.getClearColor(),s=e.getClearAlpha();e.setRenderTarget(this.mRT1),e.setClearColor(0,0),e.clear(),e.render(t,this.mPersCamera),this.mPlane.visible=!0,t.overrideMaterial=r,t.background=i,e.setRenderTarget(a),e.setClearColor(o,s)}},{key:"renderAO",value:function(e,t,n){var r=this.mPersCamera.far,i=this.mPersCamera.near,a=(0,_.pu)(this.mPersCamera.fov),o=this.mPersCamera.aspect,s=Math.tan(a/2)*i,u=s*o,c=new THREE.Vector2(u,s);this.mAOPlaneShader.uniforms.RightTop.value.copy(c),this.mAOPlaneShader.uniforms.SamplingRadius.value=this.mSamplingRadius,this.mAOPlaneShader.uniforms.Power.value=this.calculatePower(),this.mAOPlaneShader.uniforms.CameraFar.value=r,this.mAOPlaneShader.uniforms.CameraNear.value=i,this.mAOPlaneShader.uniforms.Sample0.value=this.mRT1.texture,this.mAOPlaneShader.uniforms.TexelSize.value.copy(new THREE.Vector2(1/this.AOPlaneRTSize,1/this.AOPlaneRTSize)),this.mAOPlaneShader.needsUpdate=!0,this.mScreenQuad.material=this.mAOPlaneShader;var l=e.getRenderTarget(),h=e.getClearColor(),f=e.getClearAlpha();e.setRenderTarget(this.mRT2),e.setClearColor(0,0),e.clear(),e.render(this.mScreenScene,this.mOrthoCamera),e.setRenderTarget(l),e.setClearColor(h,f)}},{key:"renderBlur",value:function(e,t,n){this.mBlurShader.uniforms.direction.value.set(1,0),this.mBlurShader.uniforms.tDiffuse.value=this.mRT2.texture,this.mBlurShader.needsUpdate=!0,this.mScreenQuad.material=this.mBlurShader;var r=e.getRenderTarget(),i=e.getClearColor(),a=e.getClearAlpha();e.setRenderTarget(this.mRT1),e.setClearColor(0,0),e.clear(),e.render(this.mScreenScene,this.mOrthoCamera),this.mBlurShader.uniforms.direction.value.set(0,1),this.mBlurShader.uniforms.tDiffuse.value=this.mRT1.texture,this.mBlurShader.needsUpdate=!0,e.setRenderTarget(this.mRT2),e.clear(),e.render(this.mScreenScene,this.mOrthoCamera),e.setRenderTarget(r),e.setClearColor(i,a)}},{key:"updateTranslation",value:function(){return!1}},{key:"onBeforeRender",value:function(e,t,n){var r=this;if(this.isDirty){t.layers.enable(3);var i=function(e,t){if(t(e),e.children&&e.children.length>0){var n,r=Rb(e.children);try{for(r.s();!(n=r.n()).done;){var a=n.value;i(a,t)}}catch(e){r.e(e)}finally{r.f()}}};i(t,(function(e){if(t!==e){var n=r.getRenderer().getEntityFromObject(e);n?n.layers.isEnabled(1)||n.layers.isEnabled(2)||n.layers.isEnabled(3)||n.layers.isEnabled(7)||n.layers.isEnabled(8)?e.layers.disable(3):e.layers.enable(3):e.layers.disable(3)}})),this.renderPlaneDepth(e,t,n),this.renderAO(e,t,n),this.renderBlur(e,t,n),this.mPlaneMaterial.map=this.mRT2.texture,this.mPlaneMaterial.needsUpdate=!0}}},{key:"onAfterRender",value:function(e,t,n){this.isDirty&&(this.isDirty=!1)}},{key:"createRenderObject",value:function(){var e={},n=this.mRenderer.getRenderer().getContext();n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0&&(e={HIGHP_SUPPORTED:!0}),this.mRT1=new THREE.WebGLRenderTarget(this.AOPlaneRTSize,this.AOPlaneRTSize,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}),this.mRT2=new THREE.WebGLRenderTarget(this.AOPlaneRTSize,this.AOPlaneRTSize,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}),this.mDepthShaderMaterial=new THREE.ShaderMaterial({uniforms:{far:{value:2}},defines:Eb({},e),vertexShader:this.mVertexShader,fragmentShader:this.mFragmentDepthShader}),this.mDepthShaderMaterial.side=THREE.DoubleSide,this.mPersCamera=new THREE.PerspectiveCamera(45,1,.01,1e4),this.mOrthoCamera=new THREE.OrthographicCamera(-1,1,1,-1,0,1),this.mScreenScene=new THREE.Scene,this.mPersCamera.layers.set(3),this.mBlurShader=new THREE.ShaderMaterial({uniforms:{iResolution:{value:new THREE.Vector2(this.AOPlaneRTSize,this.AOPlaneRTSize)},direction:{value:new THREE.Vector2(1,0)},tDiffuse:{value:null}},defines:Eb({},e),vertexShader:this.mVertexShader,fragmentShader:this.mFragmentBlurShader}),this.mAOPlaneShader=new THREE.ShaderMaterial({uniforms:{TexelSize:{value:new THREE.Vector2(1/this.AOPlaneRTSize,1/this.AOPlaneRTSize)},RightTop:{value:new THREE.Vector2(1,1)},SamplingRadius:{value:this.mSamplingRadius},Power:{value:this.calculatePower()},CameraFar:{value:1e3},CameraNear:{value:.01},Sample0:{value:null}},defines:Eb({},e),vertexShader:this.mVertexShader,fragmentShader:this.mFragmentAO}),this.mScreenQuad=new THREE.Mesh(new THREE.PlaneBufferGeometry(2,2)),this.mScreenQuad.frustumCulled=!1,this.mScreenScene.add(this.mScreenQuad),this.mPlaneMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.BackSide}),this.mPlaneMaterial.transparent=!0,this.mPlaneMaterial.depthWrite=!1,this.mPlane=new THREE.Mesh,this.mPlane.name="ao-plane-mesh",this.mPlane.onBeforeRender=this.onBeforeRender.bind(this),this.mPlane.onAfterRender=this.onAfterRender.bind(this),this.mPlane.material=this.mPlaneMaterial;var r=this.getRenderer().getSceneBoundingBox();r.isEmpty()&&r.set(new te.P(0,0,0),new te.P(0,0,0));var i=new te.P;r.getCenter(i),i.setY(r.min.y-t.POSITION_EPSILON),this.updatePlaneGeometry(new THREE.Vector3(i.x,i.y,i.z),10);var a=new THREE.Group;a.name="ao-plane-group",a.add(this.mPlane),this.mRenderObject=a}},{key:"disposeProperty",value:function(e){e&&e.dispose()}},{key:"dispose",value:function(){var e;this.disposeProperty(this.mRT1),this.disposeProperty(this.mRT2),this.disposeProperty(this.mPlaneMaterial),this.disposeProperty(this.mBlurShader),this.disposeProperty(this.mAOPlaneShader),this.disposeProperty(this.mDepthShaderMaterial),this.disposeProperty(this.mPlaneMaterial),this.mScreenQuad&&this.disposeProperty(this.mScreenQuad.geometry),this.mPlane&&this.disposeProperty(this.mPlane.geometry),(e=this.mScreenScene).remove.apply(e,(0,a.A)(this.mScreenScene.children)),Db(t,"dispose",this,3)([])}}]);var r}(bb);function Bb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bb=function(){return!!e})()}function Fb(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,c.A)(Pb,"POSITION_EPSILON",.001);var Nb=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Bb()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mFireMesh",null),(0,c.A)(e,"mCameraHeight",null),(0,c.A)(e,"mCameraFOV",null),(0,c.A)(e,"mClock",null),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"update",value:function(e){Fb(t,"update",this,3)([e]);var n=this.mRenderer.getRenderer(),r=this.mRenderer.getActiveCamera(),i=new THREE.Vector2;n.getSize(i),this.mCameraHeight==i.y&&this.mCameraFOV==r.fov||(this.mCameraHeight=i.y,this.mCameraFOV=r.fov,this.mFireMesh.material.setPerspective(this.mCameraFOV,this.mCameraHeight)),this.mFireMesh.material.update(this.mClock.getDelta())}},{key:"createRenderObject",value:function(){var e=new particleFire.Geometry(.5,3,300),t=new particleFire.Material({color:16720384});this.mFireMesh=new THREE.Points(e,t),this.mClock=new THREE.Clock,this.mRenderObject=this.mFireMesh}},{key:"dispose",value:function(){null!==this.mFireMesh&&(this.mFireMesh.material.dispose(),this.mFireMesh=null),this.mCameraHeight=null,this.mCameraFOV=null,this.mClock=null,Fb(t,"dispose",this,3)([])}}]);var r}(bb);function Lb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lb=function(){return!!e})()}function jb(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Ub=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Lb()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mFlareTexture",void 0),(0,c.A)(e,"mMaterial",void 0),(0,c.A)(e,"mFlareGeometry",void 0),(0,c.A)(e,"mFlarePlane",null),(0,c.A)(e,"mRayCaster",new THREE.Raycaster),(0,c.A)(e,"mAlpha",1),(0,c.A)(e,"mAngle",1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){(new THREE.TextureLoader).load("".concat(et.w.assetsUrl,"system/textures/flare-strip.png"),(function(n){t.mFlareTexture=n,e()}),(function(e){}),(function(e){v.UX.error("Failed to load water normal texture: ",e),n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"update",value:function(e){jb(t,"update",this,3)([e]);var n=this.mRenderer.getActiveCamera(),r=this.mRenderer.getScene();this.updateFlare(n,r)}},{key:"updateFlare",value:function(e,t){var n=this.mFlarePlane.matrixWorld.clone(),r=new THREE.Vector3,i=new THREE.Vector3,a=new THREE.Quaternion;n.decompose(i,a,r);var o=new THREE.Vector3;o.applyMatrix4(n);var s=new THREE.Vector3(0,0,1);s.applyQuaternion(a).normalize();var u=e.position.clone(),c=u.clone().sub(o).clone().normalize(),l=s.dot(c),h=l<0?0:l;h=(h=this.mAngle-Math.pow(-.59*(1-Math.exp(1-h)),4)-(1-this.mAlpha))<0?0:h;var f=o.clone().sub(u);if(this.mRayCaster.set(u.clone(),f.clone().normalize()),this.mRayCaster.far=f.length()-1e-4,this.mRayCaster.intersectObjects(t.children,!0).length>0)this.mMaterial.opacity=0;else{var m=new THREE.Vector3(0,1,0);(new THREE.Matrix4).lookAt(o,u.clone(),m),this.mMaterial.opacity=h,this.mFlareGeometry.verticesNeedUpdate=!0,this.mFlareGeometry.computeFaceNormals()}}},{key:"createRenderObject",value:function(){this.mMaterial=new THREE.MeshBasicMaterial({map:this.mFlareTexture,side:THREE.DoubleSide,blending:THREE.AdditiveBlending,depthTest:!1,depthFunc:THREE.LessDepth,depthWrite:!1,transparent:!0,color:16777215,opacity:.9}),this.mMaterial.needsUpdate=!0,this.mFlareGeometry=new THREE.PlaneGeometry(4,1,8),this.mFlarePlane=new THREE.Mesh(this.mFlareGeometry,this.mMaterial),this.mFlarePlane.castShadow=!1,this.mFlarePlane.receiveShadow=!1,this.mRenderObject=this.mFlarePlane}},{key:"dispose",value:function(){this.mFlareTexture&&(this.mFlareTexture.dispose(),delete this.mFlareTexture),this.mMaterial&&(this.mMaterial.dispose(),delete this.mMaterial),delete this.mFlareGeometry,delete this.mFlarePlane,jb(t,"dispose",this,3)([])}}]);var r}(bb);function Vb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vb=function(){return!!e})()}function zb(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Hb=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Vb()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mPoints",new Array),(0,c.A)(e,"mMesh",void 0),(0,c.A)(e,"mHasVertices",!1),(0,c.A)(e,"mVertices",void 0),(0,c.A)(e,"mColors",void 0),(0,c.A)(e,"mBuffer",void 0),(0,c.A)(e,"mEdgesRebuild",!1),(0,c.A)(e,"mEdges",4),(0,c.A)(e,"mSize",1),(0,c.A)(e,"mBlur",2),(0,c.A)(e,"mExtension",0),(0,c.A)(e,"mColor",new THREE.Color),(0,c.A)(e,"mFlare",new THREE.Color),(0,c.A)(e,"mAlpha",1),(0,c.A)(e,"mAngle",1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mEdges=e.getValue("edges"),this.mSize=e.getValue("size"),this.mBlur=e.getValue("blur"),this.mExtension=e.getValue("extension"),this.mAlpha=e.getValue("alpha"),this.mAngle=e.getValue("angle"),this.mColor=e.getValue("color"),this.mFlare=e.getValue("flare")}},{key:"update",value:function(e){zb(t,"update",this,3)([e]),this.mEdgesRebuild&&this._buildEdges(this.mEdges,!0);var n=this.mRenderer.getActiveCamera();this._updateGlare(n)}},{key:"onUpdateDirty",value:function(){zb(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mEdgesRebuild=!0}},{key:"createRenderObject",value:function(){this.mMesh=new THREE.Mesh(new THREE.BufferGeometry,this._createMaterial()),this._buildEdges(this.mEdges,!0),this.mRenderObject=this.mMesh}},{key:"_buildEdges",value:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]||this.mEdges!==e){this.mEdges=e,this.mPoints.splice(0,this.mPoints.length);for(var t=360/this.mEdges*.0174533,n=0;n<this.mEdges;n++){var r=new THREE.Matrix4;r.makeRotationZ(t*-n);var i=new THREE.Vector3(0,this.mSize,0);i.applyMatrix4(r),this.mPoints.push({v:new THREE.Vector3(i.x,0,i.y)})}this.mHasVertices=!1,this.mEdgesRebuild=!1}}},{key:"_updateGlare",value:function(e){for(var t=this.mMesh.matrixWorld.clone(),n=(new THREE.Matrix4).getInverse(t),r=e.projectionMatrix.clone().multiply(e.matrixWorldInverse.clone()),i=(new THREE.Matrix4).getInverse(r.clone()),a=0;a<this.mPoints.length;a++){var o=this.mPoints[a].v.clone();o.applyMatrix4(t);var s=o.clone(),u=new THREE.Vector4(s.x,s.y,s.z,1).applyMatrix4(r);u.multiplyScalar(1/u.w),this.mPoints[a].wp0=o,this.mPoints[a].sp=new THREE.Vector3(u.x,u.y,u.z)}for(var c=this.mBlur,l=0;l<this.mPoints.length;l++){var h=(l+1)%this.mPoints.length,f=this.mPoints[l].sp.clone(),m=this.mPoints[h].sp.clone(),p=f.clone().sub(m),d=new THREE.Vector3(-p.y,p.x,0);d.normalize(),f.addScaledVector(d,40),m.addScaledVector(d,40);var v=f.clone().applyMatrix4(i),y=m.clone().applyMatrix4(i);v.applyMatrix4(n),y.applyMatrix4(n);var g=v.sub(this.mPoints[l].v).normalize(),b=y.sub(this.mPoints[h].v).normalize();this.mPoints[l].wp1=this.mPoints[l].v.clone().addScaledVector(g,c),this.mPoints[l].wp2=this.mPoints[h].v.clone().addScaledVector(b,c)}var A=[],_=[],M=[],k=new THREE.Vector3,w=new THREE.Vector3,T=new THREE.Quaternion;t.decompose(k,T,w);var x=new THREE.Vector3;x.applyMatrix4(t);var S=new THREE.Vector3(0,1,0);S.applyQuaternion(T).normalize();var C=e.position.clone().clone().sub(x).clone().normalize(),E=S.dot(C),R=E<0?0:E;R=this.mAngle-Math.pow(-.59*(1-Math.exp(1-R)),4)-(1-this.mAlpha),R=Math.max(0,R);for(var I=this.mColor,O=this.mFlare,D=0;D<this.mPoints.length;D++){var P=(D+1)%this.mPoints.length;A.push(this.mPoints[D].v.x,this.mPoints[D].v.y,this.mPoints[D].v.z),_.push(I.r,I.g,I.b,R),A.push(this.mPoints[D].wp1.x,this.mPoints[D].wp1.y,this.mPoints[D].wp1.z),_.push(O.r,O.g,O.b,0),A.push(this.mPoints[D].wp2.x,this.mPoints[D].wp2.y,this.mPoints[D].wp2.z),_.push(O.r,O.g,O.b,0),A.push(this.mPoints[P].v.x,this.mPoints[P].v.y,this.mPoints[P].v.z),_.push(I.r,I.g,I.b,R);var B=this.mPoints[D].wp2.clone().addScaledVector(this.mPoints[P].wp1.clone().sub(this.mPoints[D].wp2),.5).sub(this.mPoints[P].v).normalize(),F=this.mPoints[P].v.clone().addScaledVector(B,c+this.mExtension);A.push(this.mPoints[P].v.x,this.mPoints[P].v.y,this.mPoints[P].v.z),_.push(I.r,I.g,I.b,R),A.push(this.mPoints[D].wp2.x,this.mPoints[D].wp2.y,this.mPoints[D].wp2.z),_.push(O.r,O.g,O.b,0),A.push(F.x,F.y,F.z),_.push(O.r,O.g,O.b,0),A.push(this.mPoints[P].wp1.x,this.mPoints[P].wp1.y,this.mPoints[P].wp1.z),_.push(O.r,O.g,O.b,0)}for(var N=this.mPoints[0].v.clone(),L=1;L<this.mPoints.length;L++)N.add(this.mPoints[L].v);N.multiplyScalar(1/this.mPoints.length);for(var j=0;j<this.mPoints.length;j++){var U=j,V=(j+1)%this.mPoints.length;A.push(N.x,N.y,N.z),_.push(I.r,I.g,I.b,R),A.push(this.mPoints[U].v.x,this.mPoints[U].v.y,this.mPoints[U].v.z),_.push(I.r,I.g,I.b,R),A.push(this.mPoints[V].v.x,this.mPoints[V].v.y,this.mPoints[V].v.z),_.push(I.r,I.g,I.b,R),A.push(N.x,N.y,N.z),_.push(I.r,I.g,I.b,R)}for(var z=A.length/3,H=!1,G=0;G<z;)H?(M.push(G,G-1,G-3),G+=1):(M.push(G,(G+2)%z,(G+1)%z),G+=3),H=!H;if(this.mHasVertices){for(var q=0;q<this.mVertices.length;q++)this.mVertices[q]=A[q];for(var W=0;W<this.mColors.length;W++)this.mColors[W]=_[W];this.mBuffer.getAttribute("position").needsUpdate=!0,this.mBuffer.getAttribute("customColor").needsUpdate=!0}else{this.mVertices=new Float32Array(A),this.mColors=new Float32Array(_);var K=new Uint32Array(M);this.mBuffer=new THREE.BufferGeometry,this.mBuffer.setIndex(new THREE.BufferAttribute(K,1)),this.mBuffer.addAttribute("position",new THREE.BufferAttribute(this.mVertices,3)),this.mBuffer.addAttribute("customColor",new THREE.BufferAttribute(this.mColors,4)),this.mMesh.geometry.dispose(),this.mMesh.geometry=this.mBuffer,this.mHasVertices=!0}}},{key:"_createMaterial",value:function(){return new THREE.ShaderMaterial({vertexShader:"\n            attribute vec4 customColor;\n            varying vec4 vColor;\n            void main() {\n                vColor = customColor;\n                gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n            }\n        ",fragmentShader:"\n            varying vec4 vColor;\n            void main() {\n                vec4 nlColor = vColor;\n                nlColor.a = pow(((1.0-exp(nlColor.a))*-1.0),2.0);\n                gl_FragColor = nlColor;\n            }\n        ",blending:THREE.CustomBlending,blendEquation:THREE.AddEquation,blendSrc:THREE.SrcAlphaFactor,blendDst:THREE.DstAlphaFactor,depthTest:!0,depthFunc:THREE.LessDepth,depthWrite:!1,transparent:!0,lights:!1,side:THREE.DoubleSide,wireframe:!1})}},{key:"dispose",value:function(){this.mMesh.material.dispose(),this.mBuffer&&(this.mBuffer.dispose(),delete this.mBuffer),delete this.mVertices,delete this.mMesh,delete this.mColor,this.mHasVertices=!1,zb(t,"dispose",this,3)([])}}]);var r}(bb);function Gb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gb=function(){return!!e})()}function qb(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Wb=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Gb()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mColor",new THREE.Color),(0,c.A)(e,"mOpacity",1),(0,c.A)(e,"mReflector",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mColor.setRGB(e.color.r,e.color.g,e.color.b),this.mOpacity=e.opacity}},{key:"onUpdateDirty",value:function(){qb(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.updateUniforms()}},{key:"updateUniforms",value:function(){this.mReflector&&(this.mReflector.material.uniforms.color.value=this.mColor,this.mReflector.material.uniforms.opacity.value=this.mOpacity,this.mReflector.material.needsUpdate=!0)}},{key:"createRenderObject",value:function(){var e=new THREE.PlaneBufferGeometry(20,20);this.mReflector=new THREE.Reflector(e,{clipBias:.003,textureWidth:1024,textureHeight:1024,color:this.mColor,opacity:this.mOpacity,recursion:1}),this.mReflector.rotation.x=.5*-Math.PI,v.UX.print("reflector created: ",this.mReflector),this.mRenderObject=this.mReflector}},{key:"dispose",value:function(){this.mReflector.geometry.dispose(),this.mReflector.material&&this.mReflector.material.dispose(),delete this.mReflector,qb(t,"dispose",this,3)([])}}]);var r}(bb);function Kb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kb=function(){return!!e})()}function Xb(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Yb=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Kb()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mTextureCube",null),(0,c.A)(e,"mCubeMaterial",null),(0,c.A)(e,"mTextures",void 0),(0,c.A)(e,"mHandles",{}),(0,c.A)(e,"mActiveLoaders",{}),(0,c.A)(e,"mActiveTextures",{}),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(a=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.abrupt("return",this.updateTextures());case 2:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mTextures=e.getTextureIds()}},{key:"updateHandles",value:function(){for(var e=!1,t=0,n=Object.entries(this.mTextures);t<n.length;t++){var r=(0,o.A)(n[t],2),i=r[0],a=r[1];if(!this.mHandles[i]||this.mHandles[i].id!==a){e=!0;var s=en.J.getManager(en.n.TextureManager);this.mHandles[i]&&s.disposeResource(this.mHandles[i].handle),this.mHandles[i]={id:a,handle:s.makeResource(a)}}}return e}},{key:"updateTextures",value:(r=(0,n.A)(i().mark((function e(){var t,n,r,a,s,u=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.updateHandles()){e.next=2;break}return e.abrupt("return");case 2:t=[],n=[],r=i().mark((function e(){var r,c,l,h;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(0,o.A)(s[a],2),c=r[0],l=r[1],t.push(c),!u.mActiveLoaders[c]||!u.mActiveLoaders[c].getHandle().validateHandle(l.handle)){e.next=4;break}return e.abrupt("return",1);case 4:u.mActiveLoaders[c]&&(u.mActiveLoaders[c].dispose(),delete u.mActiveLoaders[c]),u.mActiveLoaders[c]=new zd(l.handle,en.n.TextureManager),(h=u.mActiveLoaders[c].load()).then((function(e){u.mActiveTextures[c]=e})),n.push(h);case 9:case"end":return e.stop()}}),e)})),a=0,s=Object.entries(this.mHandles);case 6:if(!(a<s.length)){e.next=13;break}return e.delegateYield(r(),"t0",8);case 8:if(!e.t0){e.next=10;break}return e.abrupt("continue",10);case 10:a++,e.next=6;break;case 13:return Object.keys(this.mActiveLoaders).filter((function(e){return!t.includes(e)})).forEach((function(e){u.mActiveLoaders[e].dispose(),delete u.mActiveLoaders})),e.next=17,Promise.all(n);case 17:this.applyTextures();case 18:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"applyTextures",value:function(){if(this.mTextureCube){for(var e=0,t=Object.entries(this.mActiveTextures);e<t.length;e++){var n=(0,o.A)(t[e],2),r=n[0],i=n[1];this.mTextureCube.images[r]=i}this.mTextureCube.needsUpdate=!0}}},{key:"onUpdateDirty",value:function(){Xb(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.updateTextures().then((function(){}),(function(){}))}},{key:"createRenderObject",value:function(){this.mTextureCube=new THREE.CubeTexture,this.applyTextures();var e=THREE.ShaderLib.cube;this.mCubeMaterial=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms,depthWrite:!1,side:THREE.BackSide}),this.mCubeMaterial.uniforms.tCube.value=this.mTextureCube;var t=new THREE.Mesh(new THREE.BoxGeometry(500,500,500),this.mCubeMaterial);this.mRenderObject=t}},{key:"dispose",value:function(){var e=this;null!==this.mCubeMaterial&&(this.mCubeMaterial.dispose(),this.mCubeMaterial=null),null!==this.mTextureCube&&(this.mTextureCube.dispose(),this.mTextureCube=null);var n=en.J.getManager(en.n.TextureManager);Object.keys(this.mHandles).forEach((function(t){n.disposeResource(e.mHandles[t])})),this.mHandles={},Object.keys(this.mActiveLoaders).forEach((function(t){e.mActiveLoaders[t].dispose()})),this.mActiveLoaders={},this.mActiveTextures={},Xb(t,"dispose",this,3)([])}}]);var r,a}(bb);function $b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($b=function(){return!!e})()}function Zb(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Qb=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,$b()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mEquirectMaterial",null),(0,c.A)(e,"mTextureId",void 0),(0,c.A)(e,"mHandle",void 0),(0,c.A)(e,"mActiveLoader",void 0),(0,c.A)(e,"mActiveTexture",void 0),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(a=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.abrupt("return",this.updateTexture());case 2:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mTextureId=e.getTextureId()}},{key:"onUpdateDirty",value:function(){Zb(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.updateTexture().then((function(){}),(function(){}))}},{key:"updateHandle",value:function(){if(this.mHandle&&this.mHandle.id===this.mTextureId)return!1;var e=en.J.getManager(en.n.TextureManager);return this.mHandle&&e.disposeResource(this.mHandle.handle),!!this.mTextureId&&(this.mHandle={id:this.mTextureId,handle:e.makeResource(this.mTextureId)},!0)}},{key:"updateTexture",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.updateHandle()){e.next=2;break}return e.abrupt("return");case 2:if(!this.mActiveLoader||!this.mActiveLoader.getHandle().validateHandle(this.mHandle.handle)){e.next=4;break}return e.abrupt("return");case 4:return this.mActiveLoader&&(this.mActiveLoader.dispose(),delete this.mActiveLoader),this.mActiveLoader=new zd(this.mHandle.handle,en.n.TextureManager),e.next=8,this.mActiveLoader.load();case 8:this.mActiveTexture=e.sent,this.applyTextures();case 10:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"applyTextures",value:function(){this.mEquirectMaterial&&(this.mEquirectMaterial.uniforms.tEquirect.value=this.mActiveTexture)}},{key:"createRenderObject",value:function(){var e=THREE.ShaderLib.equirect;this.mEquirectMaterial=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms,depthWrite:!1,side:THREE.BackSide}),this.mEquirectMaterial.uniforms.tEquirect.value=this.mActiveTexture;var t=new THREE.Mesh(new THREE.BoxGeometry(500,500,500),this.mEquirectMaterial);this.mRenderObject=t}},{key:"dispose",value:function(){null!==this.mEquirectMaterial&&(this.mEquirectMaterial.dispose(),this.mEquirectMaterial=null);var e=en.J.getManager(en.n.TextureManager);this.mHandle&&e.disposeResource(this.mHandle.handle),this.mActiveLoader&&this.mActiveLoader.dispose(),Zb(t,"dispose",this,3)([])}}]);var r,a}(bb);function Jb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jb=function(){return!!e})()}function eA(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var tA=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,Jb()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mWaterNormal1",void 0),(0,c.A)(e,"mWaterNormal2",void 0),(0,c.A)(e,"mReceiveShadow",!1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(o=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.prev=1,e.next=4,this.loadWaterTextures();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),v.UX.warn("Failed to load water textures:",e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return o.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mReceiveShadow=e.receiveShadow}},{key:"loadWaterTextures",value:(a=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.loadTexture("".concat(et.w.assetsUrl,"system/textures/Water_1_M_Normal.jpg")),this.loadTexture("".concat(et.w.assetsUrl,"system/textures/Water_2_M_Normal.jpg"))]);case 2:t=e.sent,this.mWaterNormal1=t[0],this.mWaterNormal2=t[1];case 5:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"loadTexture",value:(r=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){(new THREE.TextureLoader).load(t,(function(t){e(t)}),(function(e){}),(function(e){v.UX.error("Failed to load water normal texture: ",e),n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"onUpdateDirty",value:function(){eA(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mRenderObject.receiveShadow=this.mReceiveShadow}},{key:"createRenderObject",value:function(){var e=new THREE.PlaneBufferGeometry(20,20),t=new THREE.Water(e,{color:"#ffffff",scale:1,flowDirection:new THREE.Vector2(1,1),textureWidth:1024,textureHeight:1024,normalMap0:this.mWaterNormal1,normalMap1:this.mWaterNormal2});t.receiveShadow=this.mReceiveShadow,v.UX.print("water created: ",t),this.mRenderObject=t}},{key:"dispose",value:function(){this.mWaterNormal1&&(this.mWaterNormal1.dispose(),delete this.mWaterNormal1),this.mWaterNormal2&&(this.mWaterNormal2.dispose(),delete this.mWaterNormal2),eA(t,"dispose",this,3)([])}},{key:"updateTranslation",value:function(){var e=eA(t,"updateTranslation",this,3)([]);return this.mRenderObject.matrix.multiply((new THREE.Matrix4).makeRotationFromEuler(new THREE.Euler(-.5*Math.PI,0,0))),e}}]);var r,a,o}(bb);function nA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nA=function(){return!!e})()}var rA=function(e){function t(e,n,r){var i,a,o,u;return(0,s.A)(this,t),a=this,o=t,u=["set-model-position"],o=(0,oe.A)(o),i=(0,ae.A)(a,nA()?Reflect.construct(o,u||[],(0,oe.A)(a).constructor):o.apply(a,u)),(0,c.A)(i,"mObject",void 0),(0,c.A)(i,"mNewPosition",new te.P),(0,c.A)(i,"mOldPosition",new te.P),i.mObject=e,n?i.mNewPosition.copy(n):i.mOldPosition.copy(i.mObject.transform.position),r?i.mOldPosition.copy(r):i.mOldPosition.copy(i.mObject.transform.position),i.setUpdatable(!0),i}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getNewPosition",value:function(){return this.mNewPosition}},{key:"execute",value:function(){this.mObject.transform.position.copy(this.mNewPosition),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),R.K.eventBus().dispatch(new K.r(Q.E.ObjectChanged,{name:"position",object:this.mObject})),R.K.eventBus().dispatch(new K.r(Q.E.ObjectTransformed,{object:this.mObject}))}},{key:"undo",value:function(){this.mObject.transform.position.copy(this.mOldPosition),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),R.K.eventBus().dispatch(new K.r(Q.E.ObjectChanged,{name:"position",object:this.mObject})),R.K.eventBus().dispatch(new K.r(Q.E.ObjectTransformed,{object:this.mObject}))}},{key:"overridesCommand",value:function(e){return(n=t,r="overridesCommand",i=this,a=3,o=(0,se.A)((0,oe.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]);var n,r,i,a,o}},{key:"update",value:function(e){this.mNewPosition.copy(e.getNewPosition())}}])}(pc);function iA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(iA=function(){return!!e})()}(0,c.A)(rA,"TypeRTTI",new le.O("SetPositionCommand",pc.TypeRTTI));var aA=function(e){function t(e,n,r){var i,a,o,u;return(0,s.A)(this,t),a=this,o=t,u=["set-model-rotation"],o=(0,oe.A)(o),i=(0,ae.A)(a,iA()?Reflect.construct(o,u||[],(0,oe.A)(a).constructor):o.apply(a,u)),(0,c.A)(i,"mObject",void 0),(0,c.A)(i,"mNewRotation",new re.O),(0,c.A)(i,"mOldRotation",new re.O),i.mObject=e,n?i.mNewRotation.copy(n):i.mNewRotation.copy(i.mObject.transform.rotation),r?i.mOldRotation.copy(r):i.mOldRotation.copy(i.mObject.transform.rotation),i.setUpdatable(!0),i}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getNewRotation",value:function(){return this.mNewRotation}},{key:"execute",value:function(){this.mObject.transform.rotation.copy(this.mNewRotation),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),R.K.eventBus().dispatch(new K.r(Q.E.ObjectChanged,{name:"rotation",object:this.mObject})),R.K.eventBus().dispatch(new K.r(Q.E.ObjectTransformed,{object:this.mObject}))}},{key:"undo",value:function(){this.mObject.transform.rotation.copy(this.mOldRotation),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),R.K.eventBus().dispatch(new K.r(Q.E.ObjectChanged,{name:"rotation",object:this.mObject})),R.K.eventBus().dispatch(new K.r(Q.E.ObjectTransformed,{object:this.mObject}))}},{key:"overridesCommand",value:function(e){return(n=t,r="overridesCommand",i=this,a=3,o=(0,se.A)((0,oe.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]);var n,r,i,a,o}},{key:"update",value:function(e){this.mNewRotation.copy(e.getNewRotation())}}])}(pc);function oA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oA=function(){return!!e})()}(0,c.A)(aA,"TypeRTTI",new le.O("SetRotationCommand",pc.TypeRTTI));var sA=function(e){function t(e,n,r){var i,a,o,u;return(0,s.A)(this,t),a=this,o=t,u=["set-model-scale"],o=(0,oe.A)(o),i=(0,ae.A)(a,oA()?Reflect.construct(o,u||[],(0,oe.A)(a).constructor):o.apply(a,u)),(0,c.A)(i,"mObject",void 0),(0,c.A)(i,"mNewScale",te.P.One()),(0,c.A)(i,"mOldScale",te.P.One()),i.mObject=e,n?i.mNewScale.copy(n):i.mNewScale.copy(i.mObject.transform.scale),r?i.mOldScale.copy(r):i.mOldScale.copy(i.mObject.transform.scale),i.setUpdatable(!0),i}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getNewScale",value:function(){return this.mNewScale}},{key:"execute",value:function(){this.mObject.transform.scale.copy(this.mNewScale),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),R.K.eventBus().dispatch(new K.r(Q.E.ObjectChanged,{name:"scale",object:this.mObject})),R.K.eventBus().dispatch(new K.r(Q.E.ObjectTransformed,{object:this.mObject}))}},{key:"undo",value:function(){this.mObject.transform.scale.copy(this.mOldScale),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),R.K.eventBus().dispatch(new K.r(Q.E.ObjectChanged,{name:"scale",object:this.mObject})),R.K.eventBus().dispatch(new K.r(Q.E.ObjectTransformed,{object:this.mObject}))}},{key:"overridesCommand",value:function(e){return(n=t,r="overridesCommand",i=this,a=3,o=(0,se.A)((0,oe.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]);var n,r,i,a,o}},{key:"update",value:function(e){this.mNewScale.copy(e.getNewScale())}}])}(pc);function uA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(uA=function(){return!!e})()}(0,c.A)(sA,"TypeRTTI",new le.O("SetScaleCommand",pc.TypeRTTI));var cA=function(e){function t(e,n,r){var i,a,o,u;return(0,s.A)(this,t),a=this,o=t,u=["set-model-quaternion"],o=(0,oe.A)(o),i=(0,ae.A)(a,uA()?Reflect.construct(o,u||[],(0,oe.A)(a).constructor):o.apply(a,u)),(0,c.A)(i,"mObject",void 0),(0,c.A)(i,"mNewRotation",new ne.P),(0,c.A)(i,"mOldRotation",new ne.P),i.mObject=e,n?i.mNewRotation.copy(n):i.mNewRotation.copy(i.mObject.transform.quaternion),r?i.mOldRotation.copy(r):i.mOldRotation.copy(i.mObject.transform.quaternion),i.setUpdatable(!0),i}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getNewRotation",value:function(){return this.mNewRotation}},{key:"execute",value:function(){this.mObject.transform.quaternion.copy(this.mNewRotation),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),R.K.eventBus().dispatch(new K.r(Q.E.ObjectChanged,{name:"quaternion",object:this.mObject})),R.K.eventBus().dispatch(new K.r(Q.E.ObjectTransformed,{object:this.mObject}))}},{key:"undo",value:function(){this.mObject.transform.quaternion.copy(this.mOldRotation),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),R.K.eventBus().dispatch(new K.r(Q.E.ObjectChanged,{name:"quaternion",object:this.mObject})),R.K.eventBus().dispatch(new K.r(Q.E.ObjectTransformed,{object:this.mObject}))}},{key:"overridesCommand",value:function(e){return(n=t,r="overridesCommand",i=this,a=3,o=(0,se.A)((0,oe.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]);var n,r,i,a,o}},{key:"update",value:function(e){this.mNewRotation.copy(e.getNewRotation())}}])}(pc);(0,c.A)(cA,"TypeRTTI",new le.O("SetQuaternionCommand",pc.TypeRTTI));var lA=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"transformObject",value:function(e){return e}},{key:"setPosition",value:function(e,t,n){R.K.commandManager().execute(new rA(e,t,n))}},{key:"setRotation",value:function(e,t,n){R.K.commandManager().execute(new aA(e,t,n))}},{key:"setQuaternion",value:function(e,t,n){R.K.commandManager().execute(new cA(e,t,n))}},{key:"setScale",value:function(e,t,n){R.K.commandManager().execute(new sA(e,t,n))}}])}();function hA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hA=function(){return!!e})()}var fA=function(e){function t(e,n,r){var i,a,o,u;return(0,s.A)(this,t),a=this,o=t,u=["Set model value"],o=(0,oe.A)(o),i=(0,ae.A)(a,hA()?Reflect.construct(o,u||[],(0,oe.A)(a).constructor):o.apply(a,u)),(0,c.A)(i,"mObject",void 0),(0,c.A)(i,"mAttribute",void 0),(0,c.A)(i,"mPrevValue",void 0),(0,c.A)(i,"mValue",void 0),i.mObject=e,i.mAttribute=n,i.mPrevValue=i.mObject.getValue(i.mAttribute),i.mValue=r,i.setUpdatable(!0),i}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getAttribute",value:function(){return this.mAttribute}},{key:"getValue",value:function(){return this.mValue}},{key:"execute",value:function(){this.mObject.setValue(this.mAttribute,this.mValue),R.K.eventBus().dispatch(new K.r(Q.E.ModelAttributeChanged,{attribute:this.mAttribute,model:this.mObject})),this.isTransformAttribute(this.mAttribute)&&R.K.eventBus().dispatch(new K.r(Q.E.ObjectTransformed,{object:this.mObject}))}},{key:"undo",value:function(){this.mObject.setValue(this.mAttribute,this.mPrevValue),R.K.eventBus().dispatch(new K.r(Q.E.ModelAttributeChanged,{attribute:this.mAttribute,model:this.mObject})),this.isTransformAttribute(this.mAttribute)&&R.K.eventBus().dispatch(new K.r(Q.E.ObjectTransformed,{object:this.mObject}))}},{key:"overridesCommand",value:function(e){return(n=t,r="overridesCommand",i=this,a=3,o=(0,se.A)((0,oe.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e])&&this.mAttribute===e.getAttribute();var n,r,i,a,o}},{key:"update",value:function(e){this.mValue=e.getValue()}},{key:"isTransformAttribute",value:function(e){return["position","position_x","position_y","position_z","rotation","rotation_x","rotation_y","rotation_z","quaternion","quaternion_x","quaternion_y","quaternion_z","quaternion_w","scale","scale_x","scale_y","scale_z","transform"].includes(e)}}])}(pc);function mA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mA=function(){return!!e})()}(0,c.A)(fA,"TypeRTTI",new le.O("SetModelValueCommand",pc.TypeRTTI));var pA=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,mA()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mAttribute",void 0),n.mAttribute=e,n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"transformObject",value:function(e){return e}},{key:"setPosition",value:function(e,t,n){R.K.commandManager().execute(new fA(e,this.mAttribute,t)),R.K.eventBus().dispatch(new K.r(Q.E.ObjectChanged,{name:"position",object:e})),window.setTimeout((function(){R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame))}),300)}},{key:"setRotation",value:function(e,t,n){}},{key:"setScale",value:function(e,t,n){}}])}(lA);function dA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dA=function(){return!!e})()}function vA(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var yA=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,dA()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mReceiveShadow",!1),(0,c.A)(e,"mCastShadow",!1),(0,c.A)(e,"mPointA",new THREE.Vector3),(0,c.A)(e,"mPointB",new THREE.Vector3),(0,c.A)(e,"mSpriteOffset",new THREE.Vector3),(0,c.A)(e,"mMarkerA",null),(0,c.A)(e,"mMarkerB",null),(0,c.A)(e,"mMarkerMaterial",null),(0,c.A)(e,"mLineMaterial",null),(0,c.A)(e,"mLineMesh",null),(0,c.A)(e,"mLineGeometry",null),(0,c.A)(e,"mLineColor",new THREE.Color),(0,c.A)(e,"mMeshLine",null),(0,c.A)(e,"mResolution",new THREE.Vector2),(0,c.A)(e,"mLabel",{title:"",color:new THREE.Color(0,0,0),fontSize:16,spriteScale:1}),(0,c.A)(e,"mSpriteNode",null),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow;var t=e.pointA.clone(),n=e.pointB.clone();this.mRenderer.isRightHandedSystemActive()||(t.z*=-1,n.z*=-1),this.mPointA.set(t.x,t.y,t.z),this.mPointB.set(n.x,n.y,n.z),this.mSpriteOffset.set(e.spriteOffset.x,e.spriteOffset.y,e.spriteOffset.z),this.mLineColor.setRGB(e.lineColor.r,e.lineColor.g,e.lineColor.b),this.mLabel.title=e.labelText,this.mLabel.color.setRGB(e.labelColor.r,e.labelColor.g,e.labelColor.b),this.mLabel.fontSize=e.labelFontSize,this.mLabel.spriteScale=e.labelSpriteScale}},{key:"updateLine",value:function(){if(this.mLineMesh&&this.mMeshLine){v.UX.print("update point a: ",this.mPointA),v.UX.print("update point b: ",this.mPointB),this.mLineGeometry.vertices[0].copy(this.mPointA),this.mLineGeometry.vertices[1].copy(this.mPointB),this.mMeshLine.setGeometry(this.mLineGeometry,(function(){return 1}));var e=this.mMeshLine.geometry;this.mLineMesh.geometry.dispose(),this.mLineMesh.geometry=e,this.mLineMesh.geometry.computeBoundingSphere(),this.mLineMesh.updateMatrix(),this.mMarkerA.position.copy(this.mPointA),this.mMarkerB.position.copy(this.mPointB),this.mLineMaterial&&(this.mLineMaterial.color=this.mLineColor,this.mLineMaterial.needsUpdate=!0),this.mMarkerMaterial&&(this.mMarkerMaterial.color=this.mLineColor,this.mMarkerMaterial.needsUpdate=!0),this.mSpriteNode&&this.mSpriteNode.position.copy(this.getSpritePosition())}}},{key:"updateText",value:function(){if(this.mLineMesh)if("string"==typeof this.mLabel.title&&this.mLabel.title.length>0){if(this.mSpriteNode){var e=this.mSpriteNode.material,t=e.map;t.text=this.mLabel.title,t.fontSize=this.mLabel.fontSize,e.color=this.mLabel.color,t&&t.redraw();var n=1;e.map&&e.map.image&&h.N5.isNumeric(e.map.image.height)&&(n=e.map.image.width/e.map.image.height),this.mSpriteNode.scale.setX(n).setY(1).multiplyScalar(.05*this.mLabel.spriteScale),this.mSpriteNode.updateMatrixWorld(!1)}else this.mSpriteNode=this.makeSpriteNode(),this.mLineMesh.parent&&this.mLineMesh.parent.add(this.mSpriteNode);this.mSpriteNode.position.copy(this.getSpritePosition())}else if(this.mSpriteNode){var r=this.mSpriteNode.material;r&&r.map&&r.map.dispose(),this.mSpriteNode.material.dispose(),this.mSpriteNode.parent.remove(this.mSpriteNode),this.mSpriteNode=null}}},{key:"update",value:function(e){vA(t,"update",this,3)([e]);var n=this.mRenderer.getRenderer(),r=this.mRenderer.getActiveCamera();this.updateMaterial(n,r)}},{key:"onUpdateDirty",value:function(){vA(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.updateLine(),this.updateText()}},{key:"updateMaterial",value:function(e,t){var n=new THREE.Vector2;if(e.getSize(n),n.distanceTo(this.mResolution)>.001){this.mResolution.copy(n),this.mLineMaterial.uniforms.resolution.value.copy(this.mResolution);var r=t;this.mLineMaterial.uniforms.near.value=r.near,this.mLineMaterial.uniforms.far.value=r.far,this.mLineMaterial.needsUpdate=!0}}},{key:"getSpritePosition",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.mPointA.clone().add(this.mPointB.clone().sub(this.mPointA).normalize().multiplyScalar(.5*this.mPointB.distanceTo(this.mPointA))).add(e?this.mSpriteOffset:new THREE.Vector3)}},{key:"makeSpriteNode",value:function(){var e=new THREE.TextTexture({align:"center",fillStyle:"#ffffff",fontFamily:"Arial, Helvetica, sans-serif",fontSize:this.mLabel.fontSize,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineGap:.15,padding:.25,strokeStyle:"#ffffff",strokeWidth:0,text:this.mLabel.title}),t=new THREE.SpriteMaterial({map:e,color:this.mLabel.color,transparent:!0,depthTest:!0}),n=new THREE.Sprite(t);e.redraw();var r=1;return e.image&&h.N5.isNumeric(e.image.height)&&(r=e.image.width/e.image.height),n.scale.setX(r).multiplyScalar(.05*this.mLabel.spriteScale),n.userData||(n.userData={}),n.userData.scene_entity_id=this.mSceneEntity.id,n.userData.transforms=new pA("inv_sprite_offset"),n}},{key:"createRenderObject",value:function(){var e=new THREE.Group;e.userData={},e.userData.scene_entity_id=this.mSceneEntity.id,this.mMarkerMaterial=new THREE.MeshBasicMaterial({color:this.mLineColor,depthTest:!0,depthWrite:!0}),this.mMarkerA=new THREE.Mesh(new THREE.SphereGeometry(.006,32,32),this.mMarkerMaterial),this.mMarkerA.name="$__xpv_line_marker_a",this.mMarkerA.userData={},this.mMarkerA.position.copy(this.mPointA),this.mMarkerB=this.mMarkerA.clone(),this.mMarkerB.name="$__xpv_line_marker_b",this.mMarkerB.userData={},this.mMarkerB.position.copy(this.mPointB),this.mMarkerA.userData.scene_entity_id=this.mSceneEntity.id,this.mMarkerB.userData.scene_entity_id=this.mSceneEntity.id,this.mMarkerA.userData.transforms=new pA("point_a"),this.mMarkerB.userData.transforms=new pA("point_b"),e.add(this.mMarkerA),e.add(this.mMarkerB),this.mLineGeometry=new THREE.Geometry,this.mLineGeometry.vertices.push(this.mPointA),this.mLineGeometry.vertices.push(this.mPointB),this.mMeshLine=new MeshLine,this.mMeshLine.setGeometry(this.mLineGeometry,(function(){return 1})),this.mLineMaterial=new MeshLineMaterial({color:this.mLineColor,sizeAttenuation:1,lineWidth:.005,transparent:!0,depthWrite:!0,side:THREE.DoubleSide}),this.mLineMesh=new THREE.Mesh(this.mMeshLine.geometry,this.mLineMaterial),this.mLineMesh.name="$__xpv_line",this.mLineMesh.userData={},this.mLineMesh.userData.scene_entity_id=this.mSceneEntity.id,e.add(this.mLineMesh),"string"==typeof this.mLabel.title&&this.mLabel.title.length>0&&(this.mSpriteNode=this.makeSpriteNode(),this.mSpriteNode.position.copy(this.getSpritePosition()),e.add(this.mSpriteNode)),e.castShadow=this.mCastShadow,e.receiveShadow=this.mReceiveShadow,this.mRenderObject=e}},{key:"dispose",value:function(){this.mMarkerA.geometry.dispose(),this.mMarkerB.geometry.dispose(),this.mLineGeometry.dispose(),this.mLineMesh.geometry.dispose(),this.mLineMaterial.dispose(),this.mMarkerMaterial.dispose(),null!==this.mSpriteNode&&this.mSpriteNode.material.dispose(),delete this.mMarkerA.userData.transforms,delete this.mMarkerA.userData.transforms,this.mMarkerA=this.mMarkerB=this.mLineMesh=this.mMeshLine=this.mLineGeometry=this.mSpriteNode=null,vA(t,"dispose",this,3)([])}},{key:"updateBoundingBox",value:function(){this.mMarkerA.geometry.boundingBox||this.mMarkerA.geometry.computeBoundingBox(),this.mMarkerB.geometry.boundingBox||this.mMarkerB.geometry.computeBoundingBox();var e=new THREE.Box3;e.union(this.mMarkerA.geometry.boundingBox),e.union(this.mMarkerB.geometry.boundingBox);var n=(new te.P).fromArray(e.min.toArray()),r=(new te.P).fromArray(e.max.toArray());this.mBoundingBox.copy(new Os.N(n,r)),vA(t,"updateBoundingBox",this,3)([])}}]);var r}(bb);function gA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gA=function(){return!!e})()}function bA(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var AA=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,gA()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mCastShadow",!1),(0,c.A)(e,"mReceiveShadow",!1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow}},{key:"onUpdateDirty",value:function(){bA(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mRenderObject.receiveShadow=this.mReceiveShadow,this.mRenderObject.castShadow=this.mCastShadow}},{key:"createRenderObject",value:function(){var e=this,t=new THREE.BoxBufferGeometry(1,1,1),n=new THREE.MeshPhongMaterial;n.color=new THREE.Color(15987699);var r=new THREE.Mesh(t,n);r.name="Box",r.castShadow=this.mCastShadow,r.receiveShadow=this.mReceiveShadow,r.onBeforeRender=function(t,n,i,a,o){e.getRenderer().onBeforeMeshRender(r,e.mSceneEntity,t,n,i,a,o)},r.onAfterRender=function(t,n,i,a,o){e.getRenderer().onAfterMeshRender(r,e.mSceneEntity,t,n,i,a,o)},this.mRenderObject=r}},{key:"destroyRenderObject",value:function(){if(this.mRenderObject){delete this.mRenderObject.onBeforeRender,delete this.mRenderObject.onAfterRender;var e=this.mRenderObject;e.geometry.dispose(),e.material.dispose()}bA(t,"destroyRenderObject",this,3)([])}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject;e.geometry.boundingBox||e.geometry.computeBoundingBox();var n=(new te.P).fromArray(e.geometry.boundingBox.min.toArray()),r=(new te.P).fromArray(e.geometry.boundingBox.max.toArray());this.mBoundingBox.copy(new Os.N(n,r)),bA(t,"updateBoundingBox",this,3)([])}}]);var r}(bb);function _A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_A=function(){return!!e})()}function MA(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var kA=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,_A()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mCastShadow",!1),(0,c.A)(e,"mReceiveShadow",!1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow}},{key:"onUpdateDirty",value:function(){MA(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mRenderObject.receiveShadow=this.mReceiveShadow,this.mRenderObject.castShadow=this.mCastShadow}},{key:"createRenderObject",value:function(){var e=this,t=new THREE.PlaneBufferGeometry(2,2),n=new THREE.MeshPhongMaterial;n.color=new THREE.Color(15987699);var r=new THREE.Mesh(t,n);r.name="Plane",r.castShadow=this.mCastShadow,r.receiveShadow=this.mReceiveShadow,r.onBeforeRender=function(t,n,i,a,o){e.getRenderer().onBeforeMeshRender(r,e.mSceneEntity,t,n,i,a,o)},r.onAfterRender=function(t,n,i,a,o){e.getRenderer().onAfterMeshRender(r,e.mSceneEntity,t,n,i,a,o)},this.mRenderObject=r}},{key:"destroyRenderObject",value:function(){if(this.mRenderObject){delete this.mRenderObject.onBeforeRender,delete this.mRenderObject.onAfterRender;var e=this.mRenderObject;e.geometry.dispose(),e.material.dispose()}MA(t,"destroyRenderObject",this,3)([])}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject;e.geometry.boundingBox||e.geometry.computeBoundingBox();var n=(new te.P).fromArray(e.geometry.boundingBox.min.toArray()),r=(new te.P).fromArray(e.geometry.boundingBox.max.toArray());this.mBoundingBox.copy(new Os.N(n,r)),MA(t,"updateBoundingBox",this,3)([])}}]);var r}(bb);function wA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wA=function(){return!!e})()}function TA(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var xA=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,wA()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mCastShadow",!1),(0,c.A)(e,"mReceiveShadow",!1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow}},{key:"onUpdateDirty",value:function(){TA(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mRenderObject.receiveShadow=this.mReceiveShadow,this.mRenderObject.castShadow=this.mCastShadow}},{key:"createRenderObject",value:function(){var e=this,t=new THREE.SphereBufferGeometry(.5,64,64),n=new THREE.MeshPhongMaterial;n.color=new THREE.Color(15987699);var r=new THREE.Mesh(t,n);r.name="Sphere",r.castShadow=this.mCastShadow,r.receiveShadow=this.mReceiveShadow,r.onBeforeRender=function(t,n,i,a,o){e.getRenderer().onBeforeMeshRender(r,e.mSceneEntity,t,n,i,a,o)},r.onAfterRender=function(t,n,i,a,o){e.getRenderer().onAfterMeshRender(r,e.mSceneEntity,t,n,i,a,o)},this.mRenderObject=r}},{key:"destroyRenderObject",value:function(){if(this.mRenderObject){delete this.mRenderObject.onBeforeRender,delete this.mRenderObject.onAfterRender;var e=this.mRenderObject;e.geometry.dispose(),e.material.dispose()}TA(t,"destroyRenderObject",this,3)([])}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject;e.geometry.boundingBox||e.geometry.computeBoundingBox();var n=(new te.P).fromArray(e.geometry.boundingBox.min.toArray()),r=(new te.P).fromArray(e.geometry.boundingBox.max.toArray());this.mBoundingBox.copy(new Os.N(n,r)),TA(t,"updateBoundingBox",this,3)([])}}]);var r}(bb);function SA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(SA=function(){return!!e})()}var CA=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,SA()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mColor",Ft.v.White()),(0,c.A)(e,"mIntensity",1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mColor.copy(e.color),this.mIntensity=e.intensity}},{key:"onUpdateDirty",value:function(){var e,n,r,i,a;(e=t,n="onUpdateDirty",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties();var o=this.mRenderObject;o.intensity=this.mIntensity,o.color.setRGB(this.mColor.r,this.mColor.g,this.mColor.b)}},{key:"createRenderObject",value:function(){var e=new THREE.AmbientLight(new THREE.Color(this.mColor.r,this.mColor.g,this.mColor.b),this.mIntensity);e.name="Ambient Light",this.mRenderObject=e}}]);var r}(bb);function EA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(EA=function(){return!!e})()}var RA=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,EA()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mCastShadow",!1),(0,c.A)(e,"mColor",Ft.v.White()),(0,c.A)(e,"mTarget",te.P.Zero()),(0,c.A)(e,"mIntensity",1),(0,c.A)(e,"mShadowBias",0),(0,c.A)(e,"mShadowCameraNear",.1),(0,c.A)(e,"mShadowCameraFar",500),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mColor.copy(e.color),this.mTarget.copy(e.target),this.mIntensity=e.intensity,this.mShadowBias=e.shadowBias,this.mShadowCameraNear=e.shadowCameraNear,this.mShadowCameraFar=e.shadowCameraFar}},{key:"onUpdateDirty",value:function(){var e,n,r,i,a;(e=t,n="onUpdateDirty",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties();var o=this.mRenderObject;o.castShadow=this.mCastShadow,o.target.position.set(this.mTarget.x,this.mTarget.y,this.mTarget.z),o.target.updateMatrixWorld(!1),o.color.setRGB(this.mColor.r,this.mColor.g,this.mColor.b),o.intensity=this.mIntensity,this.mCastShadow&&(o.shadow.bias=this.mShadowBias,o.shadow.camera.near=this.mShadowCameraNear,o.shadow.camera.far=this.mShadowCameraFar)}},{key:"createRenderObject",value:function(){var e=new THREE.Object3D;e.position.set(this.mTarget.x,this.mTarget.y,this.mTarget.z),e.updateMatrixWorld(!0);var t=new THREE.DirectionalLight(new THREE.Color(this.mColor.r,this.mColor.g,this.mColor.b),this.mIntensity);t.name="Directional Light",t.target=e,t.castShadow=this.mCastShadow,t.shadow.mapSize.width=1024,t.shadow.mapSize.height=1024,t.shadow.bias=this.mShadowBias,t.shadow.camera.near=this.mShadowCameraNear,t.shadow.camera.far=this.mShadowCameraFar,this.mRenderObject=t}}]);var r}(bb);function IA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(IA=function(){return!!e})()}var OA=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,IA()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mColor",Ft.v.White()),(0,c.A)(e,"mGroundColor",Ft.v.White()),(0,c.A)(e,"mIntensity",1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mColor.copy(e.color),this.mGroundColor.copy(e.groundColor),this.mIntensity=e.intensity}},{key:"onUpdateDirty",value:function(){var e,n,r,i,a;(e=t,n="onUpdateDirty",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties();var o=this.mRenderObject;o.intensity=this.mIntensity,o.color.setRGB(this.mColor.r,this.mColor.g,this.mColor.b),o.groundColor.setRGB(this.mGroundColor.r,this.mGroundColor.g,this.mGroundColor.b)}},{key:"createRenderObject",value:function(){var e=new THREE.HemisphereLight(new THREE.Color(this.mColor.r,this.mColor.g,this.mColor.b),new THREE.Color(this.mGroundColor.r,this.mGroundColor.g,this.mGroundColor.b),this.mIntensity);e.name="Hemisphere Light",this.mRenderObject=e}}]);var r}(bb);function DA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(DA=function(){return!!e})()}var PA=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,DA()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mCastShadow",!1),(0,c.A)(e,"mColor",new Ft.v),(0,c.A)(e,"mDistance",0),(0,c.A)(e,"mDecay",1),(0,c.A)(e,"mIntensity",1),(0,c.A)(e,"mShadowBias",0),(0,c.A)(e,"mShadowCameraNear",.1),(0,c.A)(e,"mShadowCameraFar",500),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mColor.copy(e.color),this.mDistance=e.distance,this.mDecay=e.decay,this.mIntensity=e.intensity,this.mShadowBias=e.shadowBias,this.mShadowCameraNear=e.shadowCameraNear,this.mShadowCameraFar=e.shadowCameraFar}},{key:"onUpdateDirty",value:function(){var e,n,r,i,a;(e=t,n="onUpdateDirty",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties();var o=this.mRenderObject;o.castShadow=this.mCastShadow,o.color.setRGB(this.mColor.r,this.mColor.g,this.mColor.b),o.intensity=this.mIntensity,o.distance=this.mDistance,o.decay=this.mDecay,this.mCastShadow&&(o.shadow.bias=this.mShadowBias,o.shadow.camera.near=this.mShadowCameraNear,o.shadow.camera.far=this.mShadowCameraFar)}},{key:"createRenderObject",value:function(){var e=new THREE.PointLight(new THREE.Color(this.mColor.r,this.mColor.g,this.mColor.b),this.mIntensity,this.mDistance,this.mDecay);e.name="Point Light",e.castShadow=this.mCastShadow,e.shadow.mapSize.width=1024,e.shadow.mapSize.height=1024,e.shadow.bias=this.mShadowBias,e.shadow.camera.near=this.mShadowCameraNear,e.shadow.camera.far=this.mShadowCameraFar,this.mRenderObject=e}}]);var r}(bb);function BA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(BA=function(){return!!e})()}var FA=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,BA()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mCastShadow",!1),(0,c.A)(e,"mColor",Ft.v.White()),(0,c.A)(e,"mTarget",te.P.Zero()),(0,c.A)(e,"mDistance",0),(0,c.A)(e,"mAngle",.1*Math.PI),(0,c.A)(e,"mPenumbra",0),(0,c.A)(e,"mDecay",1),(0,c.A)(e,"mIntensity",1),(0,c.A)(e,"mShadowBias",0),(0,c.A)(e,"mShadowCameraNear",.1),(0,c.A)(e,"mShadowCameraFar",500),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mColor.copy(e.color),this.mTarget.copy(e.target),this.mDistance=e.distance,this.mDecay=e.decay,this.mAngle=e.angle,this.mPenumbra=e.penumbra,this.mIntensity=e.intensity,this.mShadowBias=e.shadowBias,this.mShadowCameraNear=e.shadowCameraNear,this.mShadowCameraFar=e.shadowCameraFar}},{key:"onUpdateDirty",value:function(){var e,n,r,i,a;(e=t,n="onUpdateDirty",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties();var o=this.mRenderObject;o.castShadow=this.mCastShadow,o.target.position.set(this.mTarget.x,this.mTarget.y,this.mTarget.z),o.target.updateMatrixWorld(!1),o.color.setRGB(this.mColor.r,this.mColor.g,this.mColor.b),o.intensity=this.mIntensity,o.distance=this.mDistance,o.angle=this.mAngle,o.penumbra=this.mPenumbra,o.decay=this.mDecay,this.mCastShadow&&(o.shadow.bias=this.mShadowBias,o.shadow.camera.near=this.mShadowCameraNear,o.shadow.camera.far=this.mShadowCameraFar)}},{key:"createRenderObject",value:function(){var e=new THREE.Object3D;e.position.set(this.mTarget.x,this.mTarget.y,this.mTarget.z),e.updateMatrixWorld(!0);var t=new THREE.SpotLight(new THREE.Color(this.mColor.r,this.mColor.g,this.mColor.b),this.mIntensity,this.mDistance,this.mAngle,this.mPenumbra,this.mDecay);t.name="Spot Light",t.target=e,t.castShadow=this.mCastShadow,t.shadow.mapSize.width=1024,t.shadow.mapSize.height=1024,t.shadow.bias=this.mShadowBias,t.shadow.camera.near=this.mShadowCameraNear,t.shadow.camera.far=this.mShadowCameraFar,this.mRenderObject=t}}]);var r}(bb);function NA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(NA=function(){return!!e})()}var LA=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,NA()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mColor",Ft.v.White()),(0,c.A)(e,"mWidth",10),(0,c.A)(e,"mHeight",10),(0,c.A)(e,"mIntensity",1),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mColor.copy(e.color),this.mWidth=e.width,this.mHeight=e.height,this.mIntensity=e.intensity}},{key:"onUpdateDirty",value:function(){var e,n,r,i,a;(e=t,n="onUpdateDirty",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties();var o=this.mRenderObject;o.color.setRGB(this.mColor.r,this.mColor.g,this.mColor.b),o.intensity=this.mIntensity,o.width=this.mWidth,o.height=this.mHeight}},{key:"createRenderObject",value:function(){var e=new THREE.RectAreaLight(new THREE.Color(this.mColor.r,this.mColor.g,this.mColor.b),this.mIntensity,this.mWidth,this.mHeight);e.name="Rect Area Light",this.mRenderObject=e}}]);var r}(bb),jA=(0,u.A)((function e(t,n){(0,s.A)(this,e),(0,c.A)(this,"mCamera",void 0),(0,c.A)(this,"mRenderer",void 0),this.mCamera=t,this.mRenderer=n}));function UA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(UA=function(){return!!e})()}var VA=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,UA()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mControls",void 0),(0,c.A)(r,"mEnabled",!0),(0,c.A)(r,"mTarget",te.P.Zero()),(0,c.A)(r,"mMovementSpeed",void 0),(0,c.A)(r,"mConstrainVertical",void 0),(0,c.A)(r,"mKeysEnabled",void 0),(0,c.A)(r,"mLookSpeed",void 0),(0,c.A)(r,"mPreviousPosition",te.P.Zero()),(0,c.A)(r,"mPreviousQuaternion",ne.P.identity()),(0,c.A)(r,"mIsPanning",!1),(0,c.A)(r,"mIsRotating",!1),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadCameraControls",value:function(){var e=this.mCamera.getSceneEntity(),t=e.getComponent("fps-camera-controls");this.mEnabled=t.enabled,this.mTarget.copy(e.target),this.mMovementSpeed=t.movementSpeed,this.mConstrainVertical=t.constrainVertical,this.mKeysEnabled=t.keyboardEnabled,this.mLookSpeed=t.lookSpeed}},{key:"createCameraControls",value:function(){var e=this.mCamera.getCamera();this.mControls||(this.mControls=new THREE.ExpiviFirstPersonControls(e,this.mRenderer.getCanvas())),this.mControls.enabled=this.mEnabled,this.mControls.target||(this.mControls.target=new THREE.Vector3),this.mControls.target.set(this.mTarget.x,this.mTarget.y,this.mTarget.z),this.mControls.movementSpeed=this.mMovementSpeed,this.mControls.lookVertical=!this.mConstrainVertical,this.mControls.lookSpeed=this.mLookSpeed,this.mControls.enableKeys=this.mKeysEnabled,this.mPreviousPosition.set(e.position.x,e.position.y,e.position.z),this.mPreviousQuaternion.set(e.quaternion.x,e.quaternion.y,e.quaternion.z,e.quaternion.w)}},{key:"destroyCameraControls",value:function(){this.mControls.dispose(),this.mControls=void 0}},{key:"update",value:function(e){if(this.mControls){this.mControls.update(e);var t=this.mCamera.getSceneEntity(),n=this.mCamera.getCamera(),r=!1,i=!1;this.didPan()&&(t.transform.position.set(n.position.x,n.position.y,n.position.z),r=!0),this.didRotate()&&(t.transform.quaternion.set(n.quaternion.x,n.quaternion.y,n.quaternion.z,n.quaternion.w),r||(i=!0)),this.mPreviousQuaternion.set(n.quaternion.x,n.quaternion.y,n.quaternion.z,n.quaternion.w),this.mPreviousPosition.set(n.position.x,n.position.y,n.position.z);var a=ve.Unchanged,o=ve.Unchanged;r&&!this.mIsPanning?a=ve.Started:!r&&this.mIsPanning?a=ve.Ended:r&&(a=ve.Changed),i&&!this.mIsRotating?o=ve.Started:!i&&this.mIsRotating?o=ve.Ended:i&&(o=ve.Changed),this.mIsPanning=r,this.mIsRotating=i,a!==ve.Unchanged&&R.K.eventBus().dispatch(new Me(ge.Pan,a)),o!==ve.Unchanged&&R.K.eventBus().dispatch(new Me(ge.Rotate,o))}}},{key:"onUpdateDirty",value:function(){var e=this.mCamera.getSceneEntity();this.loadCameraControls(),this.createCameraControls();var t=e.getComponent("fps-camera-controls");t.getValue("fps_controls.resize_update")&&this.mControls.handleResize(),t.getValue("fps_controls.reset_state")&&this.mControls.reset(),t.setNeedsRenderUpdate(!1)}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}},{key:"getComponentName",value:function(){return"fps-camera-controls"}},{key:"didPan",value:function(){var e=this.mCamera.getCamera(),t=this.mPreviousPosition.x-e.position.x,n=this.mPreviousPosition.y-e.position.y,r=this.mPreviousPosition.z-e.position.z;return t*t+n*n+r*r>1e-8}},{key:"didRotate",value:function(){var e=this.mCamera.getCamera();return 8*(1-(this.mPreviousQuaternion.x*e.quaternion.x+this.mPreviousQuaternion.y*e.quaternion.y+this.mPreviousQuaternion.z*e.quaternion.z+this.mPreviousQuaternion.w*e.quaternion.w))>1e-8}}])}(jA);function zA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zA=function(){return!!e})()}var HA=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,zA()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mControls",void 0),(0,c.A)(r,"mEnabled",!0),(0,c.A)(r,"mTarget",te.P.Zero()),(0,c.A)(r,"mLockUpHemisphere",!1),(0,c.A)(r,"mMinAzimuthAngle",-1/0),(0,c.A)(r,"mMaxAzimuthAngle",1/0),(0,c.A)(r,"mMinPolarAngle",0),(0,c.A)(r,"mMaxPolarAngle",Math.PI),(0,c.A)(r,"mRotateEnabled",!0),(0,c.A)(r,"mRotationSpeed",1),(0,c.A)(r,"mPanEnabled",!0),(0,c.A)(r,"mPanSpeed",1),(0,c.A)(r,"mZoomEnabled",!0),(0,c.A)(r,"mZoomSpeed",1),(0,c.A)(r,"mMinZoom",0),(0,c.A)(r,"mMaxZoom",1/0),(0,c.A)(r,"mDampingEnabled",!0),(0,c.A)(r,"mDampFactor",.1),(0,c.A)(r,"mAutoRotate",!1),(0,c.A)(r,"mAutoRotateSpeed",2),(0,c.A)(r,"mKeysDisabled",!1),(0,c.A)(r,"mPreviousPosition",te.P.Zero()),(0,c.A)(r,"mPreviousTarget",te.P.Zero()),(0,c.A)(r,"mPreviousRadius",0),(0,c.A)(r,"mIsPanning",!1),(0,c.A)(r,"mIsRotating",!1),(0,c.A)(r,"mIsZooming",!1),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadCameraControls",value:function(){var e=this.mCamera.getSceneEntity(),t=e.getComponent("orbit-camera-controls");this.mEnabled=t.enabled,this.mTarget.copy(e.target),this.mPanEnabled=t.panEnabled,this.mPanSpeed=t.panSpeed,this.mRotateEnabled=t.rotateEnabled,this.mRotationSpeed=t.rotateSpeed,this.mZoomEnabled=t.zoomEnabled,this.mZoomSpeed=t.zoomSpeed,this.mMinZoom=t.zoomMin,this.mMaxZoom=t.zoomMax,this.mLockUpHemisphere=t.isUpHemisphereLocked,this.mMinAzimuthAngle=t.azimuthAngleMin,this.mMaxAzimuthAngle=t.azimuthAngleMax,this.mMinPolarAngle=t.polarAngleMin,this.mMaxPolarAngle=t.polarAngleMax,this.mDampingEnabled=t.dampingEnabled,this.mDampFactor=t.dampingFactor,this.mAutoRotate=t.autoRotateEnabled,this.mAutoRotateSpeed=t.autoRotateSpeed,this.mKeysDisabled=t.keyboardEnabled}},{key:"createCameraControls",value:function(){var e=this.mCamera.getCamera();this.mControls||(this.mControls=new THREE.ExpiviOrbitControls(e,this.mRenderer.getCanvas())),this.mControls.enabled=this.mEnabled,this.mControls.target||(this.mControls.target=new THREE.Vector3),this.mControls.target.set(this.mTarget.x,this.mTarget.y,this.mTarget.z),this.mControls.enableZoom=this.mZoomEnabled,this.mControls.zoomSpeed=this.mZoomSpeed,this.mCamera.isPerspective()?(this.mControls.minDistance=this.mMinZoom,this.mControls.maxDistance=this.mMaxZoom):(this.mControls.minZoom=this.mMinZoom,this.mControls.maxZoom=this.mMaxZoom),this.mControls.enablePan=this.mPanEnabled,this.mControls.panSpeed=this.mPanSpeed,this.mControls.enableRotate=this.mRotateEnabled,this.mControls.rotateSpeed=this.mRotationSpeed,this.mControls.enableDamping=this.mDampingEnabled,this.mControls.dampingFactor=this.mDampFactor,this.mControls.screenSpacePanning=!0,this.mControls.minAzimuthAngle=void 0!==this.mMinAzimuthAngle&&null!==this.mMinAzimuthAngle?this.mMinAzimuthAngle:-1/0,this.mControls.maxAzimuthAngle=void 0!==this.mMaxAzimuthAngle&&null!==this.mMaxAzimuthAngle?this.mMaxAzimuthAngle:1/0,this.mControls.minPolarAngle=void 0!==this.mMinPolarAngle&&null!==this.mMinPolarAngle?this.mMinPolarAngle:0,this.mLockUpHemisphere?this.mControls.maxPolarAngle=Math.PI/2:this.mControls.maxPolarAngle=void 0!==this.mMaxPolarAngle&&null!==this.mMaxPolarAngle?this.mMaxPolarAngle:Math.PI,this.mControls.autoRotate=this.mAutoRotate,this.mControls.autoRotateSpeed=this.mAutoRotateSpeed,this.mControls.enableKeys=!this.mKeysDisabled,this.mControls.blockDefaultTouch=!0!==R.K.stateRegistery().get(X.V.UNBLOCK_DEFAULT_TOUCH),this.mPreviousPosition.set(e.position.x,e.position.y,e.position.z),this.mPreviousTarget.set(this.mControls.target.x,this.mControls.target.y,this.mControls.target.z),this.mPreviousRadius=e.position.distanceTo(this.mControls.target)}},{key:"update",value:function(e){if(this.mControls&&(this.mControls.update(),this.mEnabled)){var t=this.mCamera.getSceneEntity(),n=this.mCamera.getCamera(),r=!1,i=!1,a=!1,o=this.mCamera.getCamera().position.distanceTo(this.mControls.target);Math.abs(this.mPreviousRadius-o)>Sn.EPS&&(a=!0),this.didPan()&&(t.target.set(this.mControls.target.x,this.mControls.target.y,this.mControls.target.z),a||(r=!0)),this.didRotate()&&(t.transform.position.set(n.position.x,n.position.y,n.position.z),t.transform.quaternion.set(n.quaternion.x,n.quaternion.y,n.quaternion.z,n.quaternion.w),r||a||(i=!0)),this.mPreviousRadius=o,this.mPreviousTarget.set(this.mControls.target.x,this.mControls.target.y,this.mControls.target.z),this.mPreviousPosition.set(n.position.x,n.position.y,n.position.z);var s=ve.Unchanged,u=ve.Unchanged,c=ve.Unchanged;a&&!this.mIsZooming?s=ve.Started:!a&&this.mIsZooming?s=ve.Ended:a&&(s=ve.Changed),r&&!this.mIsPanning?u=ve.Started:!r&&this.mIsPanning?u=ve.Ended:r&&(u=ve.Changed),i&&!this.mIsRotating?c=ve.Started:!i&&this.mIsRotating?c=ve.Ended:i&&(c=ve.Changed),this.mIsPanning=r,this.mIsRotating=i,this.mIsZooming=a,s!==ve.Unchanged&&R.K.eventBus().dispatch(new Ce(s)),u!==ve.Unchanged&&R.K.eventBus().dispatch(new Me(ge.Pan,u)),c!==ve.Unchanged&&R.K.eventBus().dispatch(new Me(ge.Rotate,c))}}},{key:"onUpdateDirty",value:function(){var e=this.mCamera.getSceneEntity();this.loadCameraControls(),this.createCameraControls();var t=e.getComponent("orbit-camera-controls");t.getValue("orbit_controls.save_state")&&this.mControls.saveState(),t.getValue("orbit_controls.reset_state")&&(this.mControls.position0=this.mCamera.getCamera().position.clone(),this.mControls.target0=this.mControls.target.clone(),this.mControls.reset()),t.getValue("orbit_controls.reset_state_mouse")&&this.mControls.resetMouseState(),t.setNeedsRenderUpdate(!1)}},{key:"destroyCameraControls",value:function(){this.mControls&&(this.mControls.dispose(),delete this.mControls)}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}},{key:"getComponentName",value:function(){return"orbit-camera-controls"}},{key:"didPan",value:function(){var e=this.mPreviousTarget.x-this.mControls.target.x,t=this.mPreviousTarget.y-this.mControls.target.y,n=this.mPreviousTarget.z-this.mControls.target.z;return e*e+t*t+n*n>1e-8}},{key:"didRotate",value:function(){var e=this.mCamera.getCamera(),t=this.mPreviousPosition.x-e.position.x,n=this.mPreviousPosition.y-e.position.y,r=this.mPreviousPosition.z-e.position.z;return t*t+n*n+r*r>1e-8}}])}(jA);function GA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(GA=function(){return!!e})()}var qA=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,GA()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mControls",void 0),(0,c.A)(r,"mEnabled",!0),(0,c.A)(r,"mActiveEntity",void 0),(0,c.A)(r,"mZoomEnabled",void 0),(0,c.A)(r,"mMinZoom",void 0),(0,c.A)(r,"mMaxZoom",void 0),(0,c.A)(r,"mDirection",void 0),(0,c.A)(r,"mMinPolar",void 0),(0,c.A)(r,"mMaxPolar",void 0),(0,c.A)(r,"mMinAzimuth",void 0),(0,c.A)(r,"mMaxAzimuth",void 0),(0,c.A)(r,"mDampEnabled",void 0),(0,c.A)(r,"mDampFactor",void 0),(0,c.A)(r,"mAutoRotate",void 0),(0,c.A)(r,"mRotationSpeed",void 0),(0,c.A)(r,"mRotateState",ve.Unchanged),(0,c.A)(r,"mPanState",ve.Unchanged),(0,c.A)(r,"mZoomState",ve.Unchanged),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadCameraControls",value:function(){var e=this.mCamera.getSceneEntity().getComponent("turntable-camera-controls");this.mEnabled=e.enabled,this.mZoomEnabled=e.zoomEnabled,this.mMinZoom=e.zoomMin,this.mMaxZoom=e.zoomMax,this.mDirection=e.direction,this.mMinPolar=e.polarAngleMin,this.mMaxPolar=e.polarAngleMax,this.mMinAzimuth=e.azimuthAngleMin,this.mMaxAzimuth=e.azimuthAngleMax,this.mDampEnabled=e.dampingEnabled,this.mDampFactor=e.dampingFactor,this.mAutoRotate=!1,this.mRotationSpeed=e.rotationSpeed,this.mActiveEntity=e.getValue("active_object")}},{key:"createCameraControls",value:function(){var e=this.mCamera.getCamera();if(!this.mControls){var t=this.mDirection===Pe.Theta?te.P.AxisY():te.P.AxisX();this.mControls=new sg(this.mCamera.getSceneEntity(),this.mActiveEntity,t,this.mRenderer.getCanvas())}this.mControls.enabled=this.mEnabled&&!!this.mActiveEntity,this.mControls.rotateSpeed=this.mRotationSpeed,this.mControls.autoRotate=this.mAutoRotate,this.mControls.enableDamping=this.mDampEnabled,Number.isFinite(this.mDampFactor)&&(this.mControls.dampingFactor=this.mDampFactor);var n=new te.P,r=new og;n.applyQuaternion((new ne.P).setFromUnitVectors(new te.P(e.up.x,e.up.y,e.up.z),new te.P(0,1,0))),r.setFromVector3(n),r.makeSafe(),this.mDirection===Pe.Phi?(this.mControls.minPolarAngle=this.mMinPolar,this.mControls.maxPolarAngle=this.mMaxPolar,this.mControls.minAzimuthAngle=r.theta,this.mControls.maxAzimuthAngle=r.theta):(this.mControls.minAzimuthAngle=this.mMinAzimuth,this.mControls.maxAzimuthAngle=this.mMaxAzimuth,this.mControls.minPolarAngle=r.phi,this.mControls.maxPolarAngle=r.phi),this.mControls.enableZoom=this.mZoomEnabled,this.mControls.minDistance=this.mMinZoom,this.mControls.maxDistance=this.mMaxZoom}},{key:"destroyCameraControls",value:function(){this.mControls.dispose(),this.mControls=void 0}},{key:"update",value:function(e){this.mControls&&this.mControls.update()}},{key:"onUpdateDirty",value:function(){var e=this.mCamera.getSceneEntity();this.loadCameraControls(),this.createCameraControls();var t=e.getComponent("turntable-camera-controls");t.getValue("turntable_controls.save_state")&&this.mControls.saveState(),t.getValue("turntable_controls.reset_state")&&this.mControls.reset(),t.setNeedsRenderUpdate(!1)}},{key:"onAttached",value:function(){this.mControls&&(this.mControls.addEventListener("start",this.onChangeStart.bind(this)),this.mControls.addEventListener("end",this.onChangeEnd.bind(this)),this.mControls.addEventListener("change",this.onChange.bind(this)),this.mControls.addEventListener("zoom",this.onZoom.bind(this)))}},{key:"onDetached",value:function(){this.mControls&&(this.mControls.removeEventListener("start",this.onChangeStart.bind(this)),this.mControls.removeEventListener("end",this.onChangeEnd.bind(this)),this.mControls.removeEventListener("change",this.onChange.bind(this)),this.mControls.removeEventListener("zoom",this.onZoom.bind(this)))}},{key:"onZoom",value:function(e){if(this.mControls){var t=this.mCamera.getSceneEntity(),n=t.transform.position.clone().sub(this.mActiveEntity.transform.position).normalize(),r=this.mControls.getRadius(),i=this.mActiveEntity.transform.position.clone().addScaledVector(n,r);t.transform.position.copy(i),t.markNeedsRenderUpdate(),this.onControlsZoom()}}},{key:"onChangeStart",value:function(e){if(this.mControls&&"start"===e.type)switch(e.state){case"zoom":this.mZoomState=ve.Started,this.onControlsZoom();break;case"rotate":this.mRotateState=ve.Started,this.onControlsChange();break;case"pan":this.mPanState=ve.Started,this.onControlsChange()}}},{key:"onChangeEnd",value:function(e){if(this.mControls&&"end"===e.type)switch(e.state){case"zoom":this.mZoomState=ve.Ended,this.onControlsZoom();break;case"rotate":this.mRotateState=ve.Ended,this.onControlsChange();break;case"pan":this.mPanState=ve.Ended,this.onControlsChange()}}},{key:"onChange",value:function(e){if(this.mControls){switch(e.state){case"zoom":this.mZoomState=ve.Ended,this.onControlsZoom();break;case"rotate":this.mRotateState=ve.Ended,this.onControlsChange();break;case"pan":this.mPanState=ve.Ended,this.onControlsChange();break;case"any":this.mRotateState===ve.Started&&(this.mRotateState=ve.Changed),this.mPanState===ve.Started&&(this.mPanState=ve.Changed),this.mZoomState===ve.Started&&(this.mZoomState=ve.Changed),this.onControlsChange()}this.onControlsChange()}}},{key:"onControlsChange",value:function(){this.mPanState!==ve.Unchanged&&R.K.eventBus().dispatch(new Me(ge.Pan,this.mPanState)),this.mRotateState!==ve.Unchanged&&R.K.eventBus().dispatch(new Me(ge.Rotate,this.mRotateState))}},{key:"onControlsZoom",value:function(){R.K.eventBus().dispatch(new Ce(this.mZoomState))}},{key:"getComponentName",value:function(){return"turntable-camera-controls"}}])}(jA);function WA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(WA=function(){return!!e})()}var KA=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,WA()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mEnabled",!0),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadCameraControls",value:function(){}},{key:"createCameraControls",value:function(){}},{key:"update",value:function(e){}},{key:"onUpdateDirty",value:function(){this.loadCameraControls(),this.createCameraControls()}},{key:"destroyCameraControls",value:function(){}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}},{key:"getComponentName",value:function(){return"orbit-camera-controls"}}])}(jA);function XA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(XA=function(){return!!e})()}function YA(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var $A=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,o=[e,n],a=(0,oe.A)(a),r=(0,ae.A)(i,XA()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mCameraName","Camera Perspective"),(0,c.A)(r,"mPosition",te.P.Zero()),(0,c.A)(r,"mTarget",te.P.Zero()),(0,c.A)(r,"mNear",.1),(0,c.A)(r,"mFar",1e3),(0,c.A)(r,"mFov",45),(0,c.A)(r,"mAspectRatio",1),(0,c.A)(r,"mControls",void 0),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.loadResourceFromEntity();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"loadResourceFromEntity",value:function(){var e=this.mSceneEntity;this.mCameraName=e.name,this.mPosition.copy(e.transform.position),this.mTarget.copy(e.target),this.mFov=e.fov,this.mAspectRatio=e.getValue("aspect_ratio")||1,this.mNear=e.near,this.mFar=e.far;var t=e.getComponents(de.TypeRTTI),n=t.length>0?t[0]:void 0,r=n?n.getComponentName():null;if(!this.mControls||this.mControls.getComponentName()!==r)switch(this.mControls&&(this.mControls.onDetached(),this.mControls.destroyCameraControls(),delete this.mControls),r){case"fps-camera-controls":this.mControls=new VA(this,this.getRenderer());break;case"turntable-camera-controls":this.mControls=new qA(this,this.getRenderer());break;case"orbit-camera-controls":this.mControls=new HA(this,this.getRenderer());break;default:this.mControls=new KA(this,this.getRenderer())}this.mControls.loadCameraControls()}},{key:"createRenderObject",value:function(){var e,t=this.mSceneEntity;this.mRenderObject||(this.mRenderObject=new THREE.PerspectiveCamera(this.mFov,this.mAspectRatio,this.mNear,this.mFar));var n=this.mRenderObject;t.needsProjectionMatrixUpdate()&&(n.fov=this.mFov,n.near=this.mNear,n.far=this.mFar,n.updateProjectionMatrix(),t.setProjectionMatrixUpdate(!1)),n.name=this.mCameraName;var r=this.mPosition.clone(),i=this.mTarget.clone();this.mRenderer.isRightHandedSystemActive()||(r.toggleCoordSystem(),i.toggleCoordSystem()),n.position.set(r.x,r.y,r.z),n.lookAt(i.x,i.y,i.z),null===(e=this.mControls)||void 0===e||e.createCameraControls()}},{key:"destroyRenderObject",value:function(){var e;null===(e=this.mControls)||void 0===e||e.destroyCameraControls(),YA(t,"destroyRenderObject",this,3)([])}},{key:"attach",value:function(){var e;YA(t,"attach",this,3)([]),null===(e=this.mControls)||void 0===e||e.onAttached(),this.mRenderer.setCameraActive(this)}},{key:"detach",value:function(){var e;YA(t,"detach",this,3)([]),null===(e=this.mControls)||void 0===e||e.onDetached()}},{key:"onUpdateDirty",value:function(){var e;YA(t,"onUpdateDirty",this,3)([]),this.loadResourceFromEntity(),this.createRenderObject(),null===(e=this.mControls)||void 0===e||e.onUpdateDirty()}},{key:"update",value:function(e){var n;null===(n=this.mControls)||void 0===n||n.update(e),YA(t,"update",this,3)([e])}},{key:"updateTranslation",value:function(){return!1}},{key:"setSize",value:function(e,t){if(this.mRenderObject){var n=this.mRenderObject;n.aspect=e/t,n.updateProjectionMatrix()}}},{key:"getSceneEntity",value:function(){return this.mSceneEntity}},{key:"isOrthographic",value:function(){return!1}},{key:"isPerspective",value:function(){return!0}},{key:"getCamera",value:function(){return this.mRenderObject}}]);var r}(bb);__webpack_require__(42781);function ZA(e){switch(e){case Cn.Gs.Byte:return THREE.ByteType;case Cn.Gs.Short:return THREE.ShortType;case Cn.Gs.UnsignedShort:return THREE.UnsignedShortType;case Cn.Gs.Int:return THREE.IntType;case Cn.Gs.UnsignedInt:return THREE.UnsignedIntType;case Cn.Gs.Float:return THREE.FloatType;case Cn.Gs.HalfFloat:return THREE.HalfFloatType;case Cn.Gs.UnsignedShort4444:return THREE.UnsignedShort4444Type;case Cn.Gs.UnsignedShort5551:return THREE.UnsignedShort5551Type;case Cn.Gs.UnsignedShort565:return THREE.UnsignedShort565Type;case Cn.Gs.UnsignedInt248:return THREE.UnsignedInt248Type;case Cn.Gs.UnsignedByte:default:return THREE.UnsignedByteType}}function QA(e){switch(e){case THREE.ByteType:return Cn.Gs.Byte;case THREE.ShortType:return Cn.Gs.Short;case THREE.UnsignedShortType:return Cn.Gs.UnsignedShort;case THREE.IntType:return Cn.Gs.Int;case THREE.UnsignedIntType:return Cn.Gs.UnsignedInt;case THREE.FloatType:return Cn.Gs.Float;case THREE.HalfFloatType:return Cn.Gs.HalfFloat;case THREE.UnsignedShort4444Type:return Cn.Gs.UnsignedShort4444;case THREE.UnsignedShort5551Type:return Cn.Gs.UnsignedShort5551;case THREE.UnsignedShort565Type:return Cn.Gs.UnsignedShort565;case THREE.UnsignedInt248Type:return Cn.Gs.UnsignedInt248;case THREE.UnsignedByteType:default:return Cn.Gs.UnsignedByte}}function JA(e){switch(e){case Cn.nC.Alpha:return THREE.AlphaFormat;case Cn.nC.Red:case Cn.nC.RedInt:return 1028;case Cn.nC.RG:case Cn.nC.RGInt:return 1030;case Cn.nC.RGB:case Cn.nC.RGBInt:return THREE.RGBFormat;case Cn.nC.RGBAInt:return THREE.RGBAFormat;case Cn.nC.Luminance:return THREE.LuminanceFormat;case Cn.nC.LuminanceAlpha:return THREE.LuminanceAlphaFormat;case Cn.nC.Depth:return THREE.DepthFormat;case Cn.nC.DepthStencil:return THREE.DepthStencilFormat;case Cn.nC.RGBA:default:return THREE.RGBAFormat}}function e_(e){switch(e){case THREE.AlphaFormat:return Cn.nC.Alpha;case 1028:return Cn.nC.Red;case 1029:return Cn.nC.RedInt;case 1030:return Cn.nC.RG;case 1031:return Cn.nC.RGInt;case THREE.RGBFormat:return Cn.nC.RGB;case 1032:return Cn.nC.RGBInt;case 1033:return Cn.nC.RGBAInt;case THREE.LuminanceFormat:return Cn.nC.Luminance;case THREE.LuminanceAlphaFormat:return Cn.nC.LuminanceAlpha;case THREE.DepthFormat:return Cn.nC.Depth;case THREE.DepthStencilFormat:return Cn.nC.DepthStencil;case THREE.RGBAFormat:case THREE.RGBEFormat:default:return Cn.nC.RGBA}}function t_(e){switch(e){case Cn.vv.sRGB:return THREE.sRGBEncoding;case Cn.vv.Gamma:return THREE.GammaEncoding;case Cn.vv.RGBE:return THREE.RGBEEncoding;case Cn.vv.LogLuv:return THREE.LogLuvEncoding;case Cn.vv.RGBM7:return THREE.RGBM7Encoding;case Cn.vv.RGBM16:return THREE.RGBM16Encoding;case Cn.vv.RGBD:return THREE.RGBDEncoding;case Cn.vv.BasicDepthPacking:return 3200;case Cn.vv.RGBADepthPacking:return 3201;case Cn.vv.Linear:default:return THREE.LinearEncoding}}function n_(e){switch(e){case THREE.sRGBEncoding:return Cn.vv.sRGB;case THREE.GammaEncoding:return Cn.vv.Gamma;case THREE.RGBEEncoding:return Cn.vv.RGBE;case THREE.LogLuvEncoding:return Cn.vv.LogLuv;case THREE.RGBM7Encoding:return Cn.vv.RGBM7;case THREE.RGBM16Encoding:return Cn.vv.RGBM16;case THREE.RGBDEncoding:return Cn.vv.RGBD;case THREE.BasicDepthPacking:return Cn.vv.BasicDepthPacking;case THREE.RGBADepthPacking:return Cn.vv.RGBADepthPacking;case THREE.LinearEncoding:default:return Cn.vv.Linear}}function r_(e,t){switch(e){case Cn.C$.Cube:return t===Cn.fG.Refract||t===Cn.fG.ReflectRefract?THREE.CubeRefractionMapping:THREE.CubeReflectionMapping;case Cn.C$.Equirectangular:return t===Cn.fG.Refract||t===Cn.fG.ReflectRefract?THREE.EquirectangularRefractionMapping:THREE.EquirectangularReflectionMapping;case Cn.C$.Spherical:return THREE.SphericalReflectionMapping;case Cn.C$.UV:default:return THREE.UVMapping}}function i_(e){switch(e){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:return Cn.C$.Cube;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:return Cn.C$.Equirectangular;case THREE.SphericalReflectionMapping:return Cn.C$.Spherical;case THREE.UVMapping:default:return Cn.C$.UV}}function a_(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e===Cn.wm.Nearest?THREE.NearestFilter:THREE.LinearFilter;THREE.LinearFilter;return{magFilter:i,minFilter:t===Cn.wm.Nearest?r&&n===Cn.wm.Nearest?THREE.NearestMipMapNearestFilter:r&&n===Cn.wm.Linear?THREE.NearestMipMapLinearFilter:THREE.NearestFilter:r&&n===Cn.wm.Nearest?THREE.LinearMipMapNearestFilter:r&&n===Cn.wm.Linear?THREE.LinearMipMapLinearFilter:THREE.LinearFilter}}function o_(e){switch(e){case Cn.qC.Repeat:return THREE.RepeatWrapping;case Cn.qC.MirrorRepeat:return THREE.MirroredRepeatWrapping;case Cn.qC.ClampToEdge:default:return THREE.ClampToEdgeWrapping}}function s_(e){switch(e){case THREE.RepeatWrapping:return Cn.qC.Repeat;case THREE.MirroredRepeatWrapping:return Cn.qC.MirrorRepeat;case THREE.ClampToEdgeWrapping:default:return Cn.qC.ClampToEdge}}function u_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u_=function(){return!!e})()}var c_=function(e){function t(){var e,n,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"texture2d",o=arguments.length>1?arguments[1]:void 0,u=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Cn.C$.UV,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Cn.qC.ClampToEdge,f=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Cn.qC.ClampToEdge,m=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Cn.wm.Linear,p=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Cn.wm.Linear,d=arguments.length>8&&void 0!==arguments[8]?arguments[8]:Cn.wm.Linear,v=!(arguments.length>9&&void 0!==arguments[9])||arguments[9],y=arguments.length>10&&void 0!==arguments[10]?arguments[10]:Cn.nC.RGBA,g=arguments.length>11&&void 0!==arguments[11]?arguments[11]:Cn.Gs.UnsignedByte,b=arguments.length>12&&void 0!==arguments[12]?arguments[12]:1,A=arguments.length>13&&void 0!==arguments[13]?arguments[13]:Cn.vv.Linear;return(0,s.A)(this,t),n=this,r=t,r=(0,oe.A)(r),e=(0,ae.A)(n,u_()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mInternalTexture",void 0),(0,c.A)(e,"mOffset",ee.I.Zero()),(0,c.A)(e,"mRepeat",ee.I.One()),(0,c.A)(e,"mCenter",ee.I.Zero()),(0,c.A)(e,"mLevel",1),(0,c.A)(e,"mRenderMode",Cn.fG.Reflect),(0,c.A)(e,"mMagFilter",Cn.wm.Linear),(0,c.A)(e,"mMinFilter",Cn.wm.Linear),(0,c.A)(e,"mMipmapFilter",Cn.wm.Linear),(0,c.A)(e,"mGenerateMipmap",!1),(0,c.A)(e,"mDirty",!1),(0,c.A)(e,"mUvChannel",0),(0,c.A)(e,"mMatrix",new qd.d),e.mInternalTexture=new THREE.Texture(o,r_(l,Cn.fG.Reflect),o_(h),o_(f),a_(m,p,d,v).magFilter,a_(m,p,d,v).minFilter,JA(y),ZA(g),b,t_(A)),e.mInternalTexture.name=a,e.mMagFilter=m,e.mMinFilter=p,e.mMipmapFilter=d,e.mGenerateMipmap=v,e.mInternalTexture.generateMipmaps=e.mGenerateMipmap,e.setFlipY(u),e.setCenter(ee.I.Zero()),e.setRepeat(ee.I.One()),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getOffset",value:function(){return this.mOffset}},{key:"setOffset",value:function(e){this.mOffset.copy(e),this.mInternalTexture.offset.set(this.mOffset.x,this.mOffset.y)}},{key:"getRepeat",value:function(){return this.mRepeat}},{key:"setRepeat",value:function(e){this.mRepeat.copy(e),this.mInternalTexture.repeat.set(this.mRepeat.x,this.mRepeat.y)}},{key:"getCenter",value:function(){return this.mCenter}},{key:"setCenter",value:function(e){this.mCenter.copy(e),this.mInternalTexture.center.set(this.mCenter.x,this.mCenter.y)}},{key:"getRotation",value:function(){return this.mInternalTexture.rotation}},{key:"setRotation",value:function(e){this.mInternalTexture.rotation=e}},{key:"getFlipY",value:function(){return this.mInternalTexture.flipY}},{key:"setFlipY",value:function(e){this.mInternalTexture.flipY=e}},{key:"updateSource",value:function(e){this.mInternalTexture.image=e,this.mInternalTexture.needsUpdate=!0}},{key:"updateMatrix",value:function(){this.mMatrix.setUvTransform(this.mOffset.x,this.mOffset.y,this.mRepeat.x,this.mRepeat.y,this.mInternalTexture.rotation,this.mCenter.x,this.mCenter.y),this.mInternalTexture.matrix.fromArray(this.mMatrix.elements,0)}},{key:"getName",value:function(){return this.mInternalTexture.name}},{key:"setName",value:function(e){this.mInternalTexture.name=e}},{key:"getGenerateMipmap",value:function(){return this.mGenerateMipmap}},{key:"getAnistropicFilteringLevel",value:function(){return this.mInternalTexture.anisotropy}},{key:"setAnistropicFilteringLevel",value:function(e){this.mInternalTexture.anisotropy=e}},{key:"getTextureDataType",value:function(){return QA(this.mInternalTexture.type)}},{key:"setTextureDataType",value:function(e){this.mInternalTexture.type=ZA(e)}},{key:"getTextureFormat",value:function(){return e_(this.mInternalTexture.format)}},{key:"setTextureFormat",value:function(e){this.mInternalTexture.format=JA(e)}},{key:"getTextureEncoding",value:function(){return n_(this.mInternalTexture.encoding)}},{key:"setTextureEncoding",value:function(e){this.mInternalTexture.encoding=t_(e)}},{key:"getTextureMapping",value:function(){return i_(this.mInternalTexture.mapping)}},{key:"setTextureMapping",value:function(e){this.mInternalTexture.mapping=r_(e,this.mRenderMode)}},{key:"getTextureRenderMode",value:function(){return this.mRenderMode}},{key:"setTextureRenderMode",value:function(e){this.mRenderMode=e,this.setTextureMapping(this.getTextureMapping())}},{key:"getMagFilter",value:function(){return this.mMagFilter}},{key:"setMagFilter",value:function(e){this.mMagFilter=e,this.updateTextureFilter()}},{key:"getMinFilter",value:function(){return this.mMinFilter}},{key:"setMinFilter",value:function(e){this.mMinFilter=e,this.updateTextureFilter()}},{key:"getMipmapFilter",value:function(){return this.mMipmapFilter}},{key:"setMipmapFilter",value:function(e){this.mMipmapFilter=e,this.updateTextureFilter()}},{key:"getWrapU",value:function(){return s_(this.mInternalTexture.wrapS)}},{key:"setWrapU",value:function(e){this.mInternalTexture.wrapS=o_(e)}},{key:"getWrapV",value:function(){return s_(this.mInternalTexture.wrapT)}},{key:"setWrapV",value:function(e){this.mInternalTexture.wrapT=o_(e)}},{key:"getLevel",value:function(){return this.mLevel}},{key:"setLevel",value:function(e){this.mLevel=e}},{key:"getUVChannel",value:function(){return this.mUvChannel}},{key:"setUVChannel",value:function(e){this.mUvChannel=e}},{key:"isTexture2D",value:function(){return!0}},{key:"isTexture3D",value:function(){return!1}},{key:"isTextureCube",value:function(){return!1}},{key:"isTextureGrayscale",value:function(){var e=this.getTextureFormat();return e===Cn.nC.Red||e===Cn.nC.RedInt||e===Cn.nC.Depth||e===Cn.nC.DepthStencil}},{key:"hasTextureAlpha",value:function(){var e=this.getTextureFormat();return e===Cn.nC.Alpha||e===Cn.nC.RGBA||e===Cn.nC.LuminanceAlpha||e===Cn.nC.RGBAInt}},{key:"useRGBasAlpha",value:function(e){}},{key:"getMatrix",value:function(){return this.mMatrix}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalTexture.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalTexture.dispose()}},{key:"updateTextureFilter",value:function(){var e=a_(this.mMagFilter,this.mMinFilter,this.mMipmapFilter);this.mInternalTexture.magFilter=e.magFilter,this.mInternalTexture.minFilter=e.minFilter}},{key:"getInternalTexture",value:function(){return this.mInternalTexture}}])}(Gd.M);function l_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l_=function(){return!!e})()}var h_=function(e){function t(){var e,n,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"texturecanvas",o=arguments.length>1?arguments[1]:void 0,u=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Cn.C$.UV,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Cn.qC.ClampToEdge,f=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Cn.qC.ClampToEdge,m=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Cn.wm.Linear,p=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Cn.wm.Linear,d=arguments.length>8&&void 0!==arguments[8]?arguments[8]:Cn.wm.Linear,v=!(arguments.length>9&&void 0!==arguments[9])||arguments[9],y=arguments.length>10&&void 0!==arguments[10]?arguments[10]:Cn.nC.RGBA,g=arguments.length>11&&void 0!==arguments[11]?arguments[11]:Cn.Gs.UnsignedByte,b=arguments.length>12&&void 0!==arguments[12]?arguments[12]:1,A=arguments.length>13&&void 0!==arguments[13]?arguments[13]:Cn.vv.Linear;return(0,s.A)(this,t),n=this,r=t,r=(0,oe.A)(r),e=(0,ae.A)(n,l_()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mInternalTexture",void 0),(0,c.A)(e,"mCanvas",void 0),(0,c.A)(e,"mOffset",ee.I.Zero()),(0,c.A)(e,"mRepeat",ee.I.One()),(0,c.A)(e,"mCenter",ee.I.Zero()),(0,c.A)(e,"mLevel",1),(0,c.A)(e,"mRenderMode",Cn.fG.Reflect),(0,c.A)(e,"mMagFilter",Cn.wm.Linear),(0,c.A)(e,"mMinFilter",Cn.wm.Linear),(0,c.A)(e,"mMipmapFilter",Cn.wm.Linear),(0,c.A)(e,"mGenerateMipmap",!1),(0,c.A)(e,"mDirty",!1),(0,c.A)(e,"mUvChannel",0),(0,c.A)(e,"mMatrix",new qd.d),e.mInternalTexture=new THREE.Texture(o,r_(l,Cn.fG.Reflect),o_(h),o_(f),a_(m,p,d,v).magFilter,a_(m,p,d,v).minFilter,JA(y),ZA(g),b,t_(A)),e.mCanvas=o,e.mInternalTexture.name=a,e.mMagFilter=m,e.mMinFilter=p,e.mMipmapFilter=d,e.mGenerateMipmap=v,e.mInternalTexture.generateMipmaps=e.mGenerateMipmap,e.setFlipY(u),e.setCenter(ee.I.Zero()),e.setRepeat(ee.I.One()),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getOffset",value:function(){return this.mOffset}},{key:"setOffset",value:function(e){this.mOffset.copy(e),this.mInternalTexture.offset.set(this.mOffset.x,this.mOffset.y)}},{key:"getRepeat",value:function(){return this.mRepeat}},{key:"setRepeat",value:function(e){this.mRepeat.copy(e),this.mInternalTexture.repeat.set(this.mRepeat.x,this.mRepeat.y)}},{key:"getCenter",value:function(){return this.mCenter}},{key:"setCenter",value:function(e){this.mCenter.copy(e),this.mInternalTexture.center.set(this.mCenter.x,this.mCenter.y)}},{key:"getRotation",value:function(){return this.mInternalTexture.rotation}},{key:"setRotation",value:function(e){this.mInternalTexture.rotation=e}},{key:"getFlipY",value:function(){return this.mInternalTexture.flipY}},{key:"setFlipY",value:function(e){this.mInternalTexture.flipY=e}},{key:"updateSource",value:function(e){this.mInternalTexture.image=e,this.mInternalTexture.needsUpdate=!0}},{key:"updateMatrix",value:function(){this.mMatrix.setUvTransform(this.mOffset.x,this.mOffset.y,this.mRepeat.x,this.mRepeat.y,this.mInternalTexture.rotation,this.mCenter.x,this.mCenter.y),this.mInternalTexture.matrix.fromArray(this.mMatrix.elements,0)}},{key:"getName",value:function(){return this.mInternalTexture.name}},{key:"setName",value:function(e){this.mInternalTexture.name=e}},{key:"getGenerateMipmap",value:function(){return this.mGenerateMipmap}},{key:"getAnistropicFilteringLevel",value:function(){return this.mInternalTexture.anisotropy}},{key:"setAnistropicFilteringLevel",value:function(e){this.mInternalTexture.anisotropy=e}},{key:"getTextureDataType",value:function(){return QA(this.mInternalTexture.type)}},{key:"setTextureDataType",value:function(e){this.mInternalTexture.type=ZA(e)}},{key:"getTextureFormat",value:function(){return e_(this.mInternalTexture.format)}},{key:"setTextureFormat",value:function(e){this.mInternalTexture.format=JA(e)}},{key:"getTextureEncoding",value:function(){return n_(this.mInternalTexture.encoding)}},{key:"setTextureEncoding",value:function(e){this.mInternalTexture.encoding=t_(e)}},{key:"getTextureMapping",value:function(){return i_(this.mInternalTexture.mapping)}},{key:"setTextureMapping",value:function(e){this.mInternalTexture.mapping=r_(e,this.mRenderMode)}},{key:"getTextureRenderMode",value:function(){return this.mRenderMode}},{key:"setTextureRenderMode",value:function(e){this.mRenderMode=e,this.setTextureMapping(this.getTextureMapping())}},{key:"getMagFilter",value:function(){return this.mMagFilter}},{key:"setMagFilter",value:function(e){this.mMagFilter=e,this.updateTextureFilter()}},{key:"getMinFilter",value:function(){return this.mMinFilter}},{key:"setMinFilter",value:function(e){this.mMinFilter=e,this.updateTextureFilter()}},{key:"getMipmapFilter",value:function(){return this.mMipmapFilter}},{key:"setMipmapFilter",value:function(e){this.mMipmapFilter=e,this.updateTextureFilter()}},{key:"getWrapU",value:function(){return s_(this.mInternalTexture.wrapS)}},{key:"setWrapU",value:function(e){this.mInternalTexture.wrapS=o_(e)}},{key:"getWrapV",value:function(){return s_(this.mInternalTexture.wrapT)}},{key:"setWrapV",value:function(e){this.mInternalTexture.wrapT=o_(e)}},{key:"getLevel",value:function(){return this.mLevel}},{key:"setLevel",value:function(e){this.mLevel=e}},{key:"getUVChannel",value:function(){return this.mUvChannel}},{key:"setUVChannel",value:function(e){this.mUvChannel=e}},{key:"isTexture2D",value:function(){return!0}},{key:"isTexture3D",value:function(){return!1}},{key:"isTextureCube",value:function(){return!1}},{key:"isTextureGrayscale",value:function(){var e=this.getTextureFormat();return e===Cn.nC.Red||e===Cn.nC.RedInt||e===Cn.nC.Depth||e===Cn.nC.DepthStencil}},{key:"hasTextureAlpha",value:function(){var e=this.getTextureFormat();return e===Cn.nC.Alpha||e===Cn.nC.RGBA||e===Cn.nC.LuminanceAlpha||e===Cn.nC.RGBAInt}},{key:"useRGBasAlpha",value:function(e){}},{key:"getMatrix",value:function(){return this.mMatrix}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalTexture.needsUpdate=e}},{key:"updateTextureFilter",value:function(){var e=a_(this.mMagFilter,this.mMinFilter,this.mMipmapFilter);this.mInternalTexture.magFilter=e.magFilter,this.mInternalTexture.minFilter=e.minFilter}},{key:"getContext",value:function(){return this.mCanvas.getContext("2d")}},{key:"getCanvas",value:function(){return this.mCanvas}},{key:"dispose",value:function(){this.mInternalTexture.dispose(),this.mCanvas&&this.mCanvas.remove()}},{key:"getInternalTexture",value:function(){return this.mInternalTexture}}])}(sv);function f_(e){switch(e){case THREE.BackSide:return Fs.k.Back;case THREE.DoubleSide:return Fs.k.Double;case THREE.FrontSide:default:return Fs.k.Front}}function m_(e){switch(e){case Fs.k.Back:return THREE.BackSide;case Fs.k.Double:return THREE.DoubleSide;case Fs.k.Front:default:return THREE.FrontSide}}function p_(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:THREE.SrcAlphaFactor,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:THREE.OneMinusSrcAlphaFactor,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:THREE.OneFactor,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:THREE.OneFactor;if(e===THREE.CustomBlending)return t===THREE.SrcAlphaFactor&&n===THREE.OneFactor&&r===THREE.ZeroFactor&&i===THREE.OneFactor?Hd.r_.Add:t===THREE.ZeroFactor&&n===THREE.OneMinusSrcColorFactor&&r===THREE.OneFactor&&i===THREE.OneFactor?Hd.r_.Subtract:t===THREE.DstColorFactor&&n===THREE.ZeroFactor&&r===THREE.OneFactor&&i===THREE.OneFactor?Hd.r_.Multiply:t===THREE.SrcAlphaSaturateFactor&&n===THREE.OneMinusSrcColorFactor&&r===THREE.OneFactor&&i===THREE.OneFactor?Hd.r_.Maximized:t===THREE.OneFactor&&n===THREE.OneFactor&&r===THREE.OneFactor&&i===THREE.OneFactor?Hd.r_.OneOne:t===THREE.OneFactor&&n===THREE.OneMinusSrcColorFactor&&r===THREE.OneFactor&&i===THREE.OneMinusSrcAlphaFactor?Hd.r_.ScreenMode:Hd.r_.Combine;switch(e){case THREE.NoBlending:return Hd.r_.Disable;case THREE.AdditiveBlending:return Hd.r_.Add;case THREE.SubtractiveBlending:return Hd.r_.Subtract;case THREE.MultiplyBlending:return Hd.r_.Multiply;case THREE.NormalBlending:default:return Hd.r_.Combine}}function d_(e){switch(e){case Hd.r_.Disable:return{blending:THREE.NoBlending,blendSrc:THREE.SrcAlphaFactor,blendDst:THREE.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE.OneFactor,blendDstAlpha:THREE.OneFactor};case Hd.r_.Add:return{blending:THREE.AdditiveBlending,blendSrc:THREE.SrcAlphaFactor,blendDst:THREE.OneFactor,blendSrcAlpha:THREE.ZeroFactor,blendDstAlpha:THREE.OneFactor};case Hd.r_.Subtract:return{blending:THREE.SubtractiveBlending,blendSrc:THREE.ZeroFactor,blendDst:THREE.OneMinusSrcColorFactor,blendSrcAlpha:THREE.OneFactor,blendDstAlpha:THREE.OneFactor};case Hd.r_.Multiply:return{blending:THREE.MultiplyBlending,blendSrc:THREE.DstColorFactor,blendDst:THREE.ZeroFactor,blendSrcAlpha:THREE.OneFactor,blendDstAlpha:THREE.OneFactor};case Hd.r_.Maximized:return{blending:THREE.CustomBlending,blendSrc:THREE.SrcAlphaSaturateFactor,blendDst:THREE.OneMinusSrcColorFactor,blendSrcAlpha:THREE.OneFactor,blendDstAlpha:THREE.OneFactor};case Hd.r_.OneOne:return{blending:THREE.CustomBlending,blendSrc:THREE.OneFactor,blendDst:THREE.OneFactor,blendSrcAlpha:THREE.OneFactor,blendDstAlpha:THREE.OneFactor};case Hd.r_.ScreenMode:return{blending:THREE.CustomBlending,blendSrc:THREE.OneFactor,blendDst:THREE.OneMinusSrcColorFactor,blendSrcAlpha:THREE.OneFactor,blendDstAlpha:THREE.OneMinusSrcAlphaFactor};case Hd.r_.Interpolate:case Hd.r_.Combine:default:return{blending:THREE.NormalBlending,blendSrc:THREE.SrcAlphaFactor,blendDst:THREE.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE.OneFactor,blendDstAlpha:THREE.OneFactor}}}function v_(e){switch(e){case THREE.MixOperation:return Hd.Am.Mix;case THREE.AddOperation:return Hd.Am.Add;case THREE.MultiplyOperation:default:return Hd.Am.Multiply}}function y_(e){switch(e){case Hd.Am.Mix:return THREE.MixOperation;case Hd.Am.Add:return THREE.AddOperation;case Hd.Am.Multiply:default:return THREE.MultiplyOperation}}function g_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(g_=function(){return!!e})()}var b_=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,g_()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mInternalMaterial",void 0),(0,c.A)(n,"mDiffuseColor",Ft.v.White()),(0,c.A)(n,"mEmissiveColor",Ft.v.Black()),(0,c.A)(n,"mEnvMapIntensity",1),(0,c.A)(n,"mEnvMapScale",ee.I.One()),(0,c.A)(n,"mDiffuseMap",void 0),(0,c.A)(n,"mAlphaMap",void 0),(0,c.A)(n,"mAoMap",void 0),(0,c.A)(n,"mSpecularMap",void 0),(0,c.A)(n,"mLightMap",void 0),(0,c.A)(n,"mEnvMap",void 0),(0,c.A)(n,"mEmissiveMap",void 0),(0,c.A)(n,"mFreeze",!1),(0,c.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshLambertMaterial({name:e}),n.mInternalMaterial.userData={},n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectivity}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectivity=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.specularMap=e?e.getInternalTexture():null}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightMap=e?e.getInternalTexture():null}},{key:"getLightMapIntensity",value:function(){return this.mInternalMaterial.lightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mInternalMaterial.lightMapIntensity=e}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getEnvMapCombine",value:function(){return v_(this.mInternalMaterial.combine)}},{key:"setEnvMapCombine",value:function(e){this.mInternalMaterial.combine=y_(e)}},{key:"getEnvMapIntensity",value:function(){return this.mEnvMapIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mEnvMapIntensity=e}},{key:"getEnvMapScale",value:function(){return this.mEnvMapScale}},{key:"setEnvMapScale",value:function(e){this.mEnvMapScale.copy(e),this.mInternalMaterial.envMapScale=this.mEnvMapScale.x}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissive.setRGB(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveMap=e?e.getInternalTexture():null}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getIOR",value:function(){return this.mInternalMaterial.refractionRatio}},{key:"setIOR",value:function(e){this.mInternalMaterial.refractionRatio=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return p_(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=d_(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Hd.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return f_(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=m_(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mEnvMapIntensity=e.mEnvMapIntensity,this.mEnvMapScale.copy(e.mEnvMapScale),this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mSpecularMap=e.mSpecularMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(On.r);function A_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(A_=function(){return!!e})()}var __=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,A_()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mInternalMaterial",void 0),(0,c.A)(n,"mDiffuseColor",Ft.v.White()),(0,c.A)(n,"mEmissiveColor",Ft.v.Black()),(0,c.A)(n,"mDiffuseMap",void 0),(0,c.A)(n,"mAlphaMap",void 0),(0,c.A)(n,"mAoMap",void 0),(0,c.A)(n,"mSpecularMap",void 0),(0,c.A)(n,"mEnvMap",void 0),(0,c.A)(n,"mFreeze",!1),(0,c.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshBasicMaterial({name:e}),n.mInternalMaterial.userData={},n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectivity}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectivity=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.specularMap=e?e.getInternalTexture():null}},{key:"getEnvMapCombine",value:function(){return v_(this.mInternalMaterial.combine)}},{key:"setEnvMapCombine",value:function(e){this.mInternalMaterial.combine=y_(e)}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getIOR",value:function(){return this.mInternalMaterial.refractionRatio}},{key:"setIOR",value:function(e){this.mInternalMaterial.refractionRatio=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return p_(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=d_(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Hd.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return f_(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=m_(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mSpecularMap=e.mSpecularMap,this.mEnvMap=e.mEnvMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(In._);function M_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(M_=function(){return!!e})()}var k_=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,M_()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mInternalMaterial",void 0),(0,c.A)(n,"mDiffuseColor",Ft.v.White()),(0,c.A)(n,"mEmissiveColor",Ft.v.Black()),(0,c.A)(n,"mSpecularColor",new Ft.v(.04,.067,.067)),(0,c.A)(n,"mEnvMapIntensity",1),(0,c.A)(n,"mNormalScale",ee.I.One()),(0,c.A)(n,"mDiffuseMap",void 0),(0,c.A)(n,"mAlphaMap",void 0),(0,c.A)(n,"mAoMap",void 0),(0,c.A)(n,"mBumpMap",void 0),(0,c.A)(n,"mNormalMap",void 0),(0,c.A)(n,"mDisplacementMap",void 0),(0,c.A)(n,"mSpecularMap",void 0),(0,c.A)(n,"mLightMap",void 0),(0,c.A)(n,"mEnvMap",void 0),(0,c.A)(n,"mEmissiveMap",void 0),(0,c.A)(n,"mFreeze",!1),(0,c.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshPhongMaterial({name:e}),n.mInternalMaterial.userData={},n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpMap=e?e.getInternalTexture():null}},{key:"getBumpScale",value:function(){return this.mInternalMaterial.bumpScale}},{key:"setBumpScale",value:function(e){this.mInternalMaterial.bumpScale=e}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.normalMap=e?e.getInternalTexture():null}},{key:"getNormalScale",value:function(){return this.mNormalScale}},{key:"setNormalScale",value:function(e){this.mNormalScale.copy(e),this.mInternalMaterial.normalScale.set(this.mNormalScale.x,this.mNormalScale.y)}},{key:"getDisplacementMap",value:function(){return this.mDisplacementMap}},{key:"setDisplacementMap",value:function(e){this.mDisplacementMap=e,this.mInternalMaterial.displacementMap=e?e.getInternalTexture():null}},{key:"getDisplacementScale",value:function(){return this.mInternalMaterial.displacementScale}},{key:"setDisplacementScale",value:function(e){this.mInternalMaterial.displacementScale=e}},{key:"getDisplacementBias",value:function(){return this.mInternalMaterial.displacementBias}},{key:"setDisplacementBias",value:function(e){this.mInternalMaterial.displacementBias=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectivity}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectivity=e}},{key:"getSpecular",value:function(){return this.mSpecularColor}},{key:"setSpecular",value:function(e){this.mSpecularColor.copy(e),this.mInternalMaterial.specular.setRGB(this.mSpecularColor.r,this.mSpecularColor.g,this.mSpecularColor.b)}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.specularMap=e?e.getInternalTexture():null}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightMap=e?e.getInternalTexture():null}},{key:"getLightMapIntensity",value:function(){return this.mInternalMaterial.lightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mInternalMaterial.lightMapIntensity=e}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getEnvMapCombine",value:function(){return v_(this.mInternalMaterial.combine)}},{key:"setEnvMapCombine",value:function(e){this.mInternalMaterial.combine=y_(e)}},{key:"getEnvMapIntensity",value:function(){return this.mEnvMapIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mEnvMapIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissive.setRGB(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveMap=e?e.getInternalTexture():null}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getShininess",value:function(){return this.mInternalMaterial.shininess}},{key:"setShininess",value:function(e){this.mInternalMaterial.shininess=e}},{key:"getIOR",value:function(){return this.mInternalMaterial.refractionRatio}},{key:"setIOR",value:function(e){this.mInternalMaterial.refractionRatio=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return p_(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=d_(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Hd.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return f_(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=m_(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mSpecularColor.copy(e.mSpecularColor),this.mEnvMapIntensity=e.mEnvMapIntensity,this.mNormalScale.copy(e.mNormalScale),this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mDisplacementMap=e.mDisplacementMap,this.mSpecularMap=e.mSpecularMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Yi.u);function w_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(w_=function(){return!!e})()}var T_=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,w_()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mInternalMaterial",void 0),(0,c.A)(n,"mDiffuseColor",Ft.v.White()),(0,c.A)(n,"mEmissiveColor",Ft.v.Black()),(0,c.A)(n,"mSpecularColor",new Ft.v(.04,.067,.067)),(0,c.A)(n,"mFresnelDiffuseColor",Ft.v.Black()),(0,c.A)(n,"mEnvMapIntensity",1),(0,c.A)(n,"mEnvMapScale",ee.I.One()),(0,c.A)(n,"mNormalScale",ee.I.One()),(0,c.A)(n,"mDiffuseMap",void 0),(0,c.A)(n,"mAlphaMap",void 0),(0,c.A)(n,"mAoMap",void 0),(0,c.A)(n,"mBumpMap",void 0),(0,c.A)(n,"mNormalMap",void 0),(0,c.A)(n,"mDisplacementMap",void 0),(0,c.A)(n,"mSpecularMap",void 0),(0,c.A)(n,"mLightMap",void 0),(0,c.A)(n,"mEnvMap",void 0),(0,c.A)(n,"mEmissiveMap",void 0),(0,c.A)(n,"mFreeze",!1),(0,c.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshPhongMaterialExt({name:e}),n.mInternalMaterial.userData={},n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpMap=e?e.getInternalTexture():null}},{key:"getBumpScale",value:function(){return this.mInternalMaterial.bumpScale}},{key:"setBumpScale",value:function(e){this.mInternalMaterial.bumpScale=e}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.normalMap=e?e.getInternalTexture():null}},{key:"getNormalScale",value:function(){return this.mNormalScale}},{key:"setNormalScale",value:function(e){this.mNormalScale.copy(e),this.mInternalMaterial.normalScale.set(this.mNormalScale.x,this.mNormalScale.y)}},{key:"getDisplacementMap",value:function(){return this.mDisplacementMap}},{key:"setDisplacementMap",value:function(e){this.mDisplacementMap=e,this.mInternalMaterial.displacementMap=e?e.getInternalTexture():null}},{key:"getDisplacementScale",value:function(){return this.mInternalMaterial.displacementScale}},{key:"setDisplacementScale",value:function(e){this.mInternalMaterial.displacementScale=e}},{key:"getDisplacementBias",value:function(){return this.mInternalMaterial.displacementBias}},{key:"setDisplacementBias",value:function(e){this.mInternalMaterial.displacementBias=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectivity}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectivity=e}},{key:"getSpecular",value:function(){return this.mSpecularColor}},{key:"setSpecular",value:function(e){this.mSpecularColor.copy(e),this.mInternalMaterial.specular.setRGB(this.mSpecularColor.r,this.mSpecularColor.g,this.mSpecularColor.b)}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.specularMap=e?e.getInternalTexture():null}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightMap=e?e.getInternalTexture():null}},{key:"getLightMapIntensity",value:function(){return this.mInternalMaterial.lightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mInternalMaterial.lightMapIntensity=e}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getEnvMapCombine",value:function(){return v_(this.mInternalMaterial.combine)}},{key:"setEnvMapCombine",value:function(e){this.mInternalMaterial.combine=y_(e)}},{key:"getEnvMapIntensity",value:function(){return this.mEnvMapIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mEnvMapIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissive.setRGB(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveMap=e?e.getInternalTexture():null}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getShininess",value:function(){return this.mInternalMaterial.shininess}},{key:"setShininess",value:function(e){this.mInternalMaterial.shininess=e}},{key:"getIOR",value:function(){return this.mInternalMaterial.refractionRatio}},{key:"setIOR",value:function(e){this.mInternalMaterial.refractionRatio=e}},{key:"getEnvMapScale",value:function(){return this.mEnvMapScale}},{key:"setEnvMapScale",value:function(e){this.mEnvMapScale.copy(e),this.mInternalMaterial.envMapScale=this.mEnvMapScale.x}},{key:"isFresnelDiffuseEnabled",value:function(){return this.mInternalMaterial.enableFresnelDiff}},{key:"setFresnelDiffuseEnabled",value:function(e){this.mInternalMaterial.enableFresnelDiff=e}},{key:"getFresnelDiffuseBias",value:function(){return this.mInternalMaterial.fresnelDiffBias}},{key:"setFresnelDiffuseBias",value:function(e){this.mInternalMaterial.fresnelDiffBias=e}},{key:"getFresnelDiffuseScale",value:function(){return this.mInternalMaterial.fresnelDiffScale}},{key:"setFresnelDiffuseScale",value:function(e){this.mInternalMaterial.fresnelDiffScale=e}},{key:"getFresnelDiffusePower",value:function(){return this.mInternalMaterial.fresnelDiffPower}},{key:"setFresnelDiffusePower",value:function(e){this.mInternalMaterial.fresnelDiffPower=e}},{key:"getFresnelDiffuseColor",value:function(){return this.mFresnelDiffuseColor}},{key:"setFresnelDiffuseColor",value:function(e){this.mFresnelDiffuseColor.copy(e),this.mInternalMaterial.fresnelDiffColorLeft=new THREE.Color(this.mFresnelDiffuseColor.r,this.mFresnelDiffuseColor.g,this.mFresnelDiffuseColor.b)}},{key:"isFresnelEnvMapEnabled",value:function(){return this.mInternalMaterial.enableFresnelEnv}},{key:"setFresnelEnvMapEnabled",value:function(e){this.mInternalMaterial.enableFresnelEnv=e}},{key:"getFresnelEnvMapBias",value:function(){return this.mInternalMaterial.fresnelEnvBias}},{key:"setFresnelEnvMapBias",value:function(e){this.mInternalMaterial.fresnelEnvBias=e}},{key:"getFresnelEnvMapScale",value:function(){return this.mInternalMaterial.fresnelEnvScale}},{key:"setFresnelEnvMapScale",value:function(e){this.mInternalMaterial.fresnelEnvScale=e}},{key:"getFresnelEnvMapPower",value:function(){return this.mInternalMaterial.fresnelEnvPower}},{key:"setFresnelEnvMapPower",value:function(e){this.mInternalMaterial.fresnelEnvPower=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return p_(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=d_(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Hd.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return f_(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=m_(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mSpecularColor.copy(e.mSpecularColor),this.mFresnelDiffuseColor.copy(e.mFresnelDiffuseColor),this.mEnvMapIntensity=e.mEnvMapIntensity,this.mEnvMapScale.copy(e.mEnvMapScale),this.mNormalScale.copy(e.mNormalScale),this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mDisplacementMap=e.mDisplacementMap,this.mSpecularMap=e.mSpecularMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(yg.t);function x_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(x_=function(){return!!e})()}var S_=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,x_()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mInternalMaterial",void 0),(0,c.A)(n,"mDiffuseColor",Ft.v.White()),(0,c.A)(n,"mEmissiveColor",Ft.v.Black()),(0,c.A)(n,"mNormalScale",ee.I.One()),(0,c.A)(n,"mDiffuseMap",void 0),(0,c.A)(n,"mAlphaMap",void 0),(0,c.A)(n,"mAoMap",void 0),(0,c.A)(n,"mBumpMap",void 0),(0,c.A)(n,"mNormalMap",void 0),(0,c.A)(n,"mDisplacementMap",void 0),(0,c.A)(n,"mLightMap",void 0),(0,c.A)(n,"mEnvMap",void 0),(0,c.A)(n,"mEmissiveMap",void 0),(0,c.A)(n,"mRoughnessMap",void 0),(0,c.A)(n,"mMetalnessMap",void 0),(0,c.A)(n,"mFreeze",!1),(0,c.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshStandardMaterial({name:e}),n.mInternalMaterial.userData={},n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpMap=e?e.getInternalTexture():null}},{key:"getBumpScale",value:function(){return this.mInternalMaterial.bumpScale}},{key:"setBumpScale",value:function(e){this.mInternalMaterial.bumpScale=e}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.normalMap=e?e.getInternalTexture():null}},{key:"getNormalScale",value:function(){return this.mNormalScale}},{key:"setNormalScale",value:function(e){this.mNormalScale.copy(e),this.mInternalMaterial.normalScale.set(this.mNormalScale.x,this.mNormalScale.y)}},{key:"getDisplacementMap",value:function(){return this.mDisplacementMap}},{key:"setDisplacementMap",value:function(e){this.mDisplacementMap=e,this.mInternalMaterial.displacementMap=e?e.getInternalTexture():null}},{key:"getDisplacementScale",value:function(){return this.mInternalMaterial.displacementScale}},{key:"setDisplacementScale",value:function(e){this.mInternalMaterial.displacementScale=e}},{key:"getDisplacementBias",value:function(){return this.mInternalMaterial.displacementBias}},{key:"setDisplacementBias",value:function(e){this.mInternalMaterial.displacementBias=e}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightMap=e?e.getInternalTexture():null}},{key:"getLightMapIntensity",value:function(){return this.mInternalMaterial.lightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mInternalMaterial.lightMapIntensity=e}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.envMapIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.envMapIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissive.setRGB(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveMap=e?e.getInternalTexture():null}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getIOR",value:function(){return this.mInternalMaterial.refractionRatio}},{key:"setIOR",value:function(e){this.mInternalMaterial.refractionRatio=e}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metalness}},{key:"setMetalness",value:function(e){this.mInternalMaterial.metalness=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mMetalnessMap=e,this.mInternalMaterial.metalnessMap=e?e.getInternalTexture():null}},{key:"getRoughness",value:function(){return this.mInternalMaterial.roughness}},{key:"setRoughness",value:function(e){this.mInternalMaterial.roughness=e}},{key:"getRoughnessMap",value:function(){return this.mRoughnessMap}},{key:"setRoughnessMap",value:function(e){this.mRoughnessMap=e,this.mInternalMaterial.roughnessMap=e?e.getInternalTexture():null}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return p_(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=d_(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Hd.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return f_(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=m_(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mNormalScale.copy(e.mNormalScale),this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mDisplacementMap=e.mDisplacementMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mRoughnessMap=e.mRoughnessMap,this.mMetalnessMap=e.mMetalnessMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Dn.r);function C_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(C_=function(){return!!e})()}var E_=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,C_()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mInternalMaterial",void 0),(0,c.A)(n,"mDiffuseColor",Ft.v.White()),(0,c.A)(n,"mEmissiveColor",Ft.v.Black()),(0,c.A)(n,"mEnvMapScale",ee.I.One()),(0,c.A)(n,"mNormalScale",ee.I.One()),(0,c.A)(n,"mDiffuseMap",void 0),(0,c.A)(n,"mAlphaMap",void 0),(0,c.A)(n,"mAoMap",void 0),(0,c.A)(n,"mBumpMap",void 0),(0,c.A)(n,"mNormalMap",void 0),(0,c.A)(n,"mDisplacementMap",void 0),(0,c.A)(n,"mLightMap",void 0),(0,c.A)(n,"mEnvMap",void 0),(0,c.A)(n,"mEmissiveMap",void 0),(0,c.A)(n,"mRoughnessMap",void 0),(0,c.A)(n,"mMetalnessMap",void 0),(0,c.A)(n,"mFreeze",!1),(0,c.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshPhysicalMaterial({name:e}),n.mInternalMaterial.userData={},n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpMap=e?e.getInternalTexture():null}},{key:"getBumpScale",value:function(){return this.mInternalMaterial.bumpScale}},{key:"setBumpScale",value:function(e){this.mInternalMaterial.bumpScale=e}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.normalMap=e?e.getInternalTexture():null}},{key:"getNormalScale",value:function(){return this.mNormalScale}},{key:"setNormalScale",value:function(e){this.mNormalScale.copy(e),this.mInternalMaterial.normalScale.set(this.mNormalScale.x,this.mNormalScale.y)}},{key:"getDisplacementMap",value:function(){return this.mDisplacementMap}},{key:"setDisplacementMap",value:function(e){this.mDisplacementMap=e,this.mInternalMaterial.displacementMap=e?e.getInternalTexture():null}},{key:"getDisplacementScale",value:function(){return this.mInternalMaterial.displacementScale}},{key:"setDisplacementScale",value:function(e){this.mInternalMaterial.displacementScale=e}},{key:"getDisplacementBias",value:function(){return this.mInternalMaterial.displacementBias}},{key:"setDisplacementBias",value:function(e){this.mInternalMaterial.displacementBias=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectivity}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectivity=e}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightMap=e?e.getInternalTexture():null}},{key:"getLightMapIntensity",value:function(){return this.mInternalMaterial.lightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mInternalMaterial.lightMapIntensity=e}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.envMapIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.envMapIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissive.setRGB(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveMap=e?e.getInternalTexture():null}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getClearCoat",value:function(){return this.mInternalMaterial.clearCoat}},{key:"setClearCoat",value:function(e){this.mInternalMaterial.clearCoat=e}},{key:"getClearCoatRoughness",value:function(){return this.mInternalMaterial.clearCoatRoughness}},{key:"setClearCoatRoughness",value:function(e){this.mInternalMaterial.clearCoatRoughness=e}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metalness}},{key:"setMetalness",value:function(e){this.mInternalMaterial.metalness=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mMetalnessMap=e,this.mInternalMaterial.metalnessMap=e?e.getInternalTexture():null}},{key:"getIOR",value:function(){return this.mInternalMaterial.refractionRatio}},{key:"setIOR",value:function(e){this.mInternalMaterial.refractionRatio=e}},{key:"getRoughness",value:function(){return this.mInternalMaterial.roughness}},{key:"setRoughness",value:function(e){this.mInternalMaterial.roughness=e}},{key:"getRoughnessMap",value:function(){return this.mRoughnessMap}},{key:"setRoughnessMap",value:function(e){this.mRoughnessMap=e,this.mInternalMaterial.roughnessMap=e?e.getInternalTexture():null}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return p_(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=d_(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Hd.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return f_(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=m_(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mEnvMapScale.copy(e.mEnvMapScale),this.mNormalScale.copy(e.mNormalScale),this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mDisplacementMap=e.mDisplacementMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mRoughnessMap=e.mRoughnessMap,this.mMetalnessMap=e.mMetalnessMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Tg.l);function R_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(R_=function(){return!!e})()}var I_=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,R_()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mInternalMaterial",void 0),(0,c.A)(n,"mDiffuseColor",Ft.v.White()),(0,c.A)(n,"mEmissiveColor",Ft.v.Black()),(0,c.A)(n,"mSpecularColor",new Ft.v(.04,.067,.067)),(0,c.A)(n,"mFresnelDiffuseColor",Ft.v.Black()),(0,c.A)(n,"mEnvMapScale",ee.I.One()),(0,c.A)(n,"mNormalScale",ee.I.One()),(0,c.A)(n,"mDiffuseMap",void 0),(0,c.A)(n,"mAlphaMap",void 0),(0,c.A)(n,"mAoMap",void 0),(0,c.A)(n,"mBumpMap",void 0),(0,c.A)(n,"mNormalMap",void 0),(0,c.A)(n,"mDisplacementMap",void 0),(0,c.A)(n,"mLightMap",void 0),(0,c.A)(n,"mEnvMap",void 0),(0,c.A)(n,"mEmissiveMap",void 0),(0,c.A)(n,"mRoughnessMap",void 0),(0,c.A)(n,"mMetalnessMap",void 0),(0,c.A)(n,"mSpecularMap",void 0),(0,c.A)(n,"mGlossinessMap",void 0),(0,c.A)(n,"mFreeze",!1),(0,c.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshPhysicalMaterialExt({name:e}),n.mInternalMaterial.userData={},n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpMap=e?e.getInternalTexture():null}},{key:"getBumpScale",value:function(){return this.mInternalMaterial.bumpScale}},{key:"setBumpScale",value:function(e){this.mInternalMaterial.bumpScale=e}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.normalMap=e?e.getInternalTexture():null}},{key:"getNormalScale",value:function(){return this.mNormalScale}},{key:"setNormalScale",value:function(e){this.mNormalScale.copy(e),this.mInternalMaterial.normalScale.set(this.mNormalScale.x,this.mNormalScale.y)}},{key:"getDisplacementMap",value:function(){return this.mDisplacementMap}},{key:"setDisplacementMap",value:function(e){this.mDisplacementMap=e,this.mInternalMaterial.displacementMap=e?e.getInternalTexture():null}},{key:"getDisplacementScale",value:function(){return this.mInternalMaterial.displacementScale}},{key:"setDisplacementScale",value:function(e){this.mInternalMaterial.displacementScale=e}},{key:"getDisplacementBias",value:function(){return this.mInternalMaterial.displacementBias}},{key:"setDisplacementBias",value:function(e){this.mInternalMaterial.displacementBias=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectivity}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectivity=e}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightMap=e?e.getInternalTexture():null}},{key:"getLightMapIntensity",value:function(){return this.mInternalMaterial.lightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mInternalMaterial.lightMapIntensity=e}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.envMapIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.envMapIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissive=new THREE.Color(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveMap=e?e.getInternalTexture():null}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getClearCoat",value:function(){return this.mInternalMaterial.clearCoat}},{key:"setClearCoat",value:function(e){this.mInternalMaterial.clearCoat=e}},{key:"getClearCoatRoughness",value:function(){return this.mInternalMaterial.clearCoatRoughness}},{key:"setClearCoatRoughness",value:function(e){this.mInternalMaterial.clearCoatRoughness=e}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metalness}},{key:"setMetalness",value:function(e){this.mInternalMaterial.metalness=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mMetalnessMap=e,this.mInternalMaterial.metalnessMap=e?e.getInternalTexture():null}},{key:"getIOR",value:function(){return this.mInternalMaterial.refractionRatio}},{key:"setIOR",value:function(e){this.mInternalMaterial.refractionRatio=e}},{key:"getRoughness",value:function(){return this.mInternalMaterial.roughness}},{key:"setRoughness",value:function(e){this.mInternalMaterial.roughness=e}},{key:"getRoughnessMap",value:function(){return this.mRoughnessMap}},{key:"setRoughnessMap",value:function(e){this.mRoughnessMap=e,this.mInternalMaterial.roughnessMap=e?e.getInternalTexture():null}},{key:"getEnvMapScale",value:function(){return this.mEnvMapScale}},{key:"setEnvMapScale",value:function(e){this.mEnvMapScale.copy(e),this.mInternalMaterial.envMapScale=this.mEnvMapScale.x}},{key:"isSpecularGlossinessEnabled",value:function(){return this.mInternalMaterial.enableSpecularGlossiness}},{key:"setSpecularGlossinessEnabled",value:function(e){this.mInternalMaterial.enableSpecularGlossiness=e}},{key:"getSpecular",value:function(){return this.mSpecularColor}},{key:"setSpecular",value:function(e){this.mSpecularColor.copy(e),this.mInternalMaterial.specular.setRGB(this.mSpecularColor.r,this.mSpecularColor.g,this.mSpecularColor.b)}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.specularMap=e?e.getInternalTexture():null}},{key:"getGlossiness",value:function(){return this.mInternalMaterial.glossiness}},{key:"setGlossiness",value:function(e){this.mInternalMaterial.glossiness=e}},{key:"getGlossinessMap",value:function(){return this.mGlossinessMap}},{key:"setGlossinessMap",value:function(e){this.mGlossinessMap=e,this.mInternalMaterial.glossinessMap=e?e.getInternalTexture():null}},{key:"isFresnelDiffuseEnabled",value:function(){return this.mInternalMaterial.enableFresnelDiff}},{key:"setFresnelDiffuseEnabled",value:function(e){this.mInternalMaterial.enableFresnelDiff=e}},{key:"getFresnelDiffuseBias",value:function(){return this.mInternalMaterial.fresnelDiffBias}},{key:"setFresnelDiffuseBias",value:function(e){this.mInternalMaterial.fresnelDiffBias=e}},{key:"getFresnelDiffuseScale",value:function(){return this.mInternalMaterial.fresnelDiffScale}},{key:"setFresnelDiffuseScale",value:function(e){this.mInternalMaterial.fresnelDiffScale=e}},{key:"getFresnelDiffusePower",value:function(){return this.mInternalMaterial.fresnelDiffPower}},{key:"setFresnelDiffusePower",value:function(e){this.mInternalMaterial.fresnelDiffPower=e}},{key:"getFresnelDiffuseColor",value:function(){return this.mFresnelDiffuseColor}},{key:"setFresnelDiffuseColor",value:function(e){this.mFresnelDiffuseColor.copy(e),this.mInternalMaterial.fresnelDiffColorLeft=new THREE.Color(this.mFresnelDiffuseColor.r,this.mFresnelDiffuseColor.g,this.mFresnelDiffuseColor.b)}},{key:"isFresnelEnvMapEnabled",value:function(){return this.mInternalMaterial.enableFresnelEnv}},{key:"setFresnelEnvMapEnabled",value:function(e){this.mInternalMaterial.enableFresnelEnv=e}},{key:"getFresnelEnvMapBias",value:function(){return this.mInternalMaterial.fresnelEnvBias}},{key:"setFresnelEnvMapBias",value:function(e){this.mInternalMaterial.fresnelEnvBias=e}},{key:"getFresnelEnvMapScale",value:function(){return this.mInternalMaterial.fresnelEnvScale}},{key:"setFresnelEnvMapScale",value:function(e){this.mInternalMaterial.fresnelEnvScale=e}},{key:"getFresnelEnvMapPower",value:function(){return this.mInternalMaterial.fresnelEnvPower}},{key:"setFresnelEnvMapPower",value:function(e){this.mInternalMaterial.fresnelEnvPower=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return p_(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=d_(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Hd.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return f_(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=m_(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mSpecularColor.copy(e.mSpecularColor),this.mFresnelDiffuseColor.copy(e.mFresnelDiffuseColor),this.mEnvMapScale.copy(e.mEnvMapScale),this.mNormalScale.copy(e.mNormalScale),this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mDisplacementMap=e.mDisplacementMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mRoughnessMap=e.mRoughnessMap,this.mMetalnessMap=e.mMetalnessMap,this.mSpecularMap=e.mSpecularMap,this.mGlossinessMap=e.mGlossinessMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Mg.K);function O_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(O_=function(){return!!e})()}var D_=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,O_()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mInternalMaterial",void 0),(0,c.A)(n,"mDiffuseColor",Ft.v.White()),(0,c.A)(n,"mFreeze",!1),(0,c.A)(n,"mDirty",!1),(0,c.A)(n,"mWireframe",!1),(0,c.A)(n,"mWireframeLinewidth",1),n.mInternalMaterial=new THREE.LineBasicMaterial({name:e,linewidth:1,linecap:"round",linejoin:"round"}),n.mInternalMaterial.userData={},n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return p_(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=d_(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Hd.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mWireframe}},{key:"setWireframe",value:function(e){this.mWireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mWireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mWireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return f_(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=m_(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mWireframe=e.mWireframe,this.mWireframeLinewidth=e.mWireframeLinewidth,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Fg.S);function P_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(P_=function(){return!!e})()}var B_=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,P_()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mInternalMaterial",void 0),(0,c.A)(n,"mDiffuseColor",Ft.v.White()),(0,c.A)(n,"mDiffuseMap",void 0),(0,c.A)(n,"mFreeze",!1),(0,c.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshBasicMaterial({name:e}),n.mInternalMaterial.userData={},n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return p_(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=d_(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Hd.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return f_(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=m_(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mDiffuseMap=e.mDiffuseMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(En.k);function F_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(F_=function(){return!!e})()}var N_=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,i=(0,oe.A)(i),n=(0,ae.A)(r,F_()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mInternalMaterial",void 0),(0,c.A)(n,"mDiffuseColor",Ft.v.White()),(0,c.A)(n,"mAmbientColor",Ft.v.Black()),(0,c.A)(n,"mEmissiveColor",Ft.v.Black()),(0,c.A)(n,"mReflectionColor",Ft.v.White()),(0,c.A)(n,"mSpecularColor",Ft.v.White()),(0,c.A)(n,"mMetallicReflectanceColor",Ft.v.White()),(0,c.A)(n,"mFresnelColor",Ft.v.Black()),(0,c.A)(n,"mDiffuseMap",void 0),(0,c.A)(n,"mNormalMap",void 0),(0,c.A)(n,"mAlphaMap",void 0),(0,c.A)(n,"mAoMap",void 0),(0,c.A)(n,"mLightMap",void 0),(0,c.A)(n,"mEnvMap",void 0),(0,c.A)(n,"mEmissiveMap",void 0),(0,c.A)(n,"mRoughnessMap",void 0),(0,c.A)(n,"mMetalnessMap",void 0),(0,c.A)(n,"mReflectanceTexture",void 0),(0,c.A)(n,"mBrdfConfiguration",void 0),(0,c.A)(n,"mDetailMapConfiguration",void 0),(0,c.A)(n,"mClearCoatConfiguration",void 0),(0,c.A)(n,"mSheenConfiguration",void 0),(0,c.A)(n,"mAnisotropicConfiguration",void 0),(0,c.A)(n,"mSubSurfaceConfiguration",void 0),(0,c.A)(n,"mIridescenceConfiguration",void 0),(0,c.A)(n,"mAoMapImpactOnAnalyticalLights",0),(0,c.A)(n,"mDirectLightIntensity",1),(0,c.A)(n,"mSpecularIntensity",1),(0,c.A)(n,"mTwoSidedLighting",!0),(0,c.A)(n,"mGlossiness",.5),(0,c.A)(n,"mMetalnessF0Factor",.04),(0,c.A)(n,"mMetallicReflectanceTexture",void 0),(0,c.A)(n,"mNormalScale",ee.I.One()),(0,c.A)(n,"mEnvMapScale",ee.I.One()),(0,c.A)(n,"mUseSpecularGlossinessFlow",!1),(0,c.A)(n,"mRealtimeTextureFilteringQuality",Rn.j.Low),(0,c.A)(n,"mFreeze",!1),(0,c.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshPhysicalMaterialExt({name:e}),n.mInternalMaterial.userData={},n.mBrdfConfiguration={useEnergyConservation:!0,useSpecularGlossinessInputEnergyConservation:!0},n.mDetailMapConfiguration={isEnabled:!1,map:null,diffuseBlendLevel:1,roughnessBlendLevel:1,bumpLevel:1,normalBlendMethod:0},n.mClearCoatConfiguration={isEnabled:!1,intensity:1,roughness:0,indexOfRefraction:1.5,map:null,useRoughnessFromMainMap:!0,roughnessMap:null,remapF0OnInterfaceChange:!0,bumpMap:null,isTintEnabled:!1,tintColor:Ft.v.White(),tintColorAtDistance:1,tintThickness:1,tintMap:null},n.mSheenConfiguration={isEnabled:!1,linkSheenWithDiffuse:!1,intensity:1,color:Ft.v.White(),map:null,useRoughnessFromMainMap:!0,roughness:null,roughnessMap:null,diffuseScaling:!1},n.mAnisotropicConfiguration={isEnabled:!1,intensity:1,direction:new ee.I(1,0),map:null},n.mSubSurfaceConfiguration={isRefractionEnabled:!1,isTranslucencyEnabled:!1,isScatteringEnabled:!1,scatteringDiffusionProfile:null,refractionIntensity:1,translucencyIntensity:1,useDiffuseToTintRefraction:!1,useDiffuseToTintTranslucency:!1,thicknessMap:null,indexOfRefraction:1.5,volumeIndexOfRefraction:-1,linkRefractionWithTransparency:!1,minimumThickness:0,maximumThickness:1,useThicknessAsDepth:!1,tintColor:Ft.v.White(),tintColorAtDistance:1,diffusionDistance:Ft.v.White(),useMaskFromThicknessMap:!1,translucencyIntensityMap:null},n.mIridescenceConfiguration={isEnabled:!1,intensity:1,minimumThickness:100,maximumThickness:400,indexOfRefraction:1.3,map:null,thicknessMap:null},n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"isUsingAlphaFromDiffuseMap",value:function(){return!0}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.normalMap=e?e.getInternalTexture():null}},{key:"getNormalScale",value:function(){return this.mNormalScale}},{key:"setNormalScale",value:function(e){this.mNormalScale.copy(e),this.mInternalMaterial.normalScale=this.mNormalScale.x}},{key:"getAmbientColor",value:function(){return this.mAmbientColor}},{key:"setAmbientColor",value:function(e){this.mAmbientColor.copy(e)}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getAoMapImpactOnAnalyticalLights",value:function(){return this.mAoMapImpactOnAnalyticalLights}},{key:"setAoMapImpactOnAnalyticalLights",value:function(e){this.mAoMapImpactOnAnalyticalLights=e}},{key:"getDirectLightIntensity",value:function(){return this.mDirectLightIntensity}},{key:"setDirectLightIntensity",value:function(e){this.mDirectLightIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissive.setRGB(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveMap=e?e.getInternalTexture():null}},{key:"getEnvironmentIntensity",value:function(){return this.mInternalMaterial.envMapIntensity}},{key:"setEnvironmentIntensity",value:function(e){this.mInternalMaterial.envMapIntensity=e}},{key:"getEnvironmentBrdfMap",value:function(){return this.mEnvMap}},{key:"setEnvironmentBrdfMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getEnvironmentBrdfMapScale",value:function(){return this.mEnvMapScale}},{key:"setEnvironmentBdrfMapScale",value:function(e){this.mEnvMapScale.copy(e),this.mInternalMaterial.envMapScale=this.mEnvMapScale.x}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightMap=e?e.getInternalTexture():null}},{key:"getLightMapIntensity",value:function(){return this.mInternalMaterial.lightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mInternalMaterial.lightMapIntensity=e}},{key:"getParallaxScaleBias",value:function(){return this.mInternalMaterial.displacementScale}},{key:"setParallaxScaleBias",value:function(e){this.mInternalMaterial.displacementScale=e}},{key:"getReflectionColor",value:function(){return this.mReflectionColor}},{key:"setReflectionColor",value:function(e){this.mReflectionColor.setRGB(e.r,e.g,e.b),this.mInternalMaterial.reflectivity=this.mReflectionColor.getAvg()}},{key:"getReflectionMap",value:function(){return this.mEnvMap}},{key:"setReflectionMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getSpecularColor",value:function(){return this.mSpecularColor}},{key:"setSpecularColor",value:function(e){this.mSpecularColor.copy(e)}},{key:"getSpecularMap",value:function(){return this.mInternalMaterial.specularMap}},{key:"setSpecularMap",value:function(e){this.mInternalMaterial.specularMap=e}},{key:"getSpecularIntensity",value:function(){return this.mSpecularIntensity}},{key:"setSpecularIntensity",value:function(e){this.mSpecularIntensity=e}},{key:"getTwoSidedLighting",value:function(){return this.mTwoSidedLighting}},{key:"setTwoSidedLighting",value:function(e){this.mTwoSidedLighting=e}},{key:"getUnlit",value:function(){return this.mInternalMaterial.lights}},{key:"setUnlit",value:function(e){this.mInternalMaterial.lights=e}},{key:"getReflectanceMap",value:function(){return this.mReflectanceTexture}},{key:"setReflectanceMap",value:function(e){this.mReflectanceTexture=e}},{key:"getMicroSurface",value:function(){return this.mGlossiness}},{key:"setMicroSurface",value:function(e){this.mGlossiness=e}},{key:"getMicroSurfaceMap",value:function(){return this.mRoughnessMap}},{key:"setMicroSurfaceMap",value:function(e){this.mRoughnessMap=e,this.mInternalMaterial.roughnessMap=e?e.getInternalTexture():null}},{key:"getRoughness",value:function(){return this.mInternalMaterial.roughness}},{key:"setRoughness",value:function(e){this.mInternalMaterial.roughness=e}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metalness}},{key:"setMetalness",value:function(e){this.mInternalMaterial.metalness=e}},{key:"getMetalnessF0Factor",value:function(){return this.mMetalnessF0Factor}},{key:"setMetalnessF0Factor",value:function(e){this.mMetalnessF0Factor=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mMetalnessMap=e,this.mInternalMaterial.metalnessMap=e?e.getInternalTexture():null}},{key:"getMetallicReflectanceColor",value:function(){return this.mMetallicReflectanceColor}},{key:"setMetallicReflectanceColor",value:function(e){this.mMetallicReflectanceColor.copy(e)}},{key:"getMetallicReflectanceMap",value:function(){return this.mMetallicReflectanceTexture}},{key:"setMetallicReflectanceMap",value:function(e){this.mMetallicReflectanceTexture=e}},{key:"isSpecularGlossinessWorkflowEnabled",value:function(){return this.mUseSpecularGlossinessFlow}},{key:"useSpecularGlossinessWorkflow",value:function(e){this.mUseSpecularGlossinessFlow=e}},{key:"isUsingRealtimeTextureFiltering",value:function(){return!1}},{key:"useRealtimeTextureFiltering",value:function(e){}},{key:"getRealtimeTextureFilteringQuality",value:function(){return this.mRealtimeTextureFilteringQuality}},{key:"setRealtimeTextureFilteringQuality",value:function(e){this.mRealtimeTextureFilteringQuality=e}},{key:"getBrdfConfiguration",value:function(){return this.mBrdfConfiguration}},{key:"setBrdfConfiguration",value:function(e){}},{key:"getDetailMapConfiguration",value:function(){return this.mDetailMapConfiguration}},{key:"setDetailMapConfiguration",value:function(e){}},{key:"getClearCoatConfiguration",value:function(){return this.mClearCoatConfiguration}},{key:"setClearCoatConfiguration",value:function(e){e&&(void 0!==e.intensity&&(this.mClearCoatConfiguration.intensity=e.intensity,this.mInternalMaterial.clearCoat=e.intensity),void 0!==e.roughness&&(this.mClearCoatConfiguration.roughness=e.roughness,this.mInternalMaterial.clearCoatRoughness=e.roughness))}},{key:"getSheenConfiguration",value:function(){return this.mSheenConfiguration}},{key:"setSheenConfiguration",value:function(e){}},{key:"getAnisotropicConfiguration",value:function(){return this.mAnisotropicConfiguration}},{key:"setAnisotropicConfiguration",value:function(e){}},{key:"getSubSurfaceConfiguration",value:function(){return this.mSubSurfaceConfiguration}},{key:"setSubSurfaceConfiguration",value:function(e){e&&void 0!==e.indexOfRefraction&&(this.mSubSurfaceConfiguration.indexOfRefraction=e.indexOfRefraction,this.mInternalMaterial.refractionRatio=e.indexOfRefraction)}},{key:"getIridescenceConfiguration",value:function(){return this.mIridescenceConfiguration}},{key:"setIridescenceConfiguration",value:function(e){}},{key:"getFlags",value:function(){return{useAlphaFresnel:!1,useAlphaFromDiffuseMap:!1,useAmbientInGrayScale:!1,useAmbientOcclusionFromMetallicMapRed:!1,useAutoMicroSurfaceFromReflectivityMap:!1,useLightmapAsShadowmap:!1,useLinearAlphaFresnel:!1,useMetalnessFromMetallicMapBlue:!1,useMicroSurfaceFromReflectivityMapAlpha:!1,useParallax:!1,useParallaxOcclusion:!1,useHorizonOcclusion:!1,useRadianceOcclusion:!1,useRadianceOverAlpha:!1,useRoughnessFromMetallicMapAlpha:!1,useRoughnessFromMetallicMapGreen:!1,useSpecularAntiAliasing:!0,useSpecularOverAlpha:!1,invertNormalMapX:!1,invertNormalMapY:!1,useOnlyMetallicFromMetallicReflectanceMap:!1,usePhysicalLightFalloff:!1,useTransmission:!1}}},{key:"setFlags",value:function(e){}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return p_(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=d_(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Hd.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return f_(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=m_(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mAmbientColor.copy(e.mAmbientColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mReflectionColor.copy(e.mReflectionColor),this.mSpecularColor.copy(e.mSpecularColor),this.mMetallicReflectanceColor.copy(e.mMetallicReflectanceColor),this.mFresnelColor.copy(e.mFresnelColor),this.mDiffuseMap=e.mDiffuseMap,this.mNormalMap=e.mNormalMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mRoughnessMap=e.mRoughnessMap,this.mMetalnessMap=e.mMetalnessMap,this.mReflectanceTexture=e.mReflectanceTexture,this.mBrdfConfiguration=e.mBrdfConfiguration,this.mDetailMapConfiguration=e.mDetailMapConfiguration,this.mClearCoatConfiguration=e.mClearCoatConfiguration,this.mSheenConfiguration=e.mSheenConfiguration,this.mAnisotropicConfiguration=e.mAnisotropicConfiguration,this.mSubSurfaceConfiguration=e.mSubSurfaceConfiguration,this.mIridescenceConfiguration=e.mIridescenceConfiguration,this.mAoMapImpactOnAnalyticalLights=e.mAoMapImpactOnAnalyticalLights,this.mDirectLightIntensity=e.mDirectLightIntensity,this.mSpecularIntensity=e.mSpecularIntensity,this.mTwoSidedLighting=e.mTwoSidedLighting,this.mGlossiness=e.mGlossiness,this.mMetalnessF0Factor=e.mMetalnessF0Factor,this.mMetallicReflectanceTexture=e.mMetallicReflectanceTexture,this.mNormalScale.copy(e.mNormalScale),this.mEnvMapScale.copy(e.mEnvMapScale),this.mUseSpecularGlossinessFlow=e.mUseSpecularGlossinessFlow,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Rn.o);function L_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(L_=function(){return!!e})()}var j_=function(e){function t(){var e,n,r,i;return(0,s.A)(this,t),n=this,r=t,r=(0,oe.A)(r),e=(0,ae.A)(n,L_()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mInternalGeometry",void 0),e.mInternalGeometry=new THREE.BufferGeometry,e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"setVertexData",value:function(e,t){var n=this.resolveAttributeKind(e);this.mInternalGeometry.addAttribute(n,new THREE.BufferAttribute(t.getData(),t.getItemSize(),t.isNormalized()))}},{key:"setIndexData",value:function(e){this.mInternalGeometry.setIndex(new THREE.BufferAttribute(e.getData(),e.getItemSize(),e.isNormalized()))}},{key:"hasPositions",value:function(){return!!this.mInternalGeometry.getAttribute(this.resolveAttributeKind(Ns.P.POSITION))}},{key:"hasNormals",value:function(){return!!this.mInternalGeometry.getAttribute(this.resolveAttributeKind(Ns.P.NORMAL))}},{key:"hasTangents",value:function(){return!!this.mInternalGeometry.getAttribute(this.resolveAttributeKind(Ns.P.TANGENT))}},{key:"hasUV",value:function(){return!!this.mInternalGeometry.getAttribute(this.resolveAttributeKind(Ns.P.UV))}},{key:"hasUV2",value:function(){return!!this.mInternalGeometry.getAttribute(this.resolveAttributeKind(Ns.P.UV2))}},{key:"hasColors",value:function(){return!!this.mInternalGeometry.getAttribute(this.resolveAttributeKind(Ns.P.COLOR))}},{key:"hasAlpha",value:function(){var e=this.mInternalGeometry.getAttribute(this.resolveAttributeKind(Ns.P.UV));return e&&e.itemSize>3}},{key:"dispose",value:function(){this.mInternalGeometry.dispose()}},{key:"resolveAttributeKind",value:function(e){var t;switch(e){case Ns.P.NORMAL:t="normal";break;case Ns.P.TANGENT:t="tangent";break;case Ns.P.UV:t="uv";break;case Ns.P.UV2:t="uv2";break;case Ns.P.COLOR:t="color";break;default:case Ns.P.POSITION:t="position"}return t}},{key:"getInternalGeometry",value:function(){return this.mInternalGeometry}}])}(Ns.L),U_=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mMediaIds",void 0),(0,c.A)(this,"mDisposed",!1),(0,c.A)(this,"mTexture",void 0),this.mMediaIds=t}),[{key:"loadMediaModels",value:(e=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.mMediaIds.map(function(){var e=(0,n.A)(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",tn.u.getInstance().resolveModel(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.abrupt("return",Promise.all(t));case 2:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"enable",value:function(e){var t=this;this.loadMediaModels().then((function(n){if(!t.mDisposed){var r=new THREE.CubeTextureLoader;t.mTexture=r.load(n.map((function(e){return e.lod0_url}))),t.mTexture.name="skybox",e.background=t.mTexture}}),(function(e){v.UX.warn("failed to enable layer: ",e)}))}},{key:"disable",value:function(e){this.mDisposed=!0,e.background=null,this.mTexture&&(this.mTexture.dispose(),delete this.mTexture)}}]);var e}(),V_=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mMediaId",void 0),(0,c.A)(this,"mDisposed",!1),(0,c.A)(this,"mTexture",void 0),this.mMediaId=t}),[{key:"enable",value:function(e){var t=this;tn.u.getInstance().resolveModel(this.mMediaId).then((function(n){t.mDisposed||(t.mTexture=(new THREE.TextureLoader).load(n.lod0_url),t.mTexture.mapping=THREE.EquirectangularReflectionMapping,t.mTexture.magFilter=THREE.LinearFilter,t.mTexture.minFilter=THREE.LinearMipMapLinearFilter,e.background=t.mTexture)}),(function(e){v.UX.warn("failed to enable layer: ",e)}))}},{key:"disable",value:function(e){this.mDisposed=!0,e.background=null,this.mTexture&&(this.mTexture.dispose(),delete this.mTexture)}}])}();function z_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(z_=function(){return!!e})()}function H_(e,t,n,r){var i=(0,se.A)((0,oe.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var G_,q_,W_=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,z_()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mControls",void 0),(0,c.A)(e,"mEnabled",void 0),(0,c.A)(e,"mObject",void 0),(0,c.A)(e,"mTransformParentObject",void 0),(0,c.A)(e,"mTransformObject",void 0),(0,c.A)(e,"mMode",void 0),(0,c.A)(e,"mTargetMode",void 0),(0,c.A)(e,"mSpace",void 0),(0,c.A)(e,"mSize",1),(0,c.A)(e,"mObjectProperty",""),(0,c.A)(e,"mActiveCameraId",void 0),(0,c.A)(e,"mPreviousPosition",te.P.Zero()),(0,c.A)(e,"mPreviousQuaternion",ne.P.identity()),(0,c.A)(e,"mPreviousScale",te.P.One()),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"loadResource",value:(r=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mEnabled=e.enabled,this.mMode=e.mode,this.mTargetMode=e.targetMode,this.mSpace=e.space,this.mSize=e.size,this.mObjectProperty=e.objectProperty;var t=e.object;t!==this.mObject&&(this.mObject=t)}},{key:"onUpdateDirty",value:function(){H_(t,"onUpdateDirty",this,3)([]),this.updateProperties(),this.createRenderObject(),this.mControls.showX=!0,this.mControls.showY=!0,this.mControls.showZ=!0}},{key:"createRenderObject",value:function(){var e=this.getRenderer().getActiveCamera(),t=e.id;if(this.mControls)t!==this.mActiveCameraId&&(this.mActiveCameraId=t,this.mControls.camera=e);else{var n=this.getRenderer().getRenderer().domElement;this.mControls=new THREE.TransformControls(e,n),this.mTransformParentObject=new THREE.Object3D,this.mTransformParentObject.parent=this.getRenderer().getScene(),this.mTransformObject=new THREE.Object3D,this.mTransformObject.parent=this.mTransformParentObject,this.mActiveCameraId=t}if(this.mControls.enabled=this.mEnabled,this.mControls.setMode(this.resolveMode(this.mMode)),this.mControls.setSpace(this.resolveSpace(this.mSpace)),this.mControls.setSize(this.mSize),this.mObject?(this.updateTransformNodeFromEntity(this.mObject),this.mControls.attach(this.mTransformObject)):this.mControls.detach(),this.mControls.updateMatrixWorld(!0),this.mObject)if(this.mTargetMode===qg.OBJECT)this.mPreviousPosition.copy(this.mObject.transform.position),this.mPreviousQuaternion.copy(this.mObject.transform.quaternion),this.mPreviousScale.copy(this.mObject.transform.scale);else if(this.mTargetMode===qg.TARGET){var r=this.mObject.getValue("target");this.mPreviousPosition.copy(r),this.mPreviousQuaternion.set(0,0,0,1),this.mPreviousScale.set(1,1,1)}else if(this.mTargetMode===qg.PROPERTY){var i=this.mObject.getValue(this.mObjectProperty);this.mPreviousPosition.copy(i),this.mPreviousQuaternion.set(0,0,0,1),this.mPreviousScale.set(1,1,1)}this.mRenderObject=this.mControls}},{key:"destroyRenderObject",value:function(){this.mRenderObject&&(this.mTransformObject.parent=void 0,this.mControls.dispose(),delete this.mControls),H_(t,"destroyRenderObject",this,3)([])}},{key:"onAttached",value:function(){this.mControls&&(this.mControls.addEventListener("mouseDown",this.onMouseDown.bind(this)),this.mControls.addEventListener("mouseUp",this.onMouseUp.bind(this)))}},{key:"onDetached",value:function(){this.mControls&&(this.mControls.removeEventListener("mouseDown",this.onMouseDown.bind(this)),this.mControls.removeEventListener("mouseUp",this.onMouseUp.bind(this)))}},{key:"update",value:function(e){H_(t,"update",this,3)([e]);var n=!1,r=!1,i=!1;if(this.mObject){if(this.mMode===Kg.TRANSLATE&&this.didPan(this.mTransformObject.position)){if(this.mTargetMode===qg.OBJECT)this.mObject.transform.position.set(this.mTransformObject.position.x,this.mTransformObject.position.y,this.mTransformObject.position.z),this.mPreviousPosition.copy(this.mObject.transform.position);else if(this.mTargetMode===qg.TARGET){var a=new te.P(this.mTransformObject.position.x,this.mTransformObject.position.y,this.mTransformObject.position.z);this.mObject.setValue("target",a),this.mPreviousPosition.copy(a)}else if(this.mTargetMode===qg.PROPERTY){var o=new te.P(this.mTransformObject.position.x,this.mTransformObject.position.y,this.mTransformObject.position.z);this.mObject.setValue(this.mObjectProperty,o),this.mPreviousPosition.copy(o)}n=!0}this.mMode===Kg.ROTATE&&this.didRotate(this.mTransformObject.quaternion)&&(this.mTargetMode===qg.OBJECT&&(this.mObject.transform.quaternion.set(this.mTransformObject.quaternion.x,this.mTransformObject.quaternion.y,this.mTransformObject.quaternion.z,this.mTransformObject.quaternion.w),this.mPreviousQuaternion.copy(this.mObject.transform.quaternion)),r=!0),this.mMode===Kg.SCALE&&this.didScale(this.mTransformObject.scale)&&(this.mTargetMode===qg.OBJECT&&(this.mObject.transform.scale.set(this.mTransformObject.scale.x,this.mTransformObject.scale.y,this.mTransformObject.scale.z),this.mPreviousScale.copy(this.mObject.transform.scale)),i=!0),(n||r||i)&&this.onObjectChange()}}},{key:"resolveMode",value:function(e){var t;switch(e){case Kg.ROTATE:t="rotate";break;case Kg.SCALE:t="scale";break;case Kg.TRANSLATE:default:t="translate"}return t}},{key:"resolveSpace",value:function(e){var t;switch(e){case Yg.LOCAL:t="local";break;case Yg.WORLD:default:t="world"}return t}},{key:"onObjectChange",value:function(){R.K.eventBus().dispatch(new ib(nb.ObjectChange,this.mObject))}},{key:"onMouseDown",value:function(){R.K.eventBus().dispatch(new ib(nb.MouseDown))}},{key:"onMouseUp",value:function(){R.K.eventBus().dispatch(new ib(nb.MouseUp))}},{key:"didPan",value:function(e){var t=this.mPreviousPosition.x-e.x,n=this.mPreviousPosition.y-e.y,r=this.mPreviousPosition.z-e.z;return t*t+n*n+r*r>Sn.EPS}},{key:"didRotate",value:function(e){var t=this.mPreviousQuaternion.x-e.x,n=this.mPreviousQuaternion.y-e.y,r=this.mPreviousQuaternion.z-e.z,i=this.mPreviousQuaternion.w-e.w;return t*t+n*n+r*r+i*i>Sn.EPS}},{key:"didScale",value:function(e){var t=this.mPreviousScale.x-e.x,n=this.mPreviousScale.y-e.y,r=this.mPreviousScale.z-e.z;return t*t+n*n+r*r>Sn.EPS}},{key:"updateTransformNodeFromEntity",value:function(e){var t=e instanceof Hs.i?e.getParent():void 0;if(t){var n=te.P.Zero();t.transform.getWorldPosition(n),this.mTransformParentObject.position.set(n.x,n.y,n.z);var r=ne.P.identity();t.transform.getWorldQuaternion(r),this.mTransformParentObject.quaternion.set(r.x,r.y,r.z,r.w);var i=te.P.Zero();t.transform.getWorldScale(i),this.mTransformParentObject.scale.set(i.x,i.y,i.z)}else this.mTransformParentObject.position.set(0,0,0),this.mTransformParentObject.quaternion.set(0,0,0,1),this.mTransformParentObject.scale.set(1,1,1);if(this.mTransformParentObject.updateMatrix(),this.mTransformParentObject.updateMatrixWorld(!1),this.mTargetMode===qg.OBJECT)this.mTransformObject.position.set(e.transform.position.x,e.transform.position.y,e.transform.position.z),this.mTransformObject.quaternion.set(e.transform.quaternion.x,e.transform.quaternion.y,e.transform.quaternion.z,e.transform.quaternion.w),this.mTransformObject.scale.set(e.transform.scale.x,e.transform.scale.y,e.transform.scale.z);else if(this.mTargetMode===qg.TARGET){var a=this.mObject.getValue("target");this.mTransformObject.position.set(a.x,a.y,a.z),this.mTransformObject.quaternion.set(0,0,0,1),this.mTransformObject.scale.set(1,1,1)}else if(this.mTargetMode===qg.PROPERTY){var o=this.mObject.getValue(this.mObjectProperty);this.mTransformObject.position.set(o.x,o.y,o.z),this.mTransformObject.quaternion.set(0,0,0,1),this.mTransformObject.scale.set(1,1,1)}this.mTransformObject.updateMatrix()}}]);var r}(bb);function K_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(K_=function(){return!!e})()}(q_=G_||(G_={})).none="none",q_.transparent="transparent",q_.color="color",q_.environment="environment",q_.image="image",q_.cube="cube";var X_=function(e){function t(e,n,r){var i,a,o,u;return(0,s.A)(this,t),a=this,o=t,u=[n,r],o=(0,oe.A)(o),i=(0,ae.A)(a,K_()?Reflect.construct(o,u||[],(0,oe.A)(a).constructor):o.apply(a,u)),(0,c.A)(i,"mRenderer",void 0),(0,c.A)(i,"mScene",void 0),(0,c.A)(i,"mSceneDefaultBg",void 0),(0,c.A)(i,"mDefaultCamera",void 0),(0,c.A)(i,"mCamera",void 0),(0,c.A)(i,"mSyncHashHelper",new yp.Q),(0,c.A)(i,"mRaycaster",void 0),(0,c.A)(i,"mClippingCache",{}),(0,c.A)(i,"mClippingEmpty",[]),(0,c.A)(i,"mCanvas",void 0),(0,c.A)(i,"mRightHandedSystem",!0),(0,c.A)(i,"mSceneBackgroundStatePresent",!1),i.mCanvas=e,i.mCanvas.style.outline="none",i.mRaycaster=new THREE.Raycaster,i.mDefaultCamera=new THREE.PerspectiveCamera(60,1,.1,1e3),i.mDefaultCamera.name="Camera",i.mDefaultCamera.position.set(8,8,8),i.mDefaultCamera.lookAt(new THREE.Vector3(0,0,0)),i.init(),i}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"init",value:function(){this.initScene(),this.initRenderer()}},{key:"getScene",value:function(){return this.mScene}},{key:"getRenderer",value:function(){return this.mRenderer}},{key:"getActiveCamera",value:function(){return this.mCamera?this.mCamera.getRenderObject():this.mDefaultCamera}},{key:"initScene",value:function(){var e=this;this.mScene=new THREE.Scene;var t=new THREE.CubeTextureLoader;t.setCrossOrigin("anonymous"),t.setPath("".concat(et.w.assetsUrl,"system/textures/"));var n="cube-grayblue";t.load([n+"-side.png",n+"-side.png",n+"-top.png",n+"-bottom.png",n+"-side.png",n+"-side.png"],(function(t){e.mSceneDefaultBg=t,e.mSceneBackgroundStatePresent||!0!==e.mScene.userData._viewHasBg&&(e.mScene.background=e.mSceneDefaultBg)}),(function(){}),(function(){}))}},{key:"initRenderer",value:function(){var e=this.getDeviceSceneSettings();this.createRenderer(e),this.initRendererProperties(e),this.initRendererShadowMap(e)}},{key:"createRenderer",value:function(e){var t={alpha:e.alpha,depth:!0,stencil:!0,antialias:e.anti_aliasing,premultipliedAlpha:!0,preserveDrawingBuffer:!0===window.xpvCanvasPreserveDrawingBuffer,powerPreference:"default"},n=this.mCanvas.getContext("webgl2",t)||this.mCanvas.getContext("experimental-webgl",t)||this.mCanvas.getContext("webgl",t);this.mRenderer=new THREE.WebGLRenderer({antialias:e.anti_aliasing,alpha:e.alpha,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,canvas:this.mCanvas,context:n})}},{key:"initRendererProperties",value:function(e){this.mRenderer.autoClear=!1,this.mRenderer.physicallyCorrectLights=!1,this.mRenderer.setPixelRatio(window.devicePixelRatio),this.mRenderer.localClippingEnabled=!0,this.mRenderer.toneMapping=THREE.Uncharted2ToneMapping;var t=e.clear_color,n=t>>24,r=t>>16&255,i=t>>8&255,a=255&t;n=(n/=127)>1?1:n,this.mRenderer.setClearColor(new THREE.Color(r/255,i/255,a/255),n)}},{key:"initRendererShadowMap",value:function(e){switch(this.mRenderer.shadowMap.autoUpdate=!1,e.shadow){case"0":this.mRenderer.shadowMap.enabled=!1;break;case"1":this.mRenderer.shadowMap.enabled=!0,this.mRenderer.shadowMap.type=THREE.BasicShadowMap,this.mRenderer.shadowMap.needsUpdate=!0;break;case"2":this.mRenderer.shadowMap.enabled=!0,this.mRenderer.shadowMap.type=THREE.PCFShadowMap,this.mRenderer.shadowMap.needsUpdate=!0;break;case"3":this.mRenderer.shadowMap.enabled=!0,this.mRenderer.shadowMap.type=THREE.PCFSoftShadowMap,this.mRenderer.shadowMap.needsUpdate=!0}}},{key:"clear",value:function(e,t,n){this.mRenderer.clear(e,t,n)}},{key:"markShadowMapUpdate",value:function(){this.mRenderer.shadowMap.needsUpdate=!0}},{key:"beforeRender",value:function(e){this.mSyncHashHelper.newHash(),(e.lightsNeedRenderUpdate()||e.drawablesNeedRenderUpdate())&&this.markShadowMapUpdate()}},{key:"afterRender",value:function(e){this.renderCacheReady(!0)&&this.clearOutOfSync();var t=this.getActiveCamera();this.mRenderer.render(this.mScene,t)}},{key:"onBeforeMeshRender",value:function(e,t,n,r,i,a,o){o&&t.getObjectId()in this.mClippingCache&&(o.clippingPlanes=this.mClippingCache[t.getObjectId()])}},{key:"onAfterMeshRender",value:function(e,t,n,r,i,a,o){o&&(o.clippingPlanes=this.mClippingEmpty)}},{key:"raycast",value:function(e){var t=this,n=e.origin.clone(),r=e.direction.clone();return this.isRightHandedSystemActive()||(n.toggleCoordSystem(),r.toggleCoordSystem()),this.mRaycaster.ray=new THREE.Ray(new THREE.Vector3(n.x,n.y,n.z),new THREE.Vector3(r.x,r.y,r.z)),this.mRaycaster.near=0,this.mRaycaster.far=e.length,this.mRaycaster.intersectObjects(this.mScene.children,!0).map((function(e){var n=e.face?e.face.normal:void 0,r=e.uv,i=e.uv2,a=n?new te.P(n.x,n.y,n.z):te.P.Up(),o=a.clone();if(e.object){var s=new THREE.Quaternion;e.object.getWorldQuaternion(s),o.applyQuaternion(new ne.P(s.x,s.y,s.z,s.w))}var u=r?new ee.I(r.x,r.y):ee.I.Zero(),c=i?new ee.I(i.x,i.y):u.clone(),l=new te.P(e.point.x,e.point.y,e.point.z),h=t.getEntityFromObject(e.object);t.isRightHandedSystemActive()||(l.toggleCoordSystem(),n&&(a.toggleCoordSystem(),o.toggleCoordSystem()));var f=new Xy;return f.distance=e.distance,f.point.copy(l),f.normal.copy(o),f.faceNormal.copy(a),f.uv.copy(u),f.uv2.copy(c),f.entity=h,f})).filter((function(e){return!(e.entity instanceof iu.a)||!0===e.entity.pickable&&!e.entity.layers.isEnabled(4)}))}},{key:"raycastIntersects",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.origin.clone(),a=e.direction.clone();this.isRightHandedSystemActive()||(i.toggleCoordSystem(),a.toggleCoordSystem()),this.mRaycaster.ray=new THREE.Ray(new THREE.Vector3(i.x,i.y,i.z),new THREE.Vector3(a.x,a.y,a.z)),this.mRaycaster.near=0,this.mRaycaster.far=e.length;var o=t.map((function(e){return n.getObjectFromEntity(e)})).filter((function(e){return e}));return this.mRaycaster.intersectObjects(o,!r).map((function(e){var t=e.face?e.face.normal:void 0,r=e.uv,i=e.uv2,a=t?new te.P(t.x,t.y,t.z):te.P.Up(),o=a.clone();if(e.object){var s=new THREE.Quaternion;e.object.getWorldQuaternion(s),o.applyQuaternion(new ne.P(s.x,s.y,s.z,s.w))}var u=r?new ee.I(r.x,r.y):ee.I.Zero(),c=i?new ee.I(i.x,i.y):u.clone(),l=new te.P(e.point.x,e.point.y,e.point.z),h=n.getEntityFromObject(e.object);n.isRightHandedSystemActive()||(l.toggleCoordSystem(),t&&(a.toggleCoordSystem(),o.toggleCoordSystem()));var f=new Xy;return f.distance=e.distance,f.point.copy(l),f.normal.copy(o),f.faceNormal.copy(a),f.uv.copy(u),f.uv2.copy(c),f.entity=h,f})).filter((function(e){return!(e.entity instanceof iu.a)||!0===e.entity.pickable&&!e.entity.layers.isEnabled(4)}))}},{key:"getForwardRayFromCamera",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=new Ky;n.length=t;var r=this.getTechniqueFromEntity(e);if(!(r&&r instanceof $A))return n;var i=new THREE.Vector3,a=new THREE.Vector3;return r.getCamera().getWorldPosition(i),r.getCamera().getWorldDirection(a),n.origin.set(i.x,i.y,i.z),n.direction.set(a.x,a.y,a.z),n}},{key:"getForwardRayFromScreenCoords",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,i=new Ky;i.length=r;var a=this.getTechniqueFromEntity(e);if(!(a&&a instanceof $A))return i;var o=this.mRenderer.domElement.getBoundingClientRect(),s=t/o.width*2-1,u=-n/o.height*2+1,c=a.getCamera().matrixWorld,l=(new ie.k).fromArray(c.toArray());this.isRightHandedSystemActive()||l.toggleCoordSystem();var h=a.getCamera().projectionMatrix,f=(new ie.k).fromArray(h.toArray());this.isRightHandedSystemActive()||f.toggleCoordSystemAsProjection();var m=f.clone().invert();return i.origin.setFromMatrixPosition(l),i.direction.set(s,u,.5).unproject(l,m).sub(i.origin).normalize(),i}},{key:"createTexture2D",value:function(e,t,n,r,i,a,o,s,u,c,l,h,f,m){return new c_(e,t,n,r,i,a,o,s,u,c,l,h,f,m)}},{key:"createTextureCanvas",value:function(e,t,n,r,i,a,o,s,u,c,l,h,f,m){return new h_(e,t,n,r,i,a,o,s,u,c,l,h,f,m)}},{key:"createBuffer",value:function(){return new j_}},{key:"createMaterialLambert",value:function(e){return new b_(e)}},{key:"createMaterialBasic",value:function(e){return new __(e)}},{key:"createMaterialPhong",value:function(e){return new k_(e)}},{key:"createMaterialPhongExt",value:function(e){return new T_(e)}},{key:"createMaterialStandard",value:function(e){return new S_(e)}},{key:"createMaterialPhysical",value:function(e){return new E_(e)}},{key:"createMaterialPhysicalExt",value:function(e){return new I_(e)}},{key:"createMaterialLine",value:function(e){return new D_(e)}},{key:"createMaterialSimple",value:function(e){return new B_(e)}},{key:"createMaterialPBR",value:function(e){return new N_(e)}},{key:"enablePerspectiveCamera",value:function(e,t){this.createOrUpdate(e,$A)}},{key:"enableAmbientLight",value:function(e,t){this.createOrUpdate(e,CA)}},{key:"enableDirectionalLight",value:function(e,t){this.createOrUpdate(e,RA)}},{key:"enableHemisphericLight",value:function(e,t){this.createOrUpdate(e,OA)}},{key:"enablePointLight",value:function(e,t){this.createOrUpdate(e,PA)}},{key:"enableSpotLight",value:function(e,t){this.createOrUpdate(e,FA)}},{key:"enableRectAreaLight",value:function(e,t){this.createOrUpdate(e,LA)}},{key:"drawEffectAoPlane",value:function(e,t){this.createOrUpdate(e,Pb)}},{key:"drawEffectFire",value:function(e,t){this.createOrUpdate(e,Nb)}},{key:"drawEffectFlare",value:function(e,t){this.createOrUpdate(e,Ub)}},{key:"drawEffectGlare",value:function(e,t){this.createOrUpdate(e,Hb)}},{key:"drawEffectReflector",value:function(e,t){this.createOrUpdate(e,Wb)}},{key:"drawEffectSkyCube",value:function(e,t){this.createOrUpdate(e,Yb)}},{key:"drawEffectSkyEquirect",value:function(e,t){this.createOrUpdate(e,Qb)}},{key:"drawEffectWater",value:function(e,t){this.createOrUpdate(e,tA)}},{key:"drawGridArea",value:function(e,t){this.createOrUpdate(e,Sb)}},{key:"drawPrimitiveLine",value:function(e,t){this.createOrUpdate(e,yA)}},{key:"drawPrimitiveBox",value:function(e,t){this.createOrUpdate(e,AA)}},{key:"drawPrimitivePlane",value:function(e,t){this.createOrUpdate(e,kA)}},{key:"drawPrimitiveSphere",value:function(e,t){this.createOrUpdate(e,xA)}},{key:"drawUI",value:function(e,t){switch(e.getType().getTypeName()){case"UiEntityAnnotation":this.createOrUpdate(e,xy);break;case"UiEntityButton":this.createOrUpdate(e,Iy);break;case"UiEntityImage":this.createOrUpdate(e,Fy);break;case"UiEntityTag":this.createOrUpdate(e,Vy);break;case"UiEntityText":this.createOrUpdate(e,Wy);break;default:v.UX.warn("Unknown ui entity to renderer: ",e.getType().getTypeName())}}},{key:"drawMesh",value:function(e,t){this.createOrUpdate(e,Mb)}},{key:"drawMeshLine",value:function(e,t){this.createOrUpdate(e,Tb)}},{key:"pushGlobalStates",value:function(){}},{key:"popGlobalStates",value:function(){}},{key:"enableClippingPlane",value:function(e,t,n){var r=e,i=this.mClippingCache[t.getObjectId()]||[],a=r.getPlanes();a.forEach((function(e,t){var n=e.normal;if(t<i.length)return i[t].normal.set(n.x,n.y,n.z),void(i[t].constant=e.constant);i.push(new THREE.Plane(new THREE.Vector3(n.x,n.y,n.z),e.constant))})),a.length<i.length&&i.splice(a.length),this.mClippingCache[t.getObjectId()]=i}},{key:"drawTransformControlsGizmo",value:function(e,t){this.createOrUpdate(e,W_)}},{key:"enableSceneBackground",value:function(e,t){switch(this.mSceneBackgroundStatePresent=!0,e.getBackgroundType()){case Ro.transparent:return this.enableSceneBackgroundTransparent(e,t);case Ro.color:return this.enableSceneBackgroundColor(e,t);case Ro.image:return this.enableSceneBackgroundImage(e,t);case Ro.equirect:return this.enableSceneBackgroundEquirect(e,t);case Ro.skybox:return this.enableSceneBackgroundSkybox(e,t)}}},{key:"enableSceneBackgroundTransparent",value:function(e,t){var n=this,r=this.mScene.background;return this.mScene.background=null,{state:e,restore:function(){n.mScene.background=r}}}},{key:"enableSceneBackgroundColor",value:function(e,t){var n=this,r=this.mScene.background,i=e.getColor();return this.mScene.background=new THREE.Color(i.r,i.g,i.b),{state:e,restore:function(){n.mScene.background=r}}}},{key:"enableEnvironment",value:function(e,t){}},{key:"enableEnvironmentIntensity",value:function(e,t){}},{key:"enableEnvironmentRotation",value:function(e,t){}},{key:"enableSceneBackgroundImage",value:function(e,t){var n=this,r=this.mScene.background,i=e.getMediaId(),a=new V_(i);return a.enable(this.mScene),{state:e,restore:function(){a.disable(n.mScene),n.mScene.background=r}}}},{key:"enableSceneBackgroundEquirect",value:function(e,t){var n=this,r=this.mScene.background,i=e.getMediaId(),a=new V_(i);return a.enable(this.mScene),{state:e,restore:function(){a.disable(n.mScene),n.mScene.background=r}}}},{key:"enableSceneBackgroundSkybox",value:function(e,t){var n=this,r=this.mScene.background,i=e.getMediaIds(),a=new U_(i);return a.enable(this.mScene),{state:e,restore:function(){a.disable(n.mScene),n.mScene.background=r}}}},{key:"disableDefaultBackground",value:function(){this.mScene.background=null,this.mSceneBackgroundStatePresent=!0}},{key:"dispose",value:function(){for(var e=0,t=Object.entries(this.mRenderCache);e<t.length;e++){var n=(0,o.A)(t[e],2)[1];n.detach(),n.dispose()}var r;(this.mSceneBackgroundStatePresent=!1,this.mSceneDefaultBg&&(this.mSceneDefaultBg.dispose(),delete this.mSceneDefaultBg),this.mRenderCache={},this.mScene)&&((r=this.mScene).remove.apply(r,(0,a.A)(this.mScene.children)),delete this.mScene);this.mRenderer.dispose(),this.mUiRenderer.dispose(),this.mSyncHashHelper.newHash()}},{key:"createOrUpdate",value:function(e,t){var n=this.mRenderCache[e.getObjectId()];n||(this.mRenderCache[e.getObjectId()]=n=new t(e,this),n.initialize()),n.disposed||(n.setSyncHash(this.mSyncHashHelper.getHash()),n.ready&&this.renderCacheReady()&&(n.attached||(n.attach(),this.markShadowMapUpdate()),n.update(this.mDeltaTime)))}},{key:"clearOutOfSync",value:function(){for(var e=0,t=Object.keys(this.mRenderCache);e<t.length;e++){var n=t[e],r=this.mRenderCache[n];r.getSyncHash()!==this.mSyncHashHelper.getHash()&&(r.detach(),r.dispose(),delete this.mRenderCache[n],delete this.mClippingCache[n],this.markShadowMapUpdate())}}},{key:"getObjectFromEntity",value:function(e){var t=this.getTechniqueFromEntity(e);return t instanceof bb?t.getRenderObject():void 0}},{key:"getEntityFromObject",value:function(e){if(e&&e.userData)for(var t=e.userData.scene_entity_id,n=0,r=Object.entries(this.mRenderCache);n<r.length;n++){var i=(0,o.A)(r[n],2)[1];if(i.equalsId(t))return i.getSceneEntity()}}},{key:"getTechniqueFromEntity",value:function(e){for(var t=0,n=Object.entries(this.mRenderCache);t<n.length;t++){var r=(0,o.A)(n[t],2)[1];if(r.equals(e))return r}}},{key:"setSize",value:function(e,t){this.mRenderer.setSize(e,t),this.mUiRenderer.resize(e,t),this.mDefaultCamera.aspect=e/t,this.mDefaultCamera.updateProjectionMatrix(),this.mCamera&&this.mCamera.setSize(e,t)}},{key:"setPixelRatio",value:function(e){this.mRenderer.setPixelRatio(e)}},{key:"getCanvas",value:function(){return this.mCanvas}},{key:"getSceneBoundingBox",value:function(){for(var e=new THREE.Box3,t=0,n=Object.entries(this.mRenderCache);t<n.length;t++){var r=(0,o.A)(n[t],2)[1];if(r.getSceneEntity().visible&&(!(r.getSceneEntity().layers.isEnabled(1)||r.getSceneEntity().layers.isEnabled(2)||r.getSceneEntity().layers.isEnabled(3)||r.getSceneEntity().layers.isEnabled(5)||r.getSceneEntity().layers.isEnabled(7)||r.getSceneEntity().layers.isEnabled(8))&&r instanceof bb)){var i=r.getRenderObject();if(i instanceof THREE.Object3D){var a=(new THREE.Box3).setFromObject(i);e.union(a)}}}return new Os.N(new te.P(e.min.x,e.min.y,e.min.z),new te.P(e.max.x,e.max.y,e.max.z))}},{key:"setCameraActive",value:function(e){this.mCamera=e,this.mCamera.setSize(this.mCanvas.width,this.mCanvas.height)}},{key:"isRightHandedSystemActive",value:function(){return this.mRightHandedSystem}},{key:"getInternalScene",value:function(){return this.mScene}},{key:"getInternalRenderer",value:function(){return this.mRenderer}},{key:"isBackgroundAllowed",value:function(e){return e!==G_.environment}}],[{key:"loadScripts",value:(r=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=tt.A.getHost(),e.next=3,tt.A.loadScript("".concat(t.origin,"/vendor.threejs.lib.js").concat(t.params));case 3:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"installScripts",value:function(){void 0===window.particleFire||window.particleFire.getInstalled("THREE")||window.particleFire.install({THREE:window.THREE})}}]);var r}(Ot.L_);(0,c.A)(X_,"TypeRTTI",new le.O("ThreejsRenderer",Ot.L_.TypeRTTI));var Y_,$_,Z_=__webpack_require__(94196),Q_=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mTopics",{})}),[{key:"getTopic",value:function(e){return this.mTopics[e]=this.mTopics[e]||{enabled:!0,listeners:{}},this.mTopics[e]}},{key:"_setTopicEnabled",value:function(e,t){this.getTopic(e).enabled=t}},{key:"_isTopicEnabled",value:function(e){return this.getTopic(e).enabled}},{key:"_dispatch",value:function(e,t,n){var r=[this.getTopic(e),this.getTopic("*")];if(r.some((function(e){return e.enabled})))for(var i=0,a=r;i<a.length;i++)for(var s=a[i],u=0,c=Object.entries(s.listeners);u<c.length;u++){var l=(0,o.A)(c[u],2)[1];n&&l.address!==n||l.callback(t,e)}}},{key:"_subscribe",value:function(e,t,n){var r=this,i=this.getTopic(e),a=f.V.guid();return i.listeners[a]={address:n,callback:t},{unsubscribe:function(){r.unsubscribe(e,a)}}}},{key:"_subscribeAll",value:function(e,t){var n=this,r=this.getTopic("*"),i=f.V.guid();return r.listeners[i]={address:t,callback:e},{unsubscribe:function(){n.unsubscribe("*",i)}}}},{key:"unsubscribe",value:function(e,t){delete this.getTopic(e).listeners[t]}},{key:"_dispose",value:function(){var e=this;Object.keys(this.mTopics).forEach((function(t){delete e.mTopics[t]}))}}])}(),J_="$$_xpv_default_bus_broker_$$",eM=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mDefaultBrokerName",J_),(0,c.A)(this,"mBrokers",(0,c.A)({},J_,new Q_))}),[{key:"addBroker",value:function(e,t){this.mBrokers[e]=t}},{key:"removeBroker",value:function(e){if(e===this.mDefaultBrokerName)throw new Error("Default broker can not be removed");delete this.mBrokers[e]}},{key:"changeDefaultBroker",value:function(e){return e in this.mBrokers&&(this.mDefaultBrokerName=e,!0)}},{key:"getBroker",value:function(e){return void 0!==e?this.mBrokers[e]:this.mBrokers[this.mDefaultBrokerName]}},{key:"enableTopic",value:function(e,t){this.getBroker(t)._setTopicEnabled(e,!0)}},{key:"disableTopic",value:function(e,t){this.getBroker(t)._setTopicEnabled(e,!1)}},{key:"isTopicEnabled",value:function(e,t){return this.getBroker(t)._isTopicEnabled(e)}},{key:"subscribe",value:function(e,t,n,r){return this.getBroker(r)._subscribe(e,t,n)}},{key:"subscribeAll",value:function(e,t,n){return this.getBroker(n)._subscribeAll(e,t)}},{key:"dispatch",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,i=this.getBroker(n);r>=0?window.setTimeout((function(){i._dispatch(e.getName(),e,t)}),r):i._dispatch(e.getName(),e,t)}},{key:"dispose",value:function(){var e=this;Object.keys(this.mBrokers).forEach((function(t){e.mBrokers[t]._dispose(),delete e.mBrokers[t]}))}}])}(),tM=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mMessage",void 0),(0,c.A)(this,"mReplys",new L.m),this.mMessage=t}),[{key:"onReply",value:function(e){return this.mReplys.subscribe(e)}},{key:"_reply",value:function(e){this.mReplys.next(e)}}])}(),nM=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mBroker",new Q_)}),[{key:"send",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;r>=0?window.setTimeout((function(){n.mBroker._dispatch(e.getType().getTypeName(),e,t)}),r):this.mBroker._dispatch(e.getType().getTypeName(),e,t)}},{key:"request",value:function(e,t){var n=new tM(e);return e._pushReplyListener(n),this.send(e,t),n}},{key:"enableMessageType",value:function(e){this.mBroker._setTopicEnabled(e.getTypeName(),!0)}},{key:"disableMessageType",value:function(e){this.mBroker._setTopicEnabled(e.getTypeName(),!1)}},{key:"isMessageTypeEnabled",value:function(e){return this.mBroker._isTopicEnabled(e.getTypeName())}},{key:"listen",value:function(e,t,n){return this.mBroker._subscribe(e.getTypeName(),t,n)}},{key:"dispose",value:function(){this.mBroker._dispose()}}])}(),rM=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mData",void 0),this.mData={}}),[{key:"dispatch",value:function(e,t){this.initData(e),this.mData[e].listeners&&this.mData[e].listeners.next(t),this.mData[e].data=t}},{key:"get",value:function(e){return this.initData(e),this.mData[e].data}},{key:"subscribe",value:function(e,t){return this.initData(e),this.mData[e].listeners.subscribe((function(e){t(e)}))}},{key:"dispose",value:function(){Object.entries(this.mData).forEach((function(e){var t=(0,o.A)(e,2)[1];t.listeners.unsubscribe(),delete t.data}))}},{key:"initData",value:function(e){this.mData[e]||(this.mData[e]={listeners:new M.B})}}])}(),iM=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mInterceptors",void 0),this.mInterceptors={}}),[{key:"intercept",value:(e=(0,n.A)(i().mark((function e(t,n){var r,a,o,s=this,u=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=u.length,a=new Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=u[o];return e.abrupt("return",new Promise((function(e,r){if(t in s.mInterceptors&&s.mInterceptors[t].length>0){var i=s.mInterceptors[t].reduce((function(e,t){return t.execute.apply(t,[e].concat(a))}),n);null!=i?e(i):r(i)}else e(n)})));case 2:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)})},{key:"registerInterceptor",value:function(e,t){return e in this.mInterceptors||(this.mInterceptors[e]=[]),this.mInterceptors[e].push(t),t.cid}},{key:"unregisterInterceptor",value:function(e,t){return this.unregisterInterceptorByCid(e,t.cid)}},{key:"unregisterInterceptorByCid",value:function(e,t){if(e in this.mInterceptors){var n=this.mInterceptors[e].findIndex((function(e){return e.cid===t}));if(n>=0)return this.mInterceptors[e].splice(n,1)[0]}}},{key:"dispose",value:function(){delete this.mInterceptors}}]);var e}(),aM=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mSystems",new Map)}),[{key:"createSystem",value:function(e,t){this.mSystems.has(e)||this.mSystems.set(e,t)}},{key:"getSystem",value:function(e){return this.mSystems.get(e)}},{key:"dispose",value:function(){this.mSystems.forEach((function(e){return e.dispose()})),this.mSystems.clear()}}])}(),oM=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mIsInitialized",!1),(0,c.A)(this,"mRenderer",void 0),(0,c.A)(this,"mSceneManager",void 0),(0,c.A)(this,"mEventBus",void 0),(0,c.A)(this,"mMessenger",void 0),(0,c.A)(this,"mCommandManager",void 0),(0,c.A)(this,"mStateRegistery",void 0),(0,c.A)(this,"mSettingsManager",void 0),(0,c.A)(this,"mInterceptorManager",void 0),(0,c.A)(this,"mPhysicsSystem",void 0),(0,c.A)(this,"mConstraintSystem",void 0)}),[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.renderer)this.mRenderer=e.renderer;else{var t=document.createElement("canvas");document.body.appendChild(t);var n=document.createElement("div");document.body.appendChild(n),this.mRenderer=new D(new vb(t,n,new N.nQ))}this.mSceneManager=e.sceneManager||new Nd,this.mEventBus=e.eventBus||new eM,this.mMessenger=e.messenger||new nM,this.mCommandManager=e.commandManager||new F,this.mStateRegistery=e.stateRegistry||new rM,this.mSettingsManager=e.settingsManager||new W,this.mInterceptorManager=e.interceptorManager||new iM,this.mPhysicsSystem=e.physicsSystem,this.mConstraintSystem=e.constraintSystem||new aM,this.mIsInitialized=!0}},{key:"isInitialized",value:function(){return this.mIsInitialized}},{key:"renderer",value:function(){if(!this.mRenderer)throw new Error("Module used before initialisation.");return this.mRenderer}},{key:"sceneManager",value:function(){if(!this.mSceneManager)throw new Error("Module used before initialisation.");return this.mSceneManager}},{key:"eventBus",value:function(){if(!this.mEventBus)throw new Error("Module used before initialisation.");return this.mEventBus}},{key:"messenger",value:function(){if(!this.mMessenger)throw new Error("Module used before initialisation.");return this.mMessenger}},{key:"commandManager",value:function(){if(!this.mCommandManager)throw new Error("Module used before initialisation.");return this.mCommandManager}},{key:"stateRegistery",value:function(){if(!this.mStateRegistery)throw new Error("Module used before initialisation.");return this.mStateRegistery}},{key:"settingsManager",value:function(){if(!this.mSettingsManager)throw new Error("Module used before initialisation.");return this.mSettingsManager}},{key:"interceptorManager",value:function(){if(!this.mInterceptorManager)throw new Error("Modules used before initialisation.");return this.mInterceptorManager}},{key:"physicsSystem",value:function(){return this.mPhysicsSystem}},{key:"constraintSystem",value:function(){if(!this.mConstraintSystem)throw new Error("Modules used before initialisation.");return this.mConstraintSystem}},{key:"dispose",value:function(){var e,t,n,r,i,a,o,s,u,c;null===(e=this.mSceneManager)||void 0===e||e.destroyScene(),null===(t=this.mRenderer)||void 0===t||t.dispose(),null===(n=this.mEventBus)||void 0===n||n.dispose(),null===(r=this.mMessenger)||void 0===r||r.dispose(),null===(i=this.mCommandManager)||void 0===i||i.dispose(),null===(a=this.mStateRegistery)||void 0===a||a.dispose(),null===(o=this.mSettingsManager)||void 0===o||o.dispose(),null===(s=this.mInterceptorManager)||void 0===s||s.dispose(),null===(u=this.mPhysicsSystem)||void 0===u||u.dispose(),null===(c=this.mConstraintSystem)||void 0===c||c.dispose()}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.renderer){var n;if(t)null===(n=this.mRenderer)||void 0===n||n.dispose();this.mRenderer=e.renderer}if(e.sceneManager){var r;if(t)null===(r=this.mSceneManager)||void 0===r||r.destroyScene();this.mSceneManager=e.sceneManager}if(e.eventBus){var i;if(t)null===(i=this.mEventBus)||void 0===i||i.dispose();this.mEventBus=e.eventBus}if(e.messenger){var a;if(t)null===(a=this.mMessenger)||void 0===a||a.dispose();this.mMessenger=e.messenger}if(e.commandManager){var o;if(t)null===(o=this.mCommandManager)||void 0===o||o.dispose();this.mCommandManager=e.commandManager}if(e.stateRegistry){var s;if(t)null===(s=this.mStateRegistery)||void 0===s||s.dispose();this.mStateRegistery=e.stateRegistry}if(e.settingsManager){var u;if(t)null===(u=this.mSettingsManager)||void 0===u||u.dispose();this.mSettingsManager=e.settingsManager}if(e.interceptorManager){var c;if(t)null===(c=this.mInterceptorManager)||void 0===c||c.dispose();this.mInterceptorManager=e.interceptorManager}if(e.physicsSystem){var l;if(t)null===(l=this.mPhysicsSystem)||void 0===l||l.dispose();this.mPhysicsSystem=e.physicsSystem}if(e.constraintSystem){var h;if(t)null===(h=this.mConstraintSystem)||void 0===h||h.dispose();this.mConstraintSystem=e.constraintSystem}}}])}();($_=Y_||(Y_={}))[$_.Realtime2d=0]="Realtime2d",$_[$_.Realtime3d=1]="Realtime3d";var sM=(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"separation",0),(0,c.A)(this,"normal",new te.P),(0,c.A)(this,"body1",null),(0,c.A)(this,"body2",null),(0,c.A)(this,"contact1",new te.P),(0,c.A)(this,"contact2",new te.P),(0,c.A)(this,"contactCount",0)})),uM=(__webpack_require__(45374),__webpack_require__(64601),__webpack_require__(44435),function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),null,[{key:"findPolygonsContactPoints",value:function(e,t,n,r){for(var i=0,a=Number.MAX_SAFE_INTEGER,o=new ee.I,s=0;s<e.length;s++)for(var u=e[s],c=0;c<t.length;c++){var l=t[c],h=t[(c+1)%t.length],f=this.pointSegmentDistance(u,l,h,o);Math.abs(f-a)<Number.EPSILON?o.distanceToSquared(n)<Number.EPSILON&&(r.copy(o),i=2):f<a&&(a=f,i=1,n.copy(o))}for(var m=0;m<t.length;m++)for(var p=t[m],d=0;d<e.length;d++){var v=e[d],y=e[(d+1)%e.length],g=this.pointSegmentDistance(p,v,y,o);Math.abs(g-a)<Number.EPSILON?o.distanceToSquared(n)<Number.EPSILON&&(r.copy(o),i=2):g<a&&(a=g,i=1,n.copy(o))}return i}},{key:"findCirclePolygonContactPoint",value:function(e,t,n,r,i){for(var a=Number.MAX_SAFE_INTEGER,o=new ee.I,s=0;s<r.length;s++){var u=r[s],c=r[(s+1)%r.length],l=this.pointSegmentDistance(e,u,c,o);l<a&&(a=l,i.copy(o))}return 1}},{key:"findCirclesContactPoint",value:function(e,t,n,r,i){var a=n.clone().sub(e).normalize();return i.copy(e.clone().add(a.multiplyScalar(t))),1}},{key:"pointSegmentDistance",value:function(e,t,n,r){var i=n.clone().sub(t),a=e.clone().sub(t).dot(i)/i.lengthSq();return a<=0?r.copy(t):a>=1?r.copy(n):r.copy(t.clone().add(i.clone().multiplyScalar(a))),e.distanceToSquared(r)}},{key:"intersectCircles",value:function(e,t,n,r){var i=e.distanceTo(n),a=t+r;return i>=a?null:{normal:n.clone().sub(e).normalize(),depth:a-i}}},{key:"intersectCirclePolygon",value:function(e,t,n,r){for(var i=new ee.I(0,0),a=Number.MAX_SAFE_INTEGER,o=new ee.I(0,0),s=0,u=0;u<n.length;u++){var c=n[u],l=n[(u+1)%n.length].clone().sub(c);o.set(-l.y,l.x).normalize();var h=this.projectVertices(n,o),f=h.min,m=h.max,p=this.projectCircle(e,t,o),d=p.min,v=p.max;if(f>=v||d>=m)return null;(s=Math.min(v-f,m-d))<a&&(a=s,i.set(o.x,o.y))}var y=n[this.findClosestPointOnPolygon(e,n)];o.copy(y.clone().sub(e)).normalize();var g=this.projectVertices(n,o),b=g.min,A=g.max,_=this.projectCircle(e,t,o),M=_.min,k=_.max;return b>=k||M>=A?null:((s=Math.min(k-b,A-M))<a&&(a=s,i.set(o.x,o.y)),(r||this.findArithmeticMean(n)).clone().sub(e).dot(i)<0&&i.negate(),{normal:i,depth:a})}},{key:"intersectPolygons",value:function(e,t,n,r){for(var i=new ee.I(0,0),a=Number.MAX_SAFE_INTEGER,o=new ee.I(0,0),s=0;s<e.length;s++){var u=e[s],c=e[(s+1)%e.length].clone().sub(u);o.set(-c.y,c.x).normalize();var l=this.projectVertices(e,o),h=l.min,f=l.max,m=this.projectVertices(t,o),p=m.min,d=m.max;if(h>=d||p>=f)return null;var v=Math.min(d-h,f-p);v<a&&(a=v,i.set(o.x,o.y))}for(var y=0;y<t.length;y++){var g=t[y],b=t[(y+1)%t.length].clone().sub(g);o.set(-b.y,b.x).normalize();var A=this.projectVertices(e,o),_=A.min,M=A.max,k=this.projectVertices(t,o),w=k.min,T=k.max;if(_>=T||w>=M)return null;var x=Math.min(T-_,M-w);x<a&&(a=x,i.set(o.x,o.y))}var S=n||this.findArithmeticMean(e);return(r||this.findArithmeticMean(t)).clone().sub(S).dot(i)<0&&i.negate(),{normal:i,depth:a}}},{key:"findArithmeticMean",value:function(e){for(var t=0,n=0,r=0;r<e.length;r++){var i=e[r];t+=i.x,n+=i.y}return new ee.I(t/e.length,n/e.length)}},{key:"projectCircle",value:function(e,t,n){var r=new ee.I(n.x,n.y).multiplyScalar(t),i=new ee.I(e.x,e.y).add(r),a=new ee.I(e.x,e.y).sub(r),o=i.dot(n),s=a.dot(n);if(o>s){var u=o;o=s,s=u}return{min:o,max:s}}},{key:"projectVertices",value:function(e,t){for(var n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,i=0;i<e.length;i++){var a=e[i].dot(t);a<n&&(n=a),a>r&&(r=a)}return{min:n,max:r}}},{key:"isPointInPolygon",value:function(e,t){for(var n=!1,r=0,i=t.length-1;r<t.length;i=r++){var a=t[r].x,o=t[r].y,s=t[i].x,u=t[i].y;o>e.y!=u>e.y&&e.x<(s-a)*(e.y-o)/(u-o)+a&&(n=!n)}return n}},{key:"isPointInCircle",value:function(e,t,n){return e.distanceTo(t)<=n}},{key:"closestPointOnPolygon",value:function(e,t,n){for(var r=Number.MAX_SAFE_INTEGER,i=new ee.I,a=0;a<t.length;a++){var o=t[a],s=t[(a+1)%t.length],u=this.pointSegmentDistance(e,o,s,i);u<r&&(r=u,n.copy(i))}return Math.sqrt(r)}},{key:"findClosestPointOnPolygon",value:function(e,t){for(var n=-1,r=Number.MAX_SAFE_INTEGER,i=0;i<t.length;i++){var a=t[i].distanceTo(e);a<r&&(r=a,n=i)}return n}},{key:"createBoxVertices",value:function(e,t,n){var r=-.5*e,i=.5*e,a=-.5*t,o=.5*t;n.push(new ee.I(r,o),new ee.I(i,o),new ee.I(i,a),new ee.I(r,a))}},{key:"createTransformVertices",value:function(e,t,n,r){for(var i=0;i<e.length;i++){var a=e[i],o=new te.P(a.x,0,a.y).applyQuaternion(n);r.push(new ee.I(o.x,o.z).add(t))}}}])}()),cM=__webpack_require__(99720),lM=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"collide",value:function(e,t,n){for(var r=new ee.I,i=new ee.I,a=0;a<e.length;a++){var o=e[a],s=t[a],u=this.findCollision(o,s);if(u){r.set(0,0),i.set(0,0);var c=this.findContactPoints(o,s,r,i),l=new sM;l.separation=u.depth,l.normal.set(u.normal.x,0,u.normal.y),l.body1=o,l.body2=s,l.contactCount=c,c>0&&l.contact1.set(r.x,0,r.y),c>1&&l.contact2.set(i.x,0,i.y),n.push(l)}}}},{key:"findCollision",value:function(e,t){if(e.getShape().getShapeType()===cM.B.Box&&t.getShape().getShapeType()===cM.B.Box)return uM.intersectPolygons(e.getTransformedVertices(),t.getTransformedVertices(),new ee.I(e.getPosition().x,e.getPosition().z),new ee.I(t.getPosition().x,t.getPosition().z));if(e.getShape().getShapeType()===cM.B.Box&&t.getShape().getShapeType()===cM.B.Sphere){var n=uM.intersectCirclePolygon(new ee.I(t.getPosition().x,t.getPosition().z),t.getShape().getRadius(),e.getTransformedVertices(),new ee.I(e.getPosition().x,e.getPosition().z));return n&&n.normal.negate(),n}if(e.getShape().getShapeType()===cM.B.Sphere&&t.getShape().getShapeType()===cM.B.Box)return uM.intersectCirclePolygon(new ee.I(e.getPosition().x,e.getPosition().z),e.getShape().getRadius(),t.getTransformedVertices(),new ee.I(t.getPosition().x,t.getPosition().z));if(e.getShape().getShapeType()===cM.B.Sphere&&t.getShape().getShapeType()===cM.B.Sphere)return uM.intersectCircles(new ee.I(e.getPosition().x,e.getPosition().z),e.getShape().getRadius(),new ee.I(t.getPosition().x,t.getPosition().z),t.getShape().getRadius());throw new Error("Shape not found")}},{key:"findContactPoints",value:function(e,t,n,r){if(e.getShape().getShapeType()===cM.B.Box&&t.getShape().getShapeType()===cM.B.Box)return uM.findPolygonsContactPoints(e.getTransformedVertices(),t.getTransformedVertices(),n,r);if(e.getShape().getShapeType()===cM.B.Box&&t.getShape().getShapeType()===cM.B.Sphere)return uM.findCirclePolygonContactPoint(new ee.I(t.getPosition().x,t.getPosition().z),t.getShape().getRadius(),new ee.I(e.getPosition().x,e.getPosition().z),e.getTransformedVertices(),n);if(e.getShape().getShapeType()===cM.B.Sphere&&t.getShape().getShapeType()===cM.B.Box)return uM.findCirclePolygonContactPoint(new ee.I(e.getPosition().x,e.getPosition().z),e.getShape().getRadius(),new ee.I(t.getPosition().x,t.getPosition().z),t.getTransformedVertices(),n);if(e.getShape().getShapeType()===cM.B.Sphere&&t.getShape().getShapeType()===cM.B.Sphere)return uM.findCirclesContactPoint(new ee.I(e.getPosition().x,e.getPosition().z),e.getShape().getRadius(),new ee.I(t.getPosition().x,t.getPosition().z),t.getShape().getRadius(),n);throw new Error("Shape not found")}}])}(),hM=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"getCollisions",value:function(e,t,n){for(var r=e.getBodies(),i=0;i<r.length-1;i++)for(var a=r[i],o=i+1;o<r.length;o++){var s=r[o];this.canCollisionCheck(a,s)&&(this.intersectionCheck(a,s)&&(t.push(a),n.push(s)))}}},{key:"canCollisionCheck",value:function(e,t){return!(e.getBodyType()===Ks.k.Static&&t.getBodyType()===Ks.k.Static)}},{key:"intersectionCheck",value:function(e,t){return e.aabbNeedsUpdate&&e.updateAABB(),t.aabbNeedsUpdate&&t.updateAABB(),e.getAABB().intersectsBox(t.getAABB())}}])}(),fM=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"solve",value:function(e,t,n,r){for(var i=0;i<r.length;i++){var a=r[i],o=a.body1,s=a.body2;if(o&&s){var u=a.normal.clone().multiplyScalar(a.separation);this.separateBodies(o,s,u)}}}},{key:"separateBodies",value:function(e,t,n){e.getBodyType()===Ks.k.Static?t.move(n):t.getBodyType()===Ks.k.Static?e.move(n.clone().negate()):(e.move(n.clone().multiplyScalar(-.5)),t.move(n.clone().multiplyScalar(.5)))}},{key:"resolveCollision",value:function(e){var t=e.body1,n=e.body2,r=e.normal,i=n.getLinearVelocity().clone().sub(t.getLinearVelocity());if(!(i.dot(r)>0)){var a=-1*i.dot(r);a/=2;var o=r.clone().multiplyScalar(a);t.setLinearVelocity(t.getLinearVelocity().clone().sub(o.clone().multiplyScalar(1))),n.setLinearVelocity(n.getLinearVelocity().clone().add(o.clone().multiplyScalar(1)))}}}])}();function mM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mM=function(){return!!e})()}var pM=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,mM()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mType",Ks.k.Dynamic),(0,c.A)(r,"mShape",void 0),(0,c.A)(r,"mAABB",new Os.N),(0,c.A)(r,"mAABBNeedsUpdate",!0),(0,c.A)(r,"mPosition",new te.P),(0,c.A)(r,"mPrevPosition",new te.P),(0,c.A)(r,"mQuaternion",new ne.P),(0,c.A)(r,"mPrevQuaternion",new ne.P),(0,c.A)(r,"mLinearVelocity",new te.P),(0,c.A)(r,"mAngularVelocity",new ne.P),(0,c.A)(r,"mTransformedVertices",[]),(0,c.A)(r,"mTransformedVerticesNeedsUpdate",!0),(0,c.A)(r,"mOffset",new te.P),(0,c.A)(r,"mOffsetRotation",ne.P.identity()),(0,c.A)(r,"mIgnoreSync",!1),r.mShape=e,r.setBodyType(n),r.updateAABB(),r.updateTransformedVertices(),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getBodyType",value:function(){return this.mType}},{key:"setBodyType",value:function(e){this.mType=e===Ks.k.Kinematic?Ks.k.Static:e}},{key:"getShape",value:function(){return this.mShape}},{key:"step",value:function(e,t){if(this.mType!==Ks.k.Static){var n=e/t;this.mPosition.x+=this.mLinearVelocity.x*n,this.mPosition.y+=this.mLinearVelocity.y*n,this.mPosition.z+=this.mLinearVelocity.z*n,this.mAABBNeedsUpdate=!0,this.mTransformedVerticesNeedsUpdate=!0}}},{key:"move",value:function(e){(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&this.mPrevPosition.copy(this.mPosition),this.mPosition.add(e),this.mAABBNeedsUpdate=!0,this.mTransformedVerticesNeedsUpdate=!0}},{key:"getPosition",value:function(){return this.mPosition}},{key:"setPosition",value:function(e){(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&this.mPrevPosition.copy(this.mPosition),this.mPosition.copy(e),this.mAABBNeedsUpdate=!0,this.mTransformedVerticesNeedsUpdate=!0}},{key:"getQuaternion",value:function(){return this.mQuaternion}},{key:"setQuaternion",value:function(e){(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&this.mPrevQuaternion.copy(this.mQuaternion),this.mQuaternion.copy(e),this.mAABBNeedsUpdate=!0,this.mTransformedVerticesNeedsUpdate=!0}},{key:"getOffset",value:function(){return this.mOffset}},{key:"setOffset",value:function(e){this.mOffset.copy(e)}},{key:"getOffsetRotation",value:function(){return this.mOffsetRotation}},{key:"setOffsetRotation",value:function(e){this.mOffsetRotation.copy(e)}},{key:"getLinearVelocity",value:function(){return this.mLinearVelocity}},{key:"setLinearVelocity",value:function(e){this.mLinearVelocity.copy(e)}},{key:"getAngularVelocity",value:function(){return this.mAngularVelocity}},{key:"setAngularVelocity",value:function(e){this.mAngularVelocity.copy(e)}},{key:"aabbNeedsUpdate",get:function(){return this.mAABBNeedsUpdate}},{key:"getAABB",value:function(){return this.mAABB}},{key:"updateAABB",value:function(){this.mShape.aabbNeedsUpdate&&this.mShape.updateAABB(),this.mAABB.copy(this.mShape.getAABB()),this.mAABB.applyMatrix4((new ie.k).makeRotationFromQuaternion(this.mQuaternion)),this.mAABB.translate(this.mPosition),this.mAABBNeedsUpdate=!1}},{key:"getTransformedVertices",value:function(){return this.mTransformedVerticesNeedsUpdate&&this.updateTransformedVertices(),this.mTransformedVertices}},{key:"updateTransformedVertices",value:function(){this.mTransformedVertices.splice(0),uM.createTransformVertices(this.mShape.getVertices(),new ee.I(this.mPosition.x,this.mPosition.z),this.mQuaternion,this.mTransformedVertices),this.mTransformedVerticesNeedsUpdate=!1}},{key:"getIgnoreSync",value:function(){return this.mIgnoreSync}},{key:"setIgnoreSync",value:function(e){this.mIgnoreSync=e}},{key:"dispose",value:function(){this.mShape.dispose()}},{key:"getAngularDamping",value:function(){return 0}},{key:"getLinearDamping",value:function(){return 0}},{key:"setLinearDamping",value:function(e){}},{key:"getMass",value:function(){return 0}},{key:"setMass",value:function(e){}},{key:"needsUpdate",get:function(){return!1}},{key:"setAngularDamping",value:function(e){}},{key:"updateProperties",value:function(){}}])}(dn.p);(0,c.A)(pM,"TypeRTTI",new le.O("Body",dn.p.TypeRTTI));var dM=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mType",void 0),(0,c.A)(this,"mAABB",new Os.N),(0,c.A)(this,"mAABBNeedsUpdate",!0),(0,c.A)(this,"mVertices",[]),(0,c.A)(this,"mVerticesNeedsUpdate",!0),this.mType=t}),[{key:"getShapeType",value:function(){return this.mType}},{key:"getAABB",value:function(){return this.mAABB}},{key:"aabbNeedsUpdate",get:function(){return this.mAABBNeedsUpdate}},{key:"verticesNeedsUpdate",get:function(){return this.mVerticesNeedsUpdate}},{key:"getVertices",value:function(){return this.verticesNeedsUpdate&&this.updateVertices(),this.mVertices}},{key:"dispose",value:function(){}}])}();function vM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vM=function(){return!!e})()}var yM=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[cM.B.Box],i=(0,oe.A)(i),n=(0,ae.A)(r,vM()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mSize",new te.P(1,1,1)),n.mSize.copy(e),n.updateAABB(),n.updateVertices(),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"updateAABB",value:function(){this.mAABB.min.set(-.5*this.mSize.x,-.5*this.mSize.y,-.5*this.mSize.z),this.mAABB.max.set(.5*this.mSize.x,.5*this.mSize.y,.5*this.mSize.z),this.mAABBNeedsUpdate=!1}},{key:"getSize",value:function(){return this.mSize}},{key:"setSize",value:function(e){this.mSize.copy(e),this.mAABBNeedsUpdate=!0,this.mVerticesNeedsUpdate=!0}},{key:"getWidth",value:function(){return this.mSize.x}},{key:"setWidth",value:function(e){this.mSize.x=e,this.mAABBNeedsUpdate=!0,this.mVerticesNeedsUpdate=!0}},{key:"getHeight",value:function(){return this.mSize.y}},{key:"setHeight",value:function(e){this.mSize.y=e,this.mAABBNeedsUpdate=!0,this.mVerticesNeedsUpdate=!0}},{key:"getDepth",value:function(){return this.mSize.z}},{key:"setDepth",value:function(e){this.mSize.z=e,this.mAABBNeedsUpdate=!0,this.mVerticesNeedsUpdate=!0}},{key:"updateVertices",value:function(){this.mVertices.splice(0),uM.createBoxVertices(this.mSize.x,this.mSize.z,this.mVertices),this.mVerticesNeedsUpdate=!1}}])}(dM);function gM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gM=function(){return!!e})()}var bM=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[cM.B.Sphere],i=(0,oe.A)(i),n=(0,ae.A)(r,gM()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mRadius",.5),n.mRadius=e,n.updateAABB(),n.updateVertices(),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"updateAABB",value:function(){var e=this.getRadius();this.mAABB.min.set(-e,-e,-e),this.mAABB.max.set(e,e,e),this.mAABBNeedsUpdate=!1}},{key:"getRadius",value:function(){return this.mRadius}},{key:"setRadius",value:function(e){this.mRadius=e,this.mAABBNeedsUpdate=!0,this.mVerticesNeedsUpdate=!0}},{key:"updateVertices",value:function(){this.mVerticesNeedsUpdate=!1}}])}(dM),AM=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"bodies",[]),(0,c.A)(this,"broadPhase",new hM),(0,c.A)(this,"narrowPhase",new lM),(0,c.A)(this,"solver",new fM),(0,c.A)(this,"maxSteps",240),(0,c.A)(this,"pair1",[]),(0,c.A)(this,"pair2",[]),(0,c.A)(this,"contactPoints",[]),this.maxSteps=t}),[{key:"addBody",value:function(e){this.bodies.push(e)}},{key:"removeBody",value:function(e){var t=this.bodies.findIndex((function(t){return t===e}));t>=0&&this.bodies.splice(t,1)}},{key:"createBody",value:function(e,t){return new pM(e,t)}},{key:"createBox",value:function(e){return new yM(e)}},{key:"createSphere",value:function(e){return new bM(e)}},{key:"getBodies",value:function(){return this.bodies}},{key:"step",value:function(e,t){for(var n=Math.max(1,Math.min(t,this.maxSteps)),r=0;r<n;r++){for(var i=0;i<this.bodies.length;i++)this.bodies[i].step(e,this.maxSteps);this.contactPoints.length=0,this.pair1.length=0,this.pair2.length=0,this.broadPhase.getCollisions(this,this.pair1,this.pair2),0!==this.pair1.length&&(this.narrowPhase.collide(this.pair1,this.pair2,this.contactPoints),0!==this.contactPoints.length&&this.solver.solve(this,e,this.maxSteps,this.contactPoints))}}},{key:"dispose",value:function(){for(var e=0;e<this.bodies.length;e++)this.bodies[e].dispose();this.bodies.splice(0),this.pair1.length=0,this.pair2.length=0,this.contactPoints.length=0}}])}();function _M(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_M=function(){return!!e})()}var MM=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,oe.A)(a),r=(0,ae.A)(i,_M()?Reflect.construct(a,o||[],(0,oe.A)(i).constructor):a.apply(i,o)),(0,c.A)(r,"mBody",void 0),(0,c.A)(r,"mShape",void 0),(0,c.A)(r,"mOffset",new te.P(0,0,0)),(0,c.A)(r,"mOffsetRotation",ne.P.identity()),(0,c.A)(r,"mBodyType",Ks.k.Kinematic),(0,c.A)(r,"mNeedsUpdate",!1),(0,c.A)(r,"mContactInfo",void 0),(0,c.A)(r,"mIgnoreSync",!1),(0,c.A)(r,"mAABB",new Os.N),(0,c.A)(r,"mAABBNeedsUpdate",!0),r.mShape=e,r.mBodyType=n,r.mBody=new CANNON.Body({shape:r.mShape.getInternal(),position:new CANNON.Vec3(0,0,0),quaternion:new CANNON.Quaternion(0,0,0,1),type:r.resolveBodyType(r.mBodyType),mass:0,allowSleep:!1}),r.mBody.addEventListener("collide",r.onCollisionEvent.bind(r)),r.updateAABB(),r}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"onCollisionEvent",value:function(e){if("collide"===e.type){var t=e.body,n=e.contact,r=e.target;if(t===this.mBody||r===this.mBody){var i=this.mBody===n.bi?n.bi:n.bj,a=this.mBody===n.bi?n.ri:n.rj,o=new te.P(i.position.x,i.position.y,i.position.z),s=new te.P(a.x,a.y,a.z),u=o.clone().add(s),c=new sM;c.body1=this,c.normal.set(n.ni.x,n.ni.y,n.ni.z),c.contact1.copy(u),c.separation=0,this.mContactInfo=c}}}},{key:"getPosition",value:function(){return new te.P(this.mBody.position.x,this.mBody.position.y,this.mBody.position.z)}},{key:"setPosition",value:function(e){this.mBody.position.set(e.x,e.y,e.z)}},{key:"getOffset",value:function(){return this.mOffset}},{key:"setOffset",value:function(e){this.mOffset.copy(e)}},{key:"getQuaternion",value:function(){return new ne.P(this.mBody.quaternion.x,this.mBody.quaternion.y,this.mBody.quaternion.z,this.mBody.quaternion.w)}},{key:"setQuaternion",value:function(e){this.mBody.quaternion.set(e.x,e.y,e.z,e.w)}},{key:"getOffsetRotation",value:function(){return this.mOffsetRotation}},{key:"setOffsetRotation",value:function(e){this.mOffsetRotation.copy(e)}},{key:"updateProperties",value:function(){this.mShape.updateProperties(),this.mBody.updateMassProperties(),this.mBody.updateBoundingRadius(),this.mNeedsUpdate=!1}},{key:"resolveBodyType",value:function(e){switch(e){case Ks.k.Dynamic:return CANNON.Body.DYNAMIC;case Ks.k.Static:return CANNON.Body.STATIC;case Ks.k.Kinematic:return CANNON.Body.KINEMATIC;default:throw new Error("Unknown body type!")}}},{key:"getMass",value:function(){return this.mBody.mass}},{key:"setMass",value:function(e){this.mBody.mass=e,this.mNeedsUpdate=!0}},{key:"isTrigger",value:function(){return this.mBody.isTrigger}},{key:"setIsTrigger",value:function(e){this.mBody.isTrigger=e}},{key:"getLinearVelocity",value:function(){return new te.P(this.mBody.velocity.x,this.mBody.velocity.y,this.mBody.velocity.z)}},{key:"setLinearVelocity",value:function(e){this.mBody.velocity.set(e.x,e.y,e.z)}},{key:"getAngularVelocity",value:function(){return(new ne.P).setFromEuler(new re.O(this.mBody.angularVelocity.x,this.mBody.angularVelocity.y,this.mBody.angularVelocity.z))}},{key:"setAngularVelocity",value:function(e){var t=(new re.O).setFromQuaternion(e);this.mBody.angularVelocity.set(t.x,t.y,t.z)}},{key:"getLinearDamping",value:function(){return this.mBody.linearDamping}},{key:"setLinearDamping",value:function(e){this.mBody.linearDamping=e}},{key:"getAngularDamping",value:function(){return this.mBody.angularDamping}},{key:"setAngularDamping",value:function(e){this.mBody.angularDamping=e}},{key:"getBodyType",value:function(){return this.mBodyType}},{key:"setBodyType",value:function(e){this.mBodyType=e,this.mBody.type=this.resolveBodyType(this.mBodyType),this.mNeedsUpdate=!0}},{key:"getIgnoreSync",value:function(){return this.mIgnoreSync}},{key:"setIgnoreSync",value:function(e){this.mIgnoreSync=e}},{key:"getShape",value:function(){return this.mShape}},{key:"getContactInfo",value:function(){return this.mContactInfo}},{key:"removeContactInfo",value:function(){this.mContactInfo&&delete this.mContactInfo}},{key:"needsUpdate",get:function(){return this.mNeedsUpdate||this.mShape.needsUpdate}},{key:"dispose",value:function(){this.mBody.removeEventListener("collide",this.onCollisionEvent.bind(this)),this.mShape.dispose()}},{key:"getInternal",value:function(){return this.mBody}},{key:"getAABB",value:function(){return this.mAABB}},{key:"aabbNeedsUpdate",get:function(){return this.mAABBNeedsUpdate}},{key:"updateAABB",value:function(){this.mShape.aabbNeedsUpdate&&this.mShape.updateAABB();var e=this.getPosition(),t=this.getQuaternion();this.mAABB.copy(this.mShape.getAABB()),this.mAABB.applyMatrix4((new ie.k).makeRotationFromQuaternion(t)),this.mAABB.translate(e),this.mAABBNeedsUpdate=!1}}])}(dn.p);(0,c.A)(MM,"TypeRTTI",new le.O("Body",dn.p.TypeRTTI));var kM=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,c.A)(this,"mType",void 0),(0,c.A)(this,"mAABB",new Os.N),(0,c.A)(this,"mAABBNeedsUpdate",!0),(0,c.A)(this,"mNeedsUpdate",!1),this.mType=t}),[{key:"getShapeType",value:function(){return this.mType}},{key:"updateProperties",value:function(){this.mNeedsUpdate=!1}},{key:"needsUpdate",get:function(){return this.mNeedsUpdate}},{key:"aabbNeedsUpdate",get:function(){return this.mAABBNeedsUpdate}},{key:"getAABB",value:function(){return this.mAABB}},{key:"dispose",value:function(){}}])}();function wM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wM=function(){return!!e})()}var TM=function(e){function t(){var e,n,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return(0,s.A)(this,t),n=this,r=t,i=[cM.B.Sphere],r=(0,oe.A)(r),e=(0,ae.A)(n,wM()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mShape",void 0),e.mShape=new CANNON.Sphere(a),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"getRadius",value:function(){return this.mShape.radius}},{key:"setRadius",value:function(e){this.mShape.radius=e,this.mNeedsUpdate=!0}},{key:"updateAABB",value:function(){var e=this.getRadius();this.mAABB.min.set(-e,-e,-e),this.mAABB.max.set(e,e,e),this.mAABBNeedsUpdate=!1}},{key:"getInternal",value:function(){return this.mShape}}])}(kM);function xM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xM=function(){return!!e})()}var SM,CM,EM=function(e){function t(e){var n,r,i,a;return(0,s.A)(this,t),r=this,i=t,a=[cM.B.Box],i=(0,oe.A)(i),n=(0,ae.A)(r,xM()?Reflect.construct(i,a||[],(0,oe.A)(r).constructor):i.apply(r,a)),(0,c.A)(n,"mShape",void 0),(0,c.A)(n,"mSize",new te.P(1,1,1)),n.mSize.copy(e),n.mShape=new CANNON.Box(new CANNON.Vec3(.5*e.x,.5*e.y,.5*e.z)),n}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"updateProperties",value:function(){var e,n,r,i,a;(e=t,n="updateProperties",r=this,i=3,a=(0,se.A)((0,oe.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.mShape.updateConvexPolyhedronRepresentation()}},{key:"getSize",value:function(){return this.mSize}},{key:"setSize",value:function(e){this.mSize.copy(e),this.mShape.halfExtents.set(.5*e.x,.5*e.y,.5*e.z),this.mNeedsUpdate=!0}},{key:"getWidth",value:function(){return this.mSize.x}},{key:"setWidth",value:function(e){this.mSize.x=e,this.mShape.halfExtents.x=.5*e,this.mNeedsUpdate=!0}},{key:"getHeight",value:function(){return this.mSize.y}},{key:"setHeight",value:function(e){this.mSize.y=e,this.mShape.halfExtents.y=.5*e,this.mNeedsUpdate=!0}},{key:"getDepth",value:function(){return this.mSize.z}},{key:"setDepth",value:function(e){this.mSize.z=e,this.mShape.halfExtents.z=.5*e,this.mNeedsUpdate=!0}},{key:"updateAABB",value:function(){this.mAABB.min.set(-.5*this.mSize.x,-.5*this.mSize.y,-.5*this.mSize.z),this.mAABB.max.set(.5*this.mSize.x,.5*this.mSize.y,.5*this.mSize.z),this.mAABBNeedsUpdate=!1}},{key:"getInternal",value:function(){return this.mShape}}])}(kM),RM=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"mWorld",void 0),(0,c.A)(this,"mGravity",void 0),(0,c.A)(this,"mDebug",!1),(0,c.A)(this,"onBeginContact$",new M.B),(0,c.A)(this,"onEndContact$",new M.B),(0,c.A)(this,"mBodies",[]),this.mGravity=new te.P(0,0,0),this.mWorld=new CANNON.World({allowSleep:!1,broadphase:new CANNON.NaiveBroadphase,solver:new CANNON.GSSolver,gravity:new CANNON.Vec3(this.mGravity.x,this.mGravity.y,this.mGravity.z)}),this.mWorld.solver.iterations=10,this.mWorld.defaultContactMaterial.contactEquationStiffness=1e9,this.mWorld.defaultContactMaterial.contactEquationRelaxation=10,this.mWorld.addEventListener("beginContact",this.onBeginContactEvent.bind(this)),this.mWorld.addEventListener("endContact",this.onEndContactEvent.bind(this))}),[{key:"createBody",value:function(e,t){return new MM(e,t)}},{key:"createSphere",value:function(e){return new TM(e)}},{key:"createBox",value:function(e){return new EM(e)}},{key:"step",value:function(e,t){for(var n=0;n<this.mBodies.length;n++){var r=this.mBodies[n];r.needsUpdate&&r.updateProperties()}this.mWorld.fixedStep(e,t)}},{key:"getBodies",value:function(){return this.mBodies}},{key:"addBody",value:function(e){this.mBodies.push(e),this.mWorld.addBody(e.getInternal())}},{key:"removeBody",value:function(e){var t=this.mBodies.findIndex((function(t){return t===e}));t>=0&&this.mBodies.splice(t,1),this.mWorld.removeBody(e.getInternal())}},{key:"onBeginContactEvent",value:function(e){this.onBeginContact$.next(e)}},{key:"onEndContactEvent",value:function(e){this.onEndContact$.next(e)}},{key:"setDebugMode",value:function(e){this.mDebug=e}},{key:"dispose",value:function(){this.mWorld.removeEventListener("beginContact",this.onBeginContactEvent.bind(this)),this.mWorld.removeEventListener("endContact",this.onEndContactEvent.bind(this))}}])}(),IM=function(){function e(){(0,s.A)(this,e),(0,c.A)(this,"mWorld",void 0),(0,c.A)(this,"mMeshMap",{}),(0,c.A)(this,"mShowHelpers",!1),(0,c.A)(this,"mSubscriptions",[])}return(0,u.A)(e,[{key:"createWorld",value:function(e,t){switch(e){case Y_.Realtime2d:this.mWorld=new AM(t);break;case Y_.Realtime3d:this.mWorld=new RM;break;default:throw new Error("Unable to create world using unknown physics system type.")}this.mMeshMap={}}},{key:"step",value:function(e,t){this.mWorld.step(e,t)}},{key:"registerMesh",value:function(e,t){var n=e.getSceneObjectId();this.mMeshMap[n]||(this.mMeshMap[n]={sceneObject:e,body:t},this.mWorld.addBody(this.mMeshMap[n].body),v.UX.print("PhysicsSystem: Mesh registered:",e,t))}},{key:"unregisterMesh",value:function(e){this.mMeshMap[e]&&(this.mWorld.removeBody(this.mMeshMap[e].body),delete this.mMeshMap[e],v.UX.print("PhysicsSystem: Mesh unregistered:",e))}},{key:"syncTransforms",value:function(){var t=this;Object.keys(this.mMeshMap).forEach((function(n){var r=Number(n),i=t.mMeshMap[r],a=i.body,o=i.sceneObject;o.updateMatrixLocal(),o.updateMatrixWorld();var s=e.WorldMatrix.compose(a.getOffset(),a.getOffsetRotation(),te.P.One());o.transform.matrixWorld.clone().multiply(s).decompose(e.WorldPosition,e.WorldQuaternion,e.WorldScale),a.setPosition(e.WorldPosition),a.setQuaternion(e.WorldQuaternion)}))}},{key:"syncMeshes",value:function(){var t=this;Object.keys(this.mMeshMap).forEach((function(n){var r=Number(n),i=t.mMeshMap[r],a=i.body,o=i.sceneObject;if(!a.getIgnoreSync()){var s=a.getPosition(),u=a.getQuaternion();o.transform.getWorldScale(e.WorldScale),e.WorldMatrix.compose(s,u,e.WorldScale);var c=(new ie.k).compose(a.getOffset().clone().negate(),a.getOffsetRotation().clone().invert(),te.P.One());e.WorldMatrix.multiply(c);var l=o.getParent();if(l){var h=l.transform.matrixWorld;e.WorldMatrix.copy(h.clone().invert().multiply(e.WorldMatrix)),e.WorldMatrix.decompose(o.transform.position,o.transform.quaternion,e.WorldScale)}else o.transform.position.copy(s),o.transform.quaternion.copy(u)}}))}},{key:"dispose",value:function(){var e=this;this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mWorld&&(Object.keys(this.mMeshMap).forEach((function(t){var n=Number(t);e.mWorld.removeBody(e.mMeshMap[n].body)})),this.mMeshMap={},this.mWorld.dispose(),delete this.mWorld)}},{key:"getWorld",value:function(){return this.mWorld}},{key:"showHelpers",value:function(){return this.mShowHelpers}},{key:"setShowHelpers",value:function(e){this.mShowHelpers=e}}],[{key:"install",value:(t=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,__webpack_require__.e(547).then(__webpack_require__.bind(__webpack_require__,64236));case 2:window.CANNON=e.sent;case 3:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}]);var t}();(0,c.A)(IM,"WorldMatrix",new ie.k),(0,c.A)(IM,"WorldPosition",new te.P),(0,c.A)(IM,"WorldQuaternion",new ne.P),(0,c.A)(IM,"WorldScale",te.P.One()),(CM=SM||(SM={})).Active="active",CM.Inactive="inactive";var OM=function(){return(0,u.A)((function e(){(0,s.A)(this,e),(0,c.A)(this,"productId",-1),(0,c.A)(this,"temporaryProductId",void 0),(0,c.A)(this,"preConfiguration",void 0),(0,c.A)(this,"presetIdentifier",void 0),(0,c.A)(this,"presetModel",void 0),(0,c.A)(this,"_bundleUuid",f.V.guid())}),[{key:"hasPreset",get:function(){return(0,h.uI)(this.presetIdentifier)}},{key:"presetLoaded",get:function(){return!this.hasPreset||!!this.presetModel}},{key:"presetValid",get:function(){var e;return!this.hasPreset||this.productId===(null===(e=this.presetModel)||void 0===e?void 0:e.catalogue_id)}},{key:"configuration",get:function(){var e,t;return this.preConfiguration?this.preConfiguration:(null===(e=this.presetModel)||void 0===e?void 0:e.status)===SM.Active&&null!==(t=this.presetModel)&&void 0!==t&&t.configuration?this.presetModel.configuration:void 0}},{key:"bundleUuid",get:function(){var e,t;return null!==(e=null===(t=this.configuration)||void 0===t?void 0:t.bundle_uuid)&&void 0!==e?e:this._bundleUuid}},{key:"isBundledConfiguration",get:function(){var e;return(null===(e=this.configuration)||void 0===e?void 0:e.configured_products.length)>1}},{key:"fetchPreset",value:(e=(0,n.A)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,el.getInstance().find(this.presetIdentifier);case 2:if(t=e.sent,-1===this.productId||t.catalogue_id===this.productId){e.next=6;break}return delete this.presetIdentifier,e.abrupt("return");case 6:this.presetModel=t,this.productId=Number(this.presetModel.catalogue_id);case 8:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})}]);var e}(),DM=function(){return(0,u.A)((function e(){(0,s.A)(this,e)}),[{key:"load",value:function(e){e.status!==SM.Inactive&&((new A).sanitizeConfiguration(e.configuration),this.loadCategoryConstraints(e),this.loadProductConstraints(e))}},{key:"loadCategoryConstraints",value:function(e){var t;if(null!==(t=e.constraints)&&void 0!==t&&t.categories){var n=R.K.constraintSystem().getSystem($c.Category);e.constraints.categories.forEach((function(e){n.registerConstraint(e.id,{id:e.id,type:$c.Category,locked:!0})}))}}},{key:"loadProductConstraints",value:function(e){var t;if(null!==(t=e.constraints)&&void 0!==t&&t.configured_products){var n=new Uint32Array(e.constraints.configured_products.length);window.crypto.getRandomValues(n),e.constraints.configured_products.forEach((function(t){var n=e.configuration.configured_products.find((function(e){return e.id===t.id}));if(n){var r=R.K.constraintSystem().getSystem($c.Product),i=R.K.constraintSystem().getSystem($c.Attribute),a=R.K.constraintSystem().getSystem($c.AttributeValue);r.registerConstraint(n.catalogue_id,{id:n.catalogue_id,type:$c.Product,locked:t.locked},n.uuid),t.attributes.forEach((function(e){i.registerConstraint(e.id,{id:e.id,type:$c.Attribute,locked:!1},n.uuid),e.attribute_values.forEach((function(e){var t,r,i,o,s,u=null!==(t=null!==(r=null===(i=e.value)||void 0===i?void 0:i.attribute_value_id)&&void 0!==r?r:null===(o=e.value)||void 0===o?void 0:o.value)&&void 0!==t?t:null===(s=e.value)||void 0===s?void 0:s.material_id;u&&a.registerConstraint(e.id,u,{id:e.id,type:$c.AttributeValue,locked:e.locked},n.uuid)}))}))}}))}}}])}(),PM=(0,u.A)((function e(){(0,s.A)(this,e)}));function BM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(BM=function(){return!!e})()}var FM=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,BM()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mStaticConstraints",new Map),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"isLocked",value:function(e){var t;return!(null===(t=this.getConstraint(e))||void 0===t||!t.locked)}},{key:"registerConstraint",value:function(e,t){this.mStaticConstraints.has(e)||this.mStaticConstraints.set(e,t)}},{key:"unregisterConstraint",value:function(e){this.mStaticConstraints.has(e)&&this.mStaticConstraints.delete(e)}},{key:"dispose",value:function(){this.mStaticConstraints.clear()}},{key:"getConstraint",value:function(e){return this.mStaticConstraints.get(e)}}])}(PM);function NM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(NM=function(){return!!e})()}var LM=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,NM()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mStaticConstraints",new Map),(0,c.A)(e,"mInstancedConstraints",new Map),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"isLocked",value:function(e,t){var n;return!(null===(n=this.getConstraint(e,t))||void 0===n||!n.locked)}},{key:"registerConstraint",value:function(e,t,n){if(n)return this.mInstancedConstraints.has(n)||this.mInstancedConstraints.set(n,new Map),void(this.mInstancedConstraints.get(n).has(e)||this.mInstancedConstraints.get(n).set(e,t));this.mStaticConstraints.has(e)||this.mStaticConstraints.set(e,t)}},{key:"unregisterConstraint",value:function(e,t){t?this.mInstancedConstraints.has(t)&&this.mInstancedConstraints.get(t).has(e)&&this.mInstancedConstraints.get(t).delete(e):this.mStaticConstraints.has(e)&&this.mStaticConstraints.delete(e)}},{key:"dispose",value:function(){this.mStaticConstraints.clear(),this.mInstancedConstraints.clear()}},{key:"getConstraint",value:function(e,t){if(t){var n,r=null===(n=this.mInstancedConstraints.get(t))||void 0===n?void 0:n.get(e);if(r)return r}return this.mStaticConstraints.get(e)}}])}(PM);function jM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jM=function(){return!!e})()}var UM=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,jM()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mStaticConstraints",new Map),(0,c.A)(e,"mInstancedConstraints",new Map),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"isLocked",value:function(e,t){var n;return!(null===(n=this.getConstraint(e,t))||void 0===n||!n.locked)}},{key:"registerConstraint",value:function(e,t,n){if(n)return this.mInstancedConstraints.has(n)||this.mInstancedConstraints.set(n,new Map),void(this.mInstancedConstraints.get(n).has(e)||this.mInstancedConstraints.get(n).set(e,t));this.mStaticConstraints.has(e)||this.mStaticConstraints.set(e,t)}},{key:"unregisterConstraint",value:function(e,t){t?this.mInstancedConstraints.has(t)&&this.mInstancedConstraints.get(t).has(e)&&this.mInstancedConstraints.get(t).delete(e):this.mStaticConstraints.has(e)&&this.mStaticConstraints.delete(e)}},{key:"dispose",value:function(){this.mStaticConstraints.clear(),this.mInstancedConstraints.clear()}},{key:"getConstraint",value:function(e,t){if(t){var n,r=null===(n=this.mInstancedConstraints.get(t))||void 0===n?void 0:n.get(e);if(r)return r}return this.mStaticConstraints.get(e)}}])}(PM);function VM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(VM=function(){return!!e})()}var zM=function(e){function t(){var e,n,r,i;(0,s.A)(this,t);for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return n=this,r=t,i=[].concat(o),r=(0,oe.A)(r),e=(0,ae.A)(n,VM()?Reflect.construct(r,i||[],(0,oe.A)(n).constructor):r.apply(n,i)),(0,c.A)(e,"mStaticConstraints",new Map),(0,c.A)(e,"mInstancedConstraints",new Map),e}return(0,ue.A)(t,e),(0,u.A)(t,[{key:"isLocked",value:function(e,t,n){var r;return!(null===(r=this.getConstraint(e,t,n))||void 0===r||!r.locked)}},{key:"registerConstraint",value:function(e,t,n,r){if(r)return this.mInstancedConstraints.has(r)||this.mInstancedConstraints.set(r,new Map),this.mInstancedConstraints.get(r).has(e)||this.mInstancedConstraints.get(r).set(e,new Map),void(this.mInstancedConstraints.get(r).get(e).has(t)||this.mInstancedConstraints.get(r).get(e).set(t,n));this.mStaticConstraints.has(e)||this.mStaticConstraints.set(e,new Map),this.mStaticConstraints.get(e).has(t)||this.mStaticConstraints.get(e).set(t,n)}},{key:"unregisterConstraint",value:function(e,t,n){n?this.mInstancedConstraints.has(n)&&this.mInstancedConstraints.get(n).has(e)&&this.mInstancedConstraints.get(n).get(e).has(t)&&this.mInstancedConstraints.get(n).get(e).delete(t):this.mStaticConstraints.has(e)&&this.mStaticConstraints.get(e).has(t)&&this.mStaticConstraints.get(e).delete(e)}},{key:"dispose",value:function(){this.mStaticConstraints.clear(),this.mInstancedConstraints.clear()}},{key:"getConstraint",value:function(e,t,n){var r;if(n){var i,a=null===(i=this.mInstancedConstraints.get(n))||void 0===i||null===(i=i.get(e))||void 0===i?void 0:i.get(t);if(a)return a}return null===(r=this.mStaticConstraints.get(e))||void 0===r?void 0:r.get(t)}}])}(PM);function HM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function GM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?HM(Object(n),!0).forEach((function(t){(0,c.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HM(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qM,WM=function(){return(0,u.A)((function e(t,n){var r,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,s.A)(this,e),(0,c.A)(this,"mViewerComponent",void 0),(0,c.A)(this,"mCommunicationLayer",void 0),(0,c.A)(this,"mViewContainer",void 0),(0,c.A)(this,"mViewerCanvas",void 0),(0,c.A)(this,"mUiContainer",void 0),(0,c.A)(this,"mViewLayout",void 0),(0,c.A)(this,"mViewWrapper",void 0),(0,c.A)(this,"mViewRenderWrapper",void 0),(0,c.A)(this,"mOptions",void 0),(0,c.A)(this,"mInitialized",!1),(0,c.A)(this,"mEditInitHash",0),(0,c.A)(this,"mBlockOptionBuild",!1),(0,c.A)(this,"mContainerWidth",0),(0,c.A)(this,"mContainerHeight",0),(0,c.A)(this,"mContainerObserver",void 0),(0,c.A)(this,"mRotationActive",!1),(0,c.A)(this,"mRotatingObjects",[]),(0,c.A)(this,"mServices",new Map),(0,c.A)(this,"mSelectedProduct",void 0),(0,c.A)(this,"mSubscriptions",[]),(0,c.A)(this,"mEventBrokerSubscriptions",[]),(0,c.A)(this,"mProductOptionChangedSubject",new M.B),(0,c.A)(this,"mWindowResizeContext",void 0),(0,c.A)(this,"mPresetState",void 0),J.k.getInstance().setToken(window.expivi.apiToken),a.language&&J.k.getInstance().setAcceptLanguage(a.language),a.country&&J.k.getInstance().setCountry(a.country),a.currency&&J.k.getInstance().setCurrency(a.currency),this.mOptions=GM({show360Indicator:!0,showProgress:!0,blockDefaultTouch:!0},a),this.mPresetState=new OM,this.mPresetState.productId=null!==(r=h.N5.resolveInt(t))&&void 0!==r?r:-1,this.mPresetState.presetIdentifier=this.mOptions.preset,this.mPresetState.temporaryProductId=this.mOptions.temporaryProductId||void 0,this.mPresetState.preConfiguration=this.mOptions.configuredProduct||void 0,this.mViewContainer=p.selectDom(n),this.mViewLayout=p.createElement("div"),this.mViewWrapper=p.createElement("div"),this.mContainerWidth=this.mViewContainer.offsetWidth,this.mContainerHeight=this.mViewContainer.offsetHeight,p.setStyle(this.mViewLayout,{overflow:"hidden",width:"100%",height:"auto","min-height":"100%",position:"relative"}),this.mViewContainer.appendChild(this.mViewLayout),p.setStyle(this.mViewWrapper,{width:"".concat(this.mContainerWidth,"px"),height:"".concat(this.mContainerHeight,"px"),position:"absolute",left:"0",top:"0"}),this.mViewLayout.appendChild(this.mViewWrapper),this.mViewRenderWrapper=p.createElement("div"),p.setStyle(this.mViewRenderWrapper,{width:"100%",height:"100%",margin:"0",padding:"0",position:"relative"}),this.mViewWrapper.appendChild(this.mViewRenderWrapper),!1===this.mOptions.blockDefaultTouch&&R.K.stateRegistery().dispatch(X.V.UNBLOCK_DEFAULT_TOUCH,!0),this.mViewerCanvas=document.createElement("canvas"),this.mUiContainer=document.createElement("div"),this.mViewerComponent=new rc(this.mViewRenderWrapper,this.mViewerCanvas,this.mUiContainer,this.mOptions),this.mCommunicationLayer=new nl(this),this.mProductOptionChangedSubject.pipe((0,k.M)((function(e){i.propagateEvent("attribute",e.getData())})),(0,w.p)((function(){return!i.mBlockOptionBuild})),(0,k.M)((function(e){return e.getData().rebuild&&R.K.eventBus().disableTopic(K.r.getTopicName(Q.E.RequestFrame)),e})),C(100)).subscribe((function(e){i.updateOptions(e.getData())})),this.mWindowResizeContext=this.onWindowResized.bind(this,!0)}),[{key:"init",value:(B=(0,n.A)(i().mark((function e(){var t,n,r,a,o,s,u,c,l,h,f,d=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mInitialized=!1,this.mEditInitHash=1,void 0!==window.MutationObserver&&(this.mContainerObserver=new MutationObserver(this.mWindowResizeContext),this.mContainerObserver.observe(this.mViewContainer,{attributes:!0,childList:!1,characterData:!0,subtree:!1})),p.on(this.mViewerCanvas,"mousedown",(function(e){return d.handleViewMouseDown(e)})),p.on(this.mViewerCanvas,"touchstart",(function(e){return d.handleViewMouseDown(e)})),-1!==this.mPresetState.productId||!this.mPresetState.hasPreset||this.mPresetState.presetLoaded){e.next=8;break}return e.next=8,this.mPresetState.fetchPreset();case 8:return t=new W,e.next=11,t.init(this.mPresetState.productId,this.mOptions.versionHash);case 11:(n=new aM).createSystem($c.Category,new FM),n.createSystem($c.Product,new LM),n.createSystem($c.Attribute,new UM),n.createSystem($c.AttributeValue,new zM),this.mViewerComponent.createViewLayers(t),this.mViewerComponent.registerInputEvents(),r=t.getSettings().getSceneSettings().renderer_type||"threejs",e.t0=r,e.next="babylonjs"===e.t0?22:(e.t0,26);break;case 22:return e.next=24,vb.loadScripts();case 24:return a=new vb(this.mViewerCanvas,this.mUiContainer,t.getSettings()),e.abrupt("break",31);case 26:return e.next=28,X_.loadScripts();case 28:return X_.installScripts(),a=new X_(this.mViewerCanvas,this.mUiContainer,t.getSettings()),e.abrupt("break",31);case 31:if(o=new D(a),s=new Nd,u=new F,!(l=t.getSettings().getSceneSettings()).physics.enabled){e.next=47;break}return e.next=38,IM.install();case 38:e.t1=l.physics.type,e.next="realtime3d"===e.t1?41:(e.t1,43);break;case 41:return h=Y_.Realtime3d,e.abrupt("break",45);case 43:return h=Y_.Realtime2d,e.abrupt("break",45);case 45:(c=new IM).createWorld(h,120);case 47:if(R.K.init(new oM,{settingsManager:t,renderer:o,sceneManager:s,commandManager:u,physicsSystem:c,constraintSystem:n}),this.mEventBrokerSubscriptions.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductStartLoading),(function(e){d.propagateEvent("product_start_loading",e)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductFinishedLoading),(function(e){d.propagateEvent("product_finished_loading",e)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductErrorLoading),(function(e){d.propagateEvent("product_error_loading",e)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.LoadConfigurationStarted),(function(){d.propagateEvent("load_configuration_started")})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.LoadConfigurationFinished),(function(){d.propagateEvent("load_configuration_finished")}))),s.createScene(),f=s.createObject("product",-1,this.mPresetState.productId,this.mPresetState.isBundledConfiguration),this.mPresetState.temporaryProductId&&f.setValue("temporary_uid",this.mPresetState.temporaryProductId),s.addNode(f,void 0,!1),s.setActiveProductNode(f),u.getExecStack().onHistoryChanged.subscribe((function(e){R.K.eventBus().dispatch(new K.r(Q.E.HistoryChanged,e))})),this.mCommunicationLayer.init(),this.mPresetState.presetLoaded){e.next=59;break}return e.next=59,this.mPresetState.fetchPreset();case 59:if(this.mPresetState.hasPreset&&this.mPresetState.presetLoaded&&this.mPresetState.presetValid&&(new DM).load(this.mPresetState.presetModel),1===this.mEditInitHash){e.next=62;break}throw new Error("App was destroyed before being initialized");case 62:return this.mEventBrokerSubscriptions.push(R.K.eventBus().subscribe(K.r.getTopicName(Q.E.BuildFinished),(function(){return d.propagateEvent("buildready")})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.BuildUpdated),(function(){return d.propagateEvent("buildupdated")})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.RequestFrame),(function(){return d.propagateEvent("frame")})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ObjectSelected),(function(e){var t=e.getData().selection;d.select(t,{},!1),d.propagateEvent("selected",e)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.SceneObjectAttached),(function(e){return d.propagateEvent("attached",e)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.SceneObjectDetached),(function(e){return d.propagateEvent("detached",e)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.WindowResized),(function(){return d.propagateEvent("size")})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductOptionChanged),(function(e){return d.mProductOptionChangedSubject.next(e)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductAttributeUpdated),(function(e){return d.propagateEvent("attribute_update",e.getData())})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductArticlesChanged),(function(e){return d.propagateEvent("article_change",e.getData())})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductAttributeModerated),(function(e){return d.propagateEvent("attribute_moderated",e.getData())})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductMaterialChanged),(function(e){return d.propagateEvent("material",e.getData())})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ProductMaterialVisibility),(function(e){return d.propagateEvent("materialvisibility",e.getData())})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.OffsetChanged),(function(e){return d.propagateEvent("offset",e.getData())})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.OffsetVisibility),(function(e){return d.propagateEvent("offsetvisibility",e.getData())})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ZoomChanged),(function(){return d.propagateEvent("zoom")})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.Warning),(function(e){return d.propagateEvent("alert",e.getData())})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.MediaDownload),(function(e){return d.propagateEvent("media_download",e.getData())})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.Shared),(function(e){return d.propagateEvent("shared",e.getData())})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.PlaySound),(function(e){return d.playSound(e)})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.ActiveViewChanged),(function(){R.K.eventBus().dispatch(new K.r(Q.E.BuildFinished))})),R.K.eventBus().subscribe(K.r.getTopicName(Q.E.BuildFullyLoaded),(function(){return d.propagateEvent("fully_loaded")})),R.K.messenger().listen(m.P9.TypeRTTI,(function(e){return d.propagateEvent("optionvisibility",e)})),R.K.messenger().listen(m.TD.TypeRTTI,(function(e){return d.setPriceVisibility(e)})),R.K.messenger().listen(m.BX.TypeRTTI,(function(e){d.propagateEvent("dropzone",{dropped:e.isDroppedInDropZone,data:e.data})}))),this.mViewerComponent.init(),window.addEventListener("resize",this.mWindowResizeContext,!1),R.K.eventBus().dispatch(new K.r(Q.E.Initialized)),this.mInitialized=!0,R.K.eventBus().dispatch(new K.r(Q.E.BuildStarted)),e.next=70,this.resolveConfigurableNode();case 70:this.propagateReady(),this.onWindowResized(!0);case 72:case"end":return e.stop()}}),e,this)}))),function(){return B.apply(this,arguments)})},{key:"destroy",value:function(){this.mEditInitHash=0,this.mInitialized=!1,p.off(this.mViewerCanvas,"mousedown"),p.off(this.mViewerCanvas,"touchstart"),window.removeEventListener("resize",this.mWindowResizeContext,!1),delete this.mWindowResizeContext,this.mContainerObserver&&(this.mContainerObserver.disconnect(),delete this.mContainerObserver),this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mViewerComponent.destroy(),Rt._.getInstance().resetCache(),Qa.m.getInstance().resetCache(),tn.u.getInstance().resetCache(),en.J.destroy(),R.K.dispose(),this.mViewerCanvas.remove(),this.mViewWrapper.remove(),this.mViewLayout.remove()}},{key:"handleViewMouseDown",value:function(e){var t=this,n=[];this.mRotatingObjects.forEach((function(e){e.stopOnInteraction&&n.push(e.id)}));for(var r=function(){var e=n.shift(),r=t.mRotatingObjects.findIndex((function(t){return t.id===e}));r>=0&&t.mRotatingObjects.splice(r,1)};n.length>0;)r()}},{key:"getClientViewer",value:function(){return this.mViewerComponent}},{key:"onClientReady",value:(P=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){t.mBlockOptionBuild=!0,R.K.stateRegistery().dispatch("reconfigure",!0),l.N.executeInOrder([t.loadConfiguredProduct.bind(t),t.reconfigureProduct.bind(t)],(function(n,r){t.mBlockOptionBuild=!1,R.K.stateRegistery().dispatch("reconfigure",!1),R.K.eventBus().dispatch(new K.r(Q.E.BuildUpdated)),R.K.eventBus().dispatch(new K.r(Q.E.BuildFinished)),e(0===r.length)}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return P.apply(this,arguments)})},{key:"loadConfiguration",value:(O=(0,n.A)(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mPresetState.preConfiguration=t,R.K.stateRegistery().dispatch("reconfigure",!0),R.K.eventBus().dispatch(new K.r(Q.E.LoadConfigurationStarted)),e.prev=3,n=this.loadConfiguredProduct()){e.next=7;break}throw new Error("Failed to parse configuration.");case 7:return e.next=9,this.reconfigureProduct();case 9:if(n=e.sent){e.next=12;break}throw new Error("Failed to load configuration.");case 12:return R.K.stateRegistery().dispatch("reconfigure",!1),R.K.eventBus().dispatch(new K.r(Q.E.LoadConfigurationFinished)),e.abrupt("return",n);case 17:throw e.prev=17,e.t0=e.catch(3),R.K.stateRegistery().dispatch("reconfigure",!1),R.K.eventBus().dispatch(new K.r(Q.E.LoadConfigurationFinished)),e.t0;case 22:case"end":return e.stop()}}),e,this,[[3,17]])}))),function(e){return O.apply(this,arguments)})},{key:"loadConfiguredProduct",value:function(){var e,t=this.mPresetState.configuration;if(!t)throw new Error("No reload request");if(null===(e=t.configured_products)||void 0===e||!e.length)return!0;if(!(0,o.A)(t.configured_products,1)[0].version)throw new Error("Could not recognize configured product data type: ".concat(JSON.stringify(t)));return(new A).sanitizeConfiguration(this.mPresetState.configuration),!0}},{key:"countItemsLoadHierarchy",value:function(e){return e.length+e.reduce((function(e,t){var n,r;return e+(null!==(n=null===(r=t.children)||void 0===r?void 0:r.length)&&void 0!==n?n:0)}),0)}},{key:"yieldOnActiveRootProductBuild",value:(I=(0,n.A)(i().mark((function e(){var t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=R.K.sceneManager().getRootProductNode(),n=t&&t.getComponent("productSceneLoaderComponent")){e.next=4;break}return e.abrupt("return",!1);case 4:return e.next=6,(0,y._)(n.loaderIdle().pipe((0,w.p)((function(e){return e}))));case 6:return e.abrupt("return",!0);case 7:case"end":return e.stop()}}),e)}))),function(){return I.apply(this,arguments)})},{key:"pushYieldOnActiveRootProductBuild",value:function(e){var t=this;e.push((0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.yieldOnActiveRootProductBuild());case 1:case"end":return e.stop()}}),e)}))))}},{key:"updateRootProductScene",value:(S=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return R.K.sceneManager().update(1/60),e.abrupt("return",this.yieldOnActiveRootProductBuild());case 2:case"end":return e.stop()}}),e,this)}))),function(){return S.apply(this,arguments)})},{key:"anyReferenceProductsInLoadHierarchy",value:function(e){var t=this;return!(!e||0===e.length)&&!e.every((function(e){return!(e.type===Y.REFERENCE_PRODUCT||t.anyReferenceProductsInLoadHierarchy(e.children))}))}},{key:"pushBuildSceneJobIfAnyReferenceProductsExists",value:function(e,t){var r=this;this.anyReferenceProductsInLoadHierarchy(t)&&e.push((0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.updateRootProductScene());case 1:case"end":return e.stop()}}),e)}))))}},{key:"getViewInProduct",value:function(e,t){if(!e)return R.K.sceneManager().getActiveView();var n=R.K.sceneManager().findNodesOfType(ss.TypeRTTI,(function(e){return!t||e.getViewId()===t}),e);return null==n?void 0:n[0]}},{key:"getViewOfProductUUID",value:function(e,t){var n=this.findProductNode(e)||R.K.sceneManager().getRootProductNode(),r=this.getViewInProduct(n,t);if(!r)throw new Error("Parent view not found");return r}},{key:"pushAddSubProductJob",value:function(e,t,r,a){var o=this;e.push((0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n;r&&(n=o.getViewOfProductUUID(r,a)),R.K.sceneManager().addNode(t,n,!1),e(!0)})));case 1:case"end":return e.stop()}}),e)}))))}},{key:"pushSubProductReconfigurationJob",value:function(e,t,r,a){var s=this,u=function(){var u=(0,n.A)(i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise((function(n){var i,u;if(t.type===Y.REFERENCE_PRODUCT&&Number(t.scene_object_id)>0){var c,l=R.K.sceneManager().findNodesOfType(Na.t.TypeRTTI,(function(e){return e.getSceneObjectId()===Number(t.scene_object_id)})),h=(null===(c=u=(0,o.A)(l,1)[0])||void 0===c?void 0:c.getChildrenDerivedTypeOf(kt.i.TypeRTTI))||[];i=(0,o.A)(h,1)[0],s.pushReconfigurationJob(e,t,i,r)}else i=R.K.sceneManager().createObject("product",null,t.catalogue_id,!0,t),s.pushAddSubProductJob(e,i,a[t.parent_uuid],t.view_id);if(!i)return n(!0);i.setValue("name","Product id:".concat(t.catalogue_id)),t.uuid&&i.setValue("object_uuid",t.uuid),a[t.uuid]=i.getValue("object_uuid"),t.temporary_uid&&i.setValue("temporary_uid",t.temporary_uid),t.view_position&&3===t.view_position.length&&((u||i).setValue("position_x",t.view_position[0]),(u||i).setValue("position_y",t.view_position[1]),(u||i).setValue("position_z",t.view_position[2])),t.view_quaternion&&4===t.view_quaternion.length?((u||i).setValue("quaternion_x",t.view_quaternion[0]),(u||i).setValue("quaternion_y",t.view_quaternion[1]),(u||i).setValue("quaternion_z",t.view_quaternion[2]),(u||i).setValue("quaternion_w",t.view_quaternion[3])):t.view_rotation&&3===t.view_rotation.length&&((u||i).setValue("rotation_x",t.view_rotation[0]),(u||i).setValue("rotation_y",t.view_rotation[1]),(u||i).setValue("rotation_z",t.view_rotation[2])),t.clipping_plane&&i.setValue("clipping_plane",t.clipping_plane),t.place_holder&&i.setValue("place_holder",t.place_holder),n(!0)})));case 1:case"end":return n.stop()}}),n)})));return function(){return u.apply(this,arguments)}}();e.push(u)}},{key:"pushReconfigurationJob",value:function(e,t,r,a){var o=this;e.push((0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(new A).load(r,t,(function(e){o.propagateEvent("progress_reconfigure",Math.floor(100*e)*(1/a))})));case 1:case"end":return e.stop()}}),e)}))))}},{key:"buildReconfigurationJobs",value:function(e){var t={},n=[];if(0===e.length)throw new Error("Did not found the main product");var r=this.countItemsLoadHierarchy(e),i=[];i.push.apply(i,(0,a.A)(e.slice()));for(var o=0;i.length>0;){var s=i.shift();if(0===o){var u=R.K.sceneManager().getRootProductNode();s.uuid&&u.setValue("object_uuid",s.uuid),t[s.uuid]=u.getValue("object_uuid"),s.temporary_uid&&u.setValue("temporary_uid",s.temporary_uid),this.pushYieldOnActiveRootProductBuild(n),this.pushReconfigurationJob(n,s,u,r),this.pushBuildSceneJobIfAnyReferenceProductsExists(n,e)}else this.pushSubProductReconfigurationJob(n,s,r,t);s.children&&s.children.forEach((function(e){return i.push(e)})),o+=1}return n}},{key:"reconfigureProduct",value:(x=(0,n.A)(i().mark((function e(){var t=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){if(0===t.mPresetState.configuration.configured_products.length)return r("Configuration list is empty");t.propagateEvent("progress_reconfigure",1);try{var a=t.buildHierarchyReconfigure(t.mPresetState.configuration.configured_products);v.UX.print("load hierarchy:",JSON.parse(JSON.stringify(a)));var o=t.buildReconfigurationJobs(a);l.N.executeInOrder(o,function(){var r=(0,n.A)(i().mark((function n(r,a){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.updateRootProductScene();case 2:e(0===a.length);case 3:case"end":return n.stop()}}),n)})));return function(e,t){return r.apply(this,arguments)}}())}catch(e){r(e.message)}})));case 1:case"end":return e.stop()}}),e)}))),function(){return x.apply(this,arguments)})},{key:"buildHierarchyReconfigure",value:function(e,t){var n=this,r=e.filter((function(e){return e.parent_uuid===t||!t&&!e.parent_uuid}));return r.forEach((function(t){t.children=n.buildHierarchyReconfigure(e,t.uuid)})),r}},{key:"onWindowResized",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.mViewContainer.offsetWidth,n=this.mViewContainer.offsetHeight;if((!1!==e||t!==this.mContainerWidth||n!==this.mContainerHeight)&&(this.mContainerWidth=t,this.mContainerHeight=n,p.setStyle(this.mViewWrapper,{width:"".concat(this.mContainerWidth,"px"),height:"".concat(this.mContainerHeight,"px")}),this.mInitialized)){var r={width:this.mContainerWidth,height:this.mContainerHeight};R.K.eventBus().dispatch(new K.r(Q.E.WindowResized,r))}}},{key:"_requestPrice",value:(T=(0,n.A)(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node.");case 3:return r=n.getComponent("priceManager"),v.UX.print("calculate price with manager: ",r),e.abrupt("return",r.requestPrice());case 6:case"end":return e.stop()}}),e,this)}))),function(e){return T.apply(this,arguments)})},{key:"_serializeConfigurations",value:(b=(0,n.A)(i().mark((function e(t){var r=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){var o=[],s=[];s.push({node:R.K.sceneManager().getScene(),parent_uuid:void 0,view_id:void 0});for(var u=function(){var e,a=s.shift(),u=a.parent_uuid,c=a.view_id;a.node.isDerivedTypeOf(kt.i.TypeRTTI)?(o.push((0,n.A)(i().mark((function e(){var n,o,s,u,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.node.getSceneObjectId(),o=a.node.getObjectUUID(),s=a.parent_uuid,u=a.node.getValue("temporary_uid"),c=a.view_id,e.abrupt("return",r._saveConfiguration(n,o,s,c,r.mPresetState.bundleUuid,u,t));case 6:case"end":return e.stop()}}),e)})))),u=a.node.getObjectUUID()):a.node.isDerivedTypeOf(ss.TypeRTTI)&&(c=a.node.getViewId());var l=a.node.isDerivedTypeOf(ss.TypeRTTI)?a.node:null;a.node.isDerivedTypeOf(Eo.Z.TypeRTTI)&&(null===(e=null==l?void 0:l.isViewVisible())||void 0===e||e)&&a.node.getChildren().forEach((function(e){s.push({node:e,parent_uuid:u,view_id:c})}))};s.length>0;)u();l.N.executeInOrder(o,(function(t,n){n.length>0?a(n[0]):e(t)}),!0)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return b.apply(this,arguments)})},{key:"saveConfiguration",value:(g=(0,n.A)(i().mark((function t(){var n,r,a,o,s,u,c,l,h,m=arguments;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=m.length>0&&void 0!==m[0]?m[0]:512,r=m.length>1&&void 0!==m[1]?m[1]:512,a=m.length>2&&void 0!==m[2]?m[2]:G.ACTIVE_CAMERA,o=m.length>3&&void 0!==m[3]?m[3]:"image/jpeg",s=m.length>4?m[4]:void 0,t.next=7,this.requestScreenshot(n,r,a,o,s);case 7:return u=t.sent,t.next=10,this._serializeConfigurations(s);case 10:return c=t.sent,Array.isArray(c)&&c.length>0&&(c[0].thumbnail=u),l={},h=c.map((function(t){var n=f.V.Md5("".concat(JSON.stringify(t.configuration)).concat(t.catalogue_id));return n in l?(delete t.configuration,delete t.attributes,delete t.articles,delete t.price,t.replication_type=e.REPLICA,t.original_uuid=l[n]):(t.replication_type=e.ORIGINAL,l[n]=t.uuid?t.uuid:f.V.guid()),t})),t.abrupt("return",{bundle_uuid:this.mPresetState.bundleUuid,configured_products:h});case 15:case"end":return t.stop()}}),t,this)}))),function(){return g.apply(this,arguments)})},{key:"determineConfiguredProductType",value:function(e){return e.findParentOfTypeName("ReferenceProductNode")?Y.REFERENCE_PRODUCT:e.findParentOfTypeName("ProductNode")?Y.SUB_PRODUCT:Y.ROOT_PRODUCT}},{key:"getControlledProductNodeSceneObjectId",value:function(e){var t=e.findParentOfTypeName("ReferenceProductNode");return t?t.getSceneObjectId():e.getSceneObjectId()}},{key:"_saveConfiguration",value:(d=(0,n.A)(i().mark((function e(t,n,r,a,o,s,u){var c,l,h,f,m,p,d,v;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=this.findProductNode(t),h=l.getComponent("productSceneLoaderComponent"),e.next=4,new Promise((function(e){window.setTimeout((function(){e()}),50)}));case 4:return e.next=6,(0,y._)(h.loaderIdle().pipe((0,w.p)((function(e){return e}))));case 6:return e.next=8,this._requestPrice(t);case 8:if(f=e.sent,l){e.next=11;break}throw new Error("Could not find product node.");case 11:return m=null!==(c=l.getParent())&&void 0!==c&&c.isTypeOf(Na.t.TypeRTTI)?l.getParent():l,p=new A(u),e.next=15,p.save(l,f.articles);case 15:return d=e.sent,v=this.getControlledProductNodeSceneObjectId(l),d.type=this.determineConfiguredProductType(l),d.scene_object_id=v>0?v:null,d.uuid=n,d.parent_uuid=r,d.temporary_uid=s,d.bundle_uuid=o,d.view_id=a,d.view_position=m.transform.position.toArray(),d.view_rotation=m.transform.rotation.toArray(),d.view_quaternion=m.transform.quaternion.toArray(),d.view_scale=m.transform.scale.toArray(),d.price=f.totals,e.abrupt("return",d);case 30:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i,a,o){return d.apply(this,arguments)})},{key:"updateOptions",value:function(e){e.rebuild&&(this.propagateEvent("loading_configuration",!0),v.UX.print("options request scene build"),R.K.eventBus().dispatch(new K.r(Q.E.BuildStarted)),R.K.eventBus().dispatch(new K.r(Q.E.BuildUpdated)),R.K.eventBus().enableTopic(K.r.getTopicName(Q.E.RequestFrame)),this.propagateEvent("loading_configuration",!1),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)))}},{key:"findProductNode",value:function(e){var t,n=h.N5.resolveInt(e),r=h.N5.resolveUuid(e);return void 0===r&&void 0===n?R.K.sceneManager().getRootProductNode():(R.K.sceneManager().findNodesOfType(kt.i.TypeRTTI).every((function(e){return r&&e.getObjectUUID()===r?(t=e,!1):!(!r&&e.getSceneObjectId()===n)||(t=e,!1)})),t)}},{key:"resolveConfigurableNode",value:(r=(0,n.A)(i().mark((function e(t){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=n.findProductNode(t);if(!i)return r("Product not found");i.onConfigurableNodeReady.pipe((0,E.s)(1)).subscribe({next:function(t){e(t)},error:function(e){r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"handleRotations",value:function(){var e=this;if(this.mInitialized){this.mRotationActive=!0;var t=[];this.mRotatingObjects.forEach((function(e){void 0===e.rotationY&&(e.rotationY=e.sceneNode.transform.rotation.y),e.degree+=200*e.speed,e.maxDegree>=0&&e.degree>e.maxDegree&&(e.degree=e.maxDegree,t.push(e.id)),e.sceneNode.transform.rotation.y=(Number(e.rotationY)||0)+(0,_.pu)(e.degree)})),R.K.eventBus().dispatch(new K.r(Q.E.RequestFrame)),t.forEach((function(t){var n=e.mRotatingObjects.findIndex((function(e){return e.id===t}));n>=0&&e.mRotatingObjects.splice(n,1)})),this.mRotatingObjects.length>0?window.setTimeout((function(){window.requestAnimationFrame((function(){return e.handleRotations()}))}),16):this.mRotationActive=!1}}},{key:"addPlayRotation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:360,i=this.mRotatingObjects.find((function(t){return t.id===e.getObjectId()}));i?(i.speed=.001*n,i.stopOnInteraction=t,i.maxDegree=r):this.mRotatingObjects.push({id:e.getObjectId(),sceneNode:e,speed:.001*n,stopOnInteraction:t,maxDegree:r,degree:0}),this.mRotationActive||this.handleRotations()}},{key:"requestScreenshot",value:(t=(0,n.A)(i().mark((function e(){var t,n,r,a,o,s,u,c,l,h,f,m=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=m.length>0&&void 0!==m[0]?m[0]:512,n=m.length>1&&void 0!==m[1]?m[1]:512,r=m.length>2&&void 0!==m[2]?m[2]:G.ACTIVE_CAMERA,a=m.length>3&&void 0!==m[3]?m[3]:"image/jpeg",o=m.length>4?m[4]:void 0,!(t*n<=0)){e.next=7;break}return e.abrupt("return",void 0);case 7:return this.mViewerComponent.renderView(1/60),s=R.K.renderer().getRenderEngine().getCanvas(),u=s.toDataURL("image/jpeg"),c=this.mContainerWidth,l=this.mContainerHeight,R.K.eventBus().dispatch(new K.r(Q.E.ScreenshotTransitionStart,{image_data:u,image_width:c,image_height:l})),s.width=t,s.height=n,p.setStyle(s,{width:"".concat(s.width,"px"),height:"".concat(s.height,"px")}),R.K.renderer().getRenderEngine().setPixelRatio(1),R.K.renderer().getRenderEngine().setSize(t,n),h="",e.prev=19,f=R.K.sceneManager().getRootProductNode(),e.next=23,this.mViewerComponent.renderCamera(r,f,a,o);case 23:h=e.sent,e.next=29;break;case 26:e.prev=26,e.t0=e.catch(19),v.UX.error(e.t0);case 29:return s.width=c,s.height=l,p.setStyle(s,{width:"".concat(s.width,"px"),height:"".concat(s.height,"px")}),R.K.renderer().getRenderEngine().setPixelRatio(window.devicePixelRatio),R.K.renderer().getRenderEngine().setSize(c,l),this.mViewerComponent.renderView(1/60),R.K.eventBus().dispatch(new K.r(Q.E.ScreenshotTransitionEnd),void 0,void 0,0),e.abrupt("return",h);case 37:case"end":return e.stop()}}),e,this,[[19,26]])}))),function(){return t.apply(this,arguments)})},{key:"setPriceVisibility",value:function(e){var t=e.itemId,n=e.visible,r=e.productNode;this.propagateEvent("material_price",{id:t,material_price:n,product_uuid:r.getObjectUUID(),product_scene_id:r.getSceneObjectId()})}},{key:"playSound",value:function(e){var t=e.getData();t&&t.url&&new Z_.Howl({src:[t.url],html5:!0}).play()}},{key:"getServices",value:function(){return this.mServices}},{key:"select",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return!(!(t=e&&e instanceof Hs.i?e instanceof kt.i?e:e.findParentOfType(kt.i.TypeRTTI):void 0)&&!this.mSelectedProduct||this.mSelectedProduct&&t&&this.mSelectedProduct.getSceneObjectId()===t.getSceneObjectId())&&(this.mSelectedProduct=t,r&&R.K.eventBus().dispatch(new K.r(Q.E.ObjectSelected,{selection:this.mSelectedProduct,options:n})),!0)}},{key:"deselect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.select(void 0,e,t)}},{key:"propagateEvent",value:function(e,t){var n=null!=t?{payload:t}:{};window.expivi._events.onChange.next(GM({name:e},n))}},{key:"propagateReady",value:function(e){window.expivi._events.onReady.next({error:null!=e,err:e})}}]);var t,r,d,g,b,T,x,S,I,O,P,B}();(qM||(qM={})).V1_Ready="v1.ready";var KM=function(){function e(){(0,s.A)(this,e),this.handleQuerystringOptions(),window.addEventListener("message",e.handleIncomingMessage),this.sendMessage(qM.V1_Ready,void 0,!0)}return(0,u.A)(e,[{key:"handleQuerystringOptions",value:function(){new window.URL(window.location.href).searchParams.getAll("handleQuerystringOptions").forEach((function(e){}))}},{key:"sendMessage",value:(r=(0,n.A)(i().mark((function t(n){var r,a,o=arguments;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:void 0,a=o.length>2&&void 0!==o[2]&&o[2],t.abrupt("return",new Promise((function(t,i){var o=e.generateMessage(n,r,a);e.addEventListener(n,(function(e){return o.uuid===e.uuid&&("finished"!==e.state?(i(e),!0):(t(e.payload),!0))})),window.parent.postMessage(o,"*")})));case 3:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)})},{key:"sendMessageToHost",value:(t=(0,n.A)(i().mark((function e(t){var n,r=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:void 0,e.abrupt("return",this.sendMessage(t,n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"dispose",value:function(){if(window.removeEventListener("message",e.handleIncomingMessage),e.listeners){for(var t in e.listeners)e.listeners[t].splice(0);delete e.listeners}}}],[{key:"handleIncomingMessage",value:function(t){if(t.data.xpv&&void 0!==t.data.type){var n=t.data.type,r=e.listeners[n];if(void 0!==r&&r.length>0)for(var i=r.length-1;i>=0;i--){r[i](t.data)&&e.listeners[n].splice(i,1)}}}},{key:"addEventListener",value:function(t,n){void 0!==e.listeners[t]?e.listeners[t].push(n):e.listeners[t]=[n]}},{key:"generateMessage",value:function(e){return{xpv:!0,type:e,state:arguments.length>2&&void 0!==arguments[2]&&arguments[2]?"finished":"pending",payload:arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,uuid:f.V.uuidV4()}}}]);var t,r}();function XM(){return YM.apply(this,arguments)}function YM(){return(YM=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){t("Resolved called before initialization.")})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $M(){return($M=(0,n.A)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){t("This function has been deprecated.")})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ZM(){return(ZM=(0,n.A)(i().mark((function e(t,n,r,a){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return window.expivi=window.expivi||{},window.expivi.apiToken=t,/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(navigator.userAgent.substr(0,4))?(void 0===window.isMobile&&(window.isMobile=!0),window.expivi.isMobile=!0):(void 0===window.isMobile&&(window.isMobile=!1),window.expivi.isMobile=!1),!window.parent||window.parent===window||a&&!0===a.disableIframeService||(window.expivi._iFrameService=new KM),window.expivi._events.onReady||(window.expivi._events.onReady=new L.m(1)),window.expivi._events.onChange||(window.expivi._events.onChange=new M.B),window.expivi.viewer=new WM(n,r,a),e.abrupt("return",window.expivi.viewer.init());case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,c.A)(KM,"listeners",{}),window.expivi=window.expivi||{},window.expivi.currentScript=document.currentScript,Object.assign(window.expivi,{apiToken:"",viewer:void 0,isMobile:!1,_events:{onReady:new L.m(1),onChange:new M.B},_create:function(e,t,n,r){return ZM.apply(this,arguments)},_dispatch:XM,_destroy:function(){window.expivi&&(window.expivi.viewer&&(window.expivi.viewer.destroy(),delete window.expivi.viewer),window.expivi.apiToken="",window.expivi._events.onReady&&(window.expivi._events.onReady.unsubscribe(),delete window.expivi._events.onReady),window.expivi._events.onChange&&(window.expivi._events.onChange.unsubscribe(),delete window.expivi._events.onChange),window.expivi._iFrameService&&(window.expivi._iFrameService.dispose(),delete window.expivi._iFrameService))},_iFrameService:void 0,managers:{resolveMaterialGroups:XM,resolveMaterialGroupManager:XM,resolveOffsetGroups:XM,resolveMaterials:XM,resolveTextures:XM,resolveMaterialManager:XM},resolveSvgElementBoundaries:XM,getAttributeById:XM,getMatgroupOptions:XM,getColorOptions:XM,getQuestionOptions:XM,getProductAttributes:XM,setProductAttribute:XM,setProductAttributeNamed:XM,setProductAttributeByKey:XM,resetProductAttribute:XM,getActiveMaterial:XM,setActiveMaterial:XM,applyActiveMaterial:XM,getScreenshot:XM,registerPriceCalculator:XM,getPrice:XM,getAllPrices:XM,getSupportedLocales:XM,setNodeProperty:XM,getSceneObj:XM,getActiveCamera:function(){return $M.apply(this,arguments)},changeCameraZoom:XM,saveConfiguration:XM,loadConfiguration:XM,loadPreset:XM,resolveProductNodes:XM,selectProductNode:XM,autoRotateYAxis:XM,deselect:XM,deleteNode:XM,usesCatalogueBrowser:XM,getCatalogueProducts:XM,getCatalogueProductById:XM,getCameraTransform:XM,setCameraTransform:XM,addProduct:XM,moveProduct:XM,removeProduct:XM,getService:XM,getCategories:XM})}()})();